Deploy.sh timeout

I can run my Java API in Debug Mode using ./CodeRunner.sh, but when I try to publish using ./Deploy.sh for the Java API, it hesitates during publish and then times out with the following. Any ideas?

19:19:59.637 [INFO] c.b.c.d.DebuggerConsoleInterface |main| Publishing 0 event handlers and 0 timers and 1 service to the server…
19:24:04.764 [ERROR] c.b.c.CodeRunnerLoader |main| Can not parse generic service: BusinessLogicExecutionTimeoutException: Custom business logic execution has been terminated because it did not complete in permitted time - 243 seconds
19:24:04.766 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Debugging Utility disconnected successfully
19:24:04.767 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Thank you for using Backendless

Hi Mark,

Here’s what I did:

  1. Downloaded from Project Templates the “API Service” template:
  2. Compiled the code (make sure you’re using at least JDK 11)
  3. Opened a command prompt window and changed the directory to “bin” from the downloaded project structure.
  4. Ran “Deploy.bat” (I am on windows at the moment)
  5. This is the output I got:
C:\Users\mark\Downloads\ConsoleDemo-generated\ConsoleDemo\bin>Deploy.bat
Starting CodeRunner
14:05:34.658 [INFO] c.b.c.CodeRunnerLoader |main| JDK from "JAVA_HOME" - D:\dev\JDK\11\jdk-11
14:05:34.694 [INFO] c.b.c.CommandLineProcessor |main| CodeRunner(tm) Backendless Debugging Utility
14:05:34.698 [INFO] c.b.c.CommandLineProcessor |main| Copyright(C) 2020 Backendless Corp. All rights reserved.
14:05:34.701 [INFO] c.b.c.CommandLineProcessor |main| Build date: 2020-04-17T14:59:30Z
Version: 5.7.3.3.cloud
Build id: 109534
VCS revision: 8d13a23376a678d01eb3728fe53d7bc62cbc44c4
14:05:34.706 [INFO] c.b.c.CommandLineProcessor |main| CodeRunner session is running for 2 hours and will be terminated on 16:05:34.703847200[UTC]

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.backendless.coderunner.runtime.security.CodeRunnerSecurityManager (file:/C:/Users/mark/Downloads/ConsoleDem
o-generated/ConsoleDemo/bin/CodeRunner.jar) to field java.lang.ThreadGroup.nUnstartedThreads
WARNING: Please consider reporting this to the maintainers of com.backendless.coderunner.runtime.security.CodeRunnerSecurityManager
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
14:05:34.730 [INFO] c.b.h.HealthCheckHttpServer |main| Management port is absent, management server not started
14:05:34.906 [INFO] c.b.c.parser.EventModelParser |main| Parsing event model...
14:05:35.452 [INFO] c.b.c.r.t.CustomServiceParserTask |main| Run dependency analyzer for app: DDA6CE4B-5AE3-B4BB-FF61-021A41EA4100
ClassPath: C:\Users\mark\Downloads\ConsoleDemo-generated\ConsoleDemo\libs\backendless.jar;C:\Users\mark\Downloads\ConsoleDemo-generated\ConsoleDemo\l
ibs\servlet-api-2.5.jar
14:05:35.456 [INFO] DependencyAnalyzer |main| Analyze service: com.sample.api.DemoService
14:05:35.985 [INFO] c.b.c.d.DebuggerConsoleInterface |main| Build successfully: 0 event handlers and 0 timers and 1 service
14:05:35.994 [WARN] c.b.c.d.DebuggerConsoleInterface |main| IMPORTANT! The business logic code will be deployed to model "test".
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
14:05:38.248 [INFO] c.b.c.d.DebuggerConsoleInterface |main| Publishing 0 event handlers and 0 timers and 1 service to the server…
14:05:43.370 [INFO] c.b.c.d.DebuggerConsoleInterface |main| Successfully published all event handlers and timers.
14:05:43.372 [INFO] c.b.c.d.DebuggerConsoleInterface |main| If you connected to coderunner for debug - please stop debugging
14:05:43.373 [INFO] c.b.c.d.DebuggerConsoleInterface |main| CodeRunner will shutdown now
14:05:43.377 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Debugging Utility disconnected successfully
14:05:43.379 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Thank you for using Backendless

