JAR file won't start on reboot

Trying to execute this in the jvmrun file at startup:

-heapsize 1M -classpath /usr/FlexyToCumulocityMQTT.jar -emain TestMain

I have tried 1 and 2 CRLF (Windows) but it still doesn’t work. I can execute the command from a browser:
http://xx.xxx.x.x/rcgi.bin/jvmCmd?cmd=start&runCmd= -heapsize 5M -classpath /usr/FlexyToCumulocityMQTT.jar -emain TestMain

Yes that should be the correct syntax. What directory have you put the jvmrun file in? It should be placed in /usr. The second thing to check is to make sure there is no file extension. It should be just jvmrun.

I also noticed your heapsize is different. Is it possible that 1M is not enough?

We put it in the /usr directory and there is no extension on the jvmrun file. We also tried 1M and 5M. Do you have time to schedule a meeting to take a look?

thanks

Rich

Rich,

Before we schedule a meeting can you navigate to the Realtime logs page on the Flexy’s webpages. Then select JVM as the source. When booting the Flexy with your application and the jvmrun file loaded is there any log output on that page?

Additionally what firmware version is your Flexy running?

Nothing showed up in the log.

Hello Rich,

Can you let us know what firmware you are running?

Deryck

Hi @wagnerr13,

Does the real time logs or event logs show any errors preventing the JVM from starting?

Can you upload a backup from ebuddy with support files included so I can take a look.

Deryck

MOVED TO STAFF NOTE (331.5 KB)

Hi @wagnerr13,

It looks like the JVM is starting TestMain but the Mqtt is failing to connect.

image

At the start of you program you can add system.out.println("application starting") This will print to the real time logs and should help you verify that your application is running.

Deryck

Yes it is starting. Does this jar file get executed prior to communication being established? Its the same code if I FTP or start it from browser. I guess we need to test to see if communication is up.

Thanks

Hi,

I’m not sure when the Jar file is executed on boot. You might need to add logic to check and possibly delay then retry the mqtt connection from within your program. It seems like it might be starting the mqtt connection only once at start before the connection can be established.

Deryck

Topic closed due to inactivity.