Support Topics Documentation Slack YouTube Blog

Can't deploy business logic through Code Runner


(Matt) #1

Hey,
After a while on Backendless v3 I’ve decided to switch to V4.
I’m trying to deploy custom services and one handler.
As you can see from the log, when the Code Runner starts everything is OK. Also the services and handler shows at the Backendless panel as “in debug”. When I run the build command it bumps the number of handlers to 2 (I still have only one) and then I’m unable to publish and deploy (running build command bump this counter every time).
In case of services I can do a workaround and just upload a jar file. The problem I’ve noticed here is that firstly I need to manually delete all services and then upload jar. Otherwise the old services won’t be replaced.
Can this be fixed on my side?


Listening for transport dt_socket at address: 5005
[INFO] JDK from "JAVA_HOME" - /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
[INFO] CodeRunner(tm) Backendless Debugging Utility
[INFO] Copyright(C) 2017 Backendless Corp. All rights reserved. 
[INFO] Version: 4.0.b18 Build date: 2017-07-06T09:22:55Z
[INFO] CodeRunner session is running for 2 hours and will be terminated on 07:17:35.454[UTC]


[INFO] Registering runner on: 'https://api.backendless.com'
[INFO] Application ID: '00D0941B-86A9-90A9-FFE0-BA830404AA00'
[INFO] Secret key: 'secret key'
[INFO] Runner successfully registered
[INFO] Parsing event model...
[INFO] Run dependency analyzer for app: 00D0941B-86A9-90A9-FFE0-BA830404AA00
ClassPath: /<path_to_project>/libs/backendless.jar:/<path_to_project>/libs/servlet-api-2.5.jar
[INFO] Analyze service: com.mbaas.service.PaymentsService
[INFO] Analyze service: com.mbaas.service.PlayerService
[INFO] Analyze service: com.mbaas.service.RoomService
[INFO] Build successfully: 1 event handler and 0 timers and 3 services
[INFO] Deploying model to server, and starting debug...
[INFO] Model successfully deployed.
[INFO] Waiting for events...
build
[INFO] Parsing event model...
[INFO] Run dependency analyzer for app: 00D0941B-86A9-90A9-FFE0-BA830404AA00
ClassPath: <path_to_project>/libs/backendless.jar:/<path_to_project>/libs/servlet-api-2.5.jar
[INFO] Analyze service: com.mbaas.service.PaymentsService
[INFO] Analyze service: com.mbaas.service.PlayerService
[INFO] Analyze service: com.mbaas.service.RoomService
[INFO] Build successfully: 2 event handlers and 0 timers and 3 services
deploy
[INFO] Deploying model to server, and starting debug...
[ERROR] Event handler with specified parameters already exists
publish
[WARN] IMPORTANT! The business logic code will be deployed to model "default".
Any business logic which is already deployed on the server in that model
will be removed and replaced with the code from your current project.
If this is an undesired behavior, stop now and set a different deployment model
either by using the -model argument or changing the model name in runner.properties.
Would you like to continue? (Y/N)
Y
[WARN] You should deploy your business logic first!



(Sergey Chupov) #2

Hi Matt,

What exactly is the command you’re executing? Is it ./CodeRunner.sh deploy?


(Matt) #3

Hi, at the beginning I’m executing just ./CodeRunner.sh, then as you can see from the log: build, deploy and publish.


(Sergey Chupov) #4

Could you try to compile the code and then execute

./CodeRunner.sh deploy

?


(Matt) #5

Executing

./CodeRunner.sh deploy 

works as expected - handlers and services are published.


(Sergey Chupov) #6

Wasn’t this what you were trying to accomplish? :slight_smile:


(Matt) #7

That’s true, thanks! Although this doesn’t solve the problem with Code Runner :slight_smile: Looks like there is some bug. It’s not a big deal with your workaround.


(Sergey Chupov) #8

It just looks like you’ve been using the deprecated way of working with it (we do not have mentions of ‘build’ and ‘publish’ command in the documentation).