I can now see the service in the Cloud Code section of Backendless Console. Could you please try the same steps? I just want to make sure the basic deployment works from your machine. If it does, then the problem must be related to the code itself and possibly any dependencies it has.

Regards,
Mark

Thanks! Here is the full log from the last run of my code. See below log for attempt of generic download template

mark@Marks-MacBook-Pro bin % ./Deploy.sh
Path to “JAVA_HOME”: /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
Running CodeRunner …
env JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home/bin/java -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -server -Xms384m -Xmx768m -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dlogback.configurationFile=logback.xml -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=:5005 -Dcom.sun.management.jmxremote.port=1097 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=backendless-dev.local -cp ":…/libs/*" com.backendless.coderunner.CodeRunnerLoader deploy
Listening for transport dt_socket at address: 5005
21:47:24.284 [INFO] c.b.c.CodeRunnerLoader |main| JDK from “JAVA_HOME” - /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
21:47:24.298 [INFO] c.b.c.CommandLineProcessor |main| CodeRunner™ Backendless Debugging Utility
21:47:24.298 [INFO] c.b.c.CommandLineProcessor |main| Copyright(C) 2020 Backendless Corp. All rights reserved.
21:47:24.299 [INFO] c.b.c.CommandLineProcessor |main| Build date: 2020-04-09T07:56:32Z
Version: 5.7.3.2.cloud
Build id: 109382
VCS revision: 0ac8875b8db32406265593e698239609af74e398
21:47:24.300 [INFO] c.b.c.CommandLineProcessor |main| CodeRunner session is running for 2 hours and will be terminated on 23:47:24.299843[UTC]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.backendless.coderunner.runtime.security.CodeRunnerSecurityManager (file:/Users/mark/Projects/Customer%20Support%20Backendless%20API/bin/CodeRunner.jar) to field java.lang.ThreadGroup.nUnstartedThreads
WARNING: Please consider reporting this to the maintainers of com.backendless.coderunner.runtime.security.CodeRunnerSecurityManager
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
21:47:24.323 [INFO] c.b.h.HealthCheckHttpServer |main| Management port is absent, management server not started
21:47:24.444 [INFO] c.b.c.parser.EventModelParser |main| Parsing event model…
21:47:24.824 [INFO] c.b.c.r.t.CustomServiceParserTask |main| Run dependency analyzer for app: 5571A518-B5D9-43D0-8B58-D285A3CE1E74
ClassPath: /Users/mark/Projects/Customer Support Backendless API/libs/servlet-api-2.5.jar:/Users/mark/Projects/Customer Support Backendless API/libs/backendless.jar
21:47:24.825 [INFO] DependencyAnalyzer |main| Analyze service: us.boundlessdesign.customersupportbackend.MobileService
21:47:25.045 [INFO] c.b.c.d.DebuggerConsoleInterface |main| Build successfully: 0 event handlers and 0 timers and 1 service
21:47:25.047 [WARN] c.b.c.d.DebuggerConsoleInterface |main| 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
21:47:27.756 [INFO] c.b.c.d.DebuggerConsoleInterface |main| Publishing 0 event handlers and 0 timers and 1 service to the server…
21:51:32.693 [ERROR] c.b.c.CodeRunnerLoader |main| Can not parse generic service: BusinessLogicExecutionTimeoutException: Custom business logic execution has been terminated because it did not complete in permitted time - 243 seconds
21:51:32.695 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Debugging Utility disconnected successfully
21:51:32.696 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Thank you for using Backendless

Here’s the log from running the blank downloaded code:

mark@Marks-MacBook-Pro bin % ./Deploy.sh
Path to “JAVA_HOME”: /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
Running CodeRunner …
env JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home/bin/java -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -server -Xms384m -Xmx768m -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dlogback.configurationFile=logback.xml -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=:5005 -Dcom.sun.management.jmxremote.port=1097 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=backendless-dev.local -cp ":…/libs/*" com.backendless.coderunner.CodeRunnerLoader deploy
Listening for transport dt_socket at address: 5005
18:22:45.960 [INFO] c.b.c.CodeRunnerLoader |main| JDK from “JAVA_HOME” - /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
18:22:45.976 [INFO] c.b.c.CommandLineProcessor |main| CodeRunner™ Backendless Debugging Utility
18:22:45.977 [INFO] c.b.c.CommandLineProcessor |main| Copyright(C) 2020 Backendless Corp. All rights reserved.
18:22:45.977 [INFO] c.b.c.CommandLineProcessor |main| Build date: 2020-04-17T14:59:30Z
Version: 5.7.3.3.cloud
Build id: 109534
VCS revision: 8d13a23376a678d01eb3728fe53d7bc62cbc44c4
18:22:45.978 [INFO] c.b.c.CommandLineProcessor |main| CodeRunner session is running for 2 hours and will be terminated on 20:22:45.978299[UTC]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.backendless.coderunner.runtime.security.CodeRunnerSecurityManager (file:/Users/mark/Downloads/Customer_Support_Application2/bin/CodeRunner.jar) to field java.lang.ThreadGroup.nUnstartedThreads
WARNING: Please consider reporting this to the maintainers of com.backendless.coderunner.runtime.security.CodeRunnerSecurityManager
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
18:22:46.006 [INFO] c.b.h.HealthCheckHttpServer |main| Management port is absent, management server not started
18:22:46.127 [WARN] c.b.c.d.DebuggerConsoleInterface |main| Seems, that the class location is wrong. You can set it in “runner.properties” config file.
18:22:46.130 [INFO] c.b.c.parser.EventModelParser |main| Parsing event model…
18:22:46.499 [INFO] c.b.c.d.DebuggerConsoleInterface |main| Build successfully: 0 event handlers and 0 timers and 0 services
18:22:46.501 [WARN] c.b.c.d.DebuggerConsoleInterface |main| 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
18:22:48.595 [INFO] c.b.c.d.DebuggerConsoleInterface |main| Publishing 0 event handlers and 0 timers and 0 services to the server…
18:26:53.310 [ERROR] c.b.c.CodeRunnerLoader |main| Can not parse generic service: BusinessLogicExecutionTimeoutException: Custom business logic execution has been terminated because it did not complete in permitted time - 243 seconds
18:26:53.312 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Debugging Utility disconnected successfully
18:26:53.312 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Thank you for using Backendless

When you download the project template, it includes an API service. Have you built that project before deploying it to Backendless? The following line from the log tells me it hasn’t been done:

Publishing 0 event handlers and 0 timers and 0 services to the server…

Regards,
Mark

I ran CodeRunner.sh prior to Deploy.sh. This is the build from the project template, so it has no API services at this time. Could this be a problem with my using a Mac, or java 14?

Here’s the log from CodeRunner

mark@Marks-MacBook-Pro bin % ./CodeRunner.sh
Path to “JAVA_HOME”: /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
Running CodeRunner …
env JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home/bin/java -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -server -Xms384m -Xmx768m -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dlogback.configurationFile=logback.xml -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=:5005 -Dcom.sun.management.jmxremote.port=1097 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=backendless-dev.local -cp ":…/libs/*" com.backendless.coderunner.CodeRunnerLoader
Listening for transport dt_socket at address: 5005
18:46:35.132 [INFO] c.b.c.CodeRunnerLoader |main| JDK from “JAVA_HOME” - /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
18:46:35.147 [INFO] c.b.c.CommandLineProcessor |main| CodeRunner™ Backendless Debugging Utility
18:46:35.147 [INFO] c.b.c.CommandLineProcessor |main| Copyright(C) 2020 Backendless Corp. All rights reserved.
18:46:35.148 [INFO] c.b.c.CommandLineProcessor |main| Build date: 2020-04-17T14:59:30Z
Version: 5.7.3.3.cloud
Build id: 109534
VCS revision: 8d13a23376a678d01eb3728fe53d7bc62cbc44c4
18:46:35.149 [INFO] c.b.c.CommandLineProcessor |main| CodeRunner session is running for 2 hours and will be terminated on 20:46:35.149278[UTC]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.backendless.coderunner.runtime.security.CodeRunnerSecurityManager (file:/Users/mark/Downloads/Customer_Support_Application2/bin/CodeRunner.jar) to field java.lang.ThreadGroup.nUnstartedThreads
WARNING: Please consider reporting this to the maintainers of com.backendless.coderunner.runtime.security.CodeRunnerSecurityManager
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
18:46:35.185 [INFO] c.b.h.HealthCheckHttpServer |main| Management port is absent, management server not started
18:46:35.185 [INFO] c.b.coderunner.LocalCodeRunner |main| Registering runner on: ‘https://api.backendless.com
18:46:35.187 [INFO] c.b.coderunner.LocalCodeRunner |main| Application ID: ‘5571A518-B5D9-43D0-8B58-D285A3CE1E74’
18:46:35.187 [INFO] c.b.coderunner.LocalCodeRunner |main| Api key: ‘5E4861F1-8132-4538-936D-69718270FF57’
18:46:36.220 [INFO] c.b.coderunner.LocalCodeRunner |main| Runner successfully registered
18:46:36.224 [WARN] c.b.c.d.DebuggerConsoleInterface |main| Seems, that the class location is wrong. You can set it in “runner.properties” config file.
18:46:36.228 [INFO] c.b.c.parser.EventModelParser |main| Parsing event model…
18:46:36.612 [INFO] c.b.c.d.DebuggerConsoleInterface |main| Build successfully: 0 event handlers and 0 timers and 0 services
18:46:36.613 [ERROR] c.b.c.CodeRunnerLoader |main| Could not find any code to be deployed to Backendless at /Users/mark/Downloads/Customer_Support_Application2/classes. Did you compile the project?
18:46:39.061 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Debugging Utility disconnected successfully
18:46:39.062 [INFO] c.b.coderunner.LocalCodeRunner |Thread-0| Thank you for using Backendless

CodeRunner.sh does not execute any compilation. When you asked if you built the project, I meant if you compiled everything the project has? This is what the downloaded project template comes with:

Okay, sorry, I wasn’t thinking straight.

Yes, I opened it in ItelliJ CE , ran the build and it publishes.

So my code is the issue, but I don’t know how to fix. I’ve created a class that implements IBackendlessService. I can run and test in debug mode using CodeRunner.sh, but when I try to publish, it times out. Sorry I’m a bit dense, what is the piece I’m missing?

No worries, we confirmed that the basic deployment is working, which is great. Let’s move on to your code now. Does your code have any dependencies? Any external jars or maven packages?

Regards,
Mark

FYI, I am using Eclipse for the main development. I did have a copy of IntelliJ CE on hand to quick open and compile the demo project. Either way, the code runs in debug mode with CodeRunner.sh

Here’s the top of my Service Class. No libraries besides Backendless, at this time. I do have my data models in a separate class.

package us.boundlessdesign.customersupportbackend;

import java.util.List;

import com.backendless.Backendless;
import com.backendless.exceptions.BackendlessException;
import com.backendless.persistence.DataQueryBuilder;
import com.backendless.servercode.IBackendlessService;

import us.boundlessdesign.customersupport.models.*;

public class MobileService implements IBackendlessService {

}

When you compile your project, do the compiled classes go into the /classes directory located in the root of the project as shown below?:

Yes. screenshot shows folders, with Service class. models are in other folder. Models are basic POJOs, nothing complex.

Do you mind zipping up the root directory of the project and sharing it with me? You could upload the zip into the Files section of your backendlless app and send me the link. I would like to try running exactly the same think from my machine.

sure, files uploaded and message sent

I sent a response in the PM thread by mistake. Please use this one so others in the same situation can benefit from it as well.

Regards,
Mark

Okay. Apparently when Eclipse builds, the default folder is /bin. This happens to be the same folder that Backendless houses the CodeRunner and Deploy scripts. When this happens, Eclipse cleans it out and puts the compiled classes into it. I went into the Eclipse settings and found what I thought was the place to change, but that still wouldn’t compile anything into the /classes folder.

Screen Shot 2020-04-20 at 7.01.52 PM

I switched to IntelliJ and the compiling, testing/debug, and publish all work. I’m sure there is something to getting Eclipse to do what is expected, but I haven’t figured it out. I’ll work on the coding project in IntelliJ for now, then maybe in 6 months or so come back and see what I can find out with Eclipse. If there are others out there that have an Eclipse workspace/project environment that is working, it would be cool to see. Otherwise, I would suggest IntelliJ.

Mark, thanks for the help. The mistakes were all mine and I’ve got it running now!

1 Like