JAR file won't start on reboot


#1

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


#2

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?


#4

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


#5

#6

#7

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?


#8

Nothing showed up in the log.


#9

Hello Rich,

Can you let us know what firmware you are running?

Deryck


#10


#11

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


#13

MOVED TO STAFF NOTE (331.5 KB)


#15

Hi @wagnerr13,

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

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


#16

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


#18

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