Error when running CodeRunner

hey guys,

I’m running CodeRunner and getting this error:

[ERROR] Seems, that the class location is wrong. Please, check it and run CodeRu
nner again.

What class definition is it refering to?
please let me know if you need any further details.

Thanks,
Tal

Possibly to the directory where CodeRunner expects to find the .class files. The directory is specified in the bin/runner.properties file.

Mark

great! that was the issue.

but now it failed deploying to server:

Starting CodeRunner
Listening for transport dt_socket at address: 5005
[INFO] CodeRunner™ Backendless Debugging Utility
[INFO] Copyright© 2016 Backendless Corp. All rights reserved.
[INFO] Version: 3.0.0 Build date: 20160219-0848
[INFO] CodeRunner session is running for 2 hour and will be terminated on 15:24:02.183[UTC]

[INFO] Registering runner on: http://api.backendless.com with secretKey: [hidden by me]
[INFO] Runner successfully registered
[INFO] Parsing event model…
[INFO] Build successfully: 0 handlers, 0 timers, 1 service
[INFO] Deploying model to server, and starting debug…
[ERROR] Failed deploying service
[INFO] Debugging Utility disconnected successfully
[INFO] Thank you for using Backendless

this is the relevant part from my runner.properties file:

System properties

Don’t touch, if you do not really understand this

system.server.url = http://api.backendless.com

system.redis.master.host = cl.backendless.com
system.redis.master.port = 6379

#system.redis.slave.host = cl.backendless.com
#system.redis.slave.port = 6379

#amazon.sqs = secret
#amazon.imageId = secret
#amazon.instanceType = secret
#amazon.keyName = secret
#amazon.securityGroup = secret
#amazon.subnetId = secret

genericservice.loadall_from_libs = false
system.services.exclude.jar = backendless.jar,servlet-api-.jar,weborb-.jar
system.weborb.path = ./none.jar

system.pool.core = 20
system.type = LOCAL
system.repo.path = …/repo/

enterprise.allowedHosts = localhost,
127.0.0.1,
api.backendless.com,
backendless.chargify.com,
backendlesstest.chargify.com
Thanks

I didn’t go through your properties file to compare, did you make any changes in there?

Yes I changed this part, and then I could move past my first problem:

Optional argument. Search path for classes which will be used for debugging or publishing.

By default Code Runner looks for the ./build/classes directory located in the current directory

location.classes = …/src/main/java/com/taldroid/backendapi/tapextreme/build/
//…/classes/

Optional argument. Search path for jar files which are the dependencies for the code which is debugged or published.

By default Code Runner looks for the ./build/libs directory located in the current directory.

location.jar = …/src/main/java/com/taldroid/backendapi/tapextreme/build/
//…/libs/

What is the total cumulative size (in kb) of the all the JAR file and the files in the /classes directory?

Hi Tal,

Please send us your service to support@backendless.com so that we can figure out what was the root issue.

Regards, Artur.

Mark, The size of my libs folder is 1 MB.
containing backendless,jar, servlet-api-2.5.jar.

Arthur, I’ve sent my service project to support@backendless.com

Thanks, Tal. We got the file and I assigned a ticket to a developer.

Regards,
Mark

Thank you

Hey guys… This is currebyAny news on this

Hey guys,
Are there any news here? I’m waiting for this one to go ahead with the backend api…

Thanks

Hi Tal,

The problem arises from the configuration changes you made in runner.properties. Pointing both location.classes and location.jar to the same directory is not a good idea. What you should do is this:

    Configure IDE to compile your code into a directory located outside of the "src" directory structure. Modify the location.classes property in the runner.properties file to point to the directory from (1) Change the location.jar property to what it was before (must point to the libs folder from the CodeRuner SDK distribution.
I tried deploying your service after making the changes described above and it deployed just fine:
[INFO] CodeRunner(tm) Backendless Debugging Utility
[INFO] Copyright(C) 2016 Backendless Corp. All rights reserved. 
[INFO] Version: 3.0.0 Build date: 20160219-0848
[INFO] CodeRunner session is running for 2 hour and will be terminated on 11:32:41.176[UTC]
[INFO] Registering runner on: http://api.backendless.com with secretKey: DE9180F0-XXXXXX
[INFO] Runner successfully registered
[INFO] Parsing event model...
[INFO] Build successfully: 0 handlers, 0 timers, 1 service
[INFO] Deploying model to server, and starting debug...
[INFO] Model successfully deployed.
[INFO] Waiting for events...

I also tried deploying the service directly in console, and it worked there as well:
http://support.backendless.com/public/attachments/a7fee371e3c0f2c18482d67d3fb7a0a2.jpg</img>

Regards,
Mark

Thanks Mark,I made the changes. but still getting the same error:

[ERROR] Failed deploying service

This is from runner.properties:

Optional argument. Search path for classes which will be used for debugging or publishing.

By default Code Runner looks for the ./build/classes directory located in the current directory

location.classes = …/build/classes/main/
//…/classes/

Optional argument. Search path for jar files which are the dependencies for the code which is debugged or published.

By default Code Runner looks for the ./build/libs directory located in the current directory.

location.jar = …/libs/I am thinking maybe I am not packaging the jar right…I attached some screenshots

libs_folder.png

Here’s the structure that works:

/CodeRunner Root/
/bin << comes with code runner
/libs << comes with code runner
/classes << create this directory

You have a choice of:

  1. Compile classes into the /classes directory. If you do that, it should contain directories for your packages too (that is full path will be /classes/com/tabloid/backendapi/…etc

OR

  1. put your jar file into the “libs” folder

Make sure to run CodeRunner.sh from the bin directory.

Mark

OK! the mystery is solve, from another direction.

I had already a service with the same name, that I uploaded straight in the Business logic console.
I deleted it, and the running the CodeRunner was successful.

Also I could run a hello world service and see it printed.

still trying to save to a table failed, but I will open another topic for that the benefit of the forum.

Thanks,
Tal