S swan Member Oct 5, 2021 #1 Hi guys. I'm using jRDC2 on a remote server (Windows 2016) so I can connect to a MS SQL Server via B4A app. It all works OK except jRDC2 exits after a short period. It was suggested that jRDC2 be run as a service. Am trying NSSM but I get this message when starting the service - "Unexpected status SERVICE_PAUSED in response to START control". I'm hoping someone else is using NSSM as it's most likely in the initial setup.
Hi guys. I'm using jRDC2 on a remote server (Windows 2016) so I can connect to a MS SQL Server via B4A app. It all works OK except jRDC2 exits after a short period. It was suggested that jRDC2 be run as a service. Am trying NSSM but I get this message when starting the service - "Unexpected status SERVICE_PAUSED in response to START control". I'm hoping someone else is using NSSM as it's most likely in the initial setup.
DonManfred Expert Licensed User Longtime User Oct 5, 2021 #2 Per default a jRDC2 Server is NOT running as a Service. The java-task must be started once. Upvote 0
S swan Member Oct 5, 2021 #3 Thank you, do you mean I need to manually start jRDC2 (jRDC.exe) first ? Upvote 0
OliverA Expert Licensed User Longtime User Oct 6, 2021 #4 swan said: I'm hoping someone else is using NSSM as it's most likely in the initial setup. Click to expand... It may be related to redirecting STDOUT or STDERR to an invalid location. See https://www.b4x.com/android/forum/threads/jrdc2-nssm.134834/ Upvote 0
swan said: I'm hoping someone else is using NSSM as it's most likely in the initial setup. Click to expand... It may be related to redirecting STDOUT or STDERR to an invalid location. See https://www.b4x.com/android/forum/threads/jrdc2-nssm.134834/
OliverA Expert Licensed User Longtime User Oct 6, 2021 #6 swan said: that link comes back to this same thread !! Click to expand... Oops: https://stackoverflow.com/a/46078669 Upvote 0
swan said: that link comes back to this same thread !! Click to expand... Oops: https://stackoverflow.com/a/46078669
S swan Member Oct 7, 2021 #7 Thanx again, have set Stdout & Stderr on nssm to log files in the path of jRDC2, then stopped the service, OK, then started the service, same error message, but nothing written to either of the log files ? Upvote 0
Thanx again, have set Stdout & Stderr on nssm to log files in the path of jRDC2, then stopped the service, OK, then started the service, same error message, but nothing written to either of the log files ?
OliverA Expert Licensed User Longtime User Oct 8, 2021 #8 swan said: Thanx again, have set Stdout & Stderr on nssm to log files in the path of jRDC2, then stopped the service, OK, then started the service, same error message, but nothing written to either of the log files ? Click to expand... Facepalm on my end. Looks like NSSM has some issues with STDOUT/STDERR redirection. Wrap your jRDC2 server in a batch file. See: https://www.b4x.com/android/forum/threads/launch-jrdc2-from-bat-file.90306/post-571168 Upvote 0
swan said: Thanx again, have set Stdout & Stderr on nssm to log files in the path of jRDC2, then stopped the service, OK, then started the service, same error message, but nothing written to either of the log files ? Click to expand... Facepalm on my end. Looks like NSSM has some issues with STDOUT/STDERR redirection. Wrap your jRDC2 server in a batch file. See: https://www.b4x.com/android/forum/threads/launch-jrdc2-from-bat-file.90306/post-571168
S swan Member Oct 9, 2021 #9 Hi and thank you for your patience. I'm sorry I have very little experience with Java (quite obvious I guess). With that batch file, I'm confused to which .jar file it's referring to (somejar.jar). Looking at the jRDC2 dir I see no jar files, however there is a jRDC.exe file. Have I taken the right files across? Steve .... Upvote 0
Hi and thank you for your patience. I'm sorry I have very little experience with Java (quite obvious I guess). With that batch file, I'm confused to which .jar file it's referring to (somejar.jar). Looking at the jRDC2 dir I see no jar files, however there is a jRDC.exe file. Have I taken the right files across? Steve ....
OliverA Expert Licensed User Longtime User Oct 10, 2021 #10 What version of jRDC are you using? You should be using: Thread '[B4X] jRDC2 - B4J implementation of RDC (Remote Database Connector)' https://www.b4x.com/android/forum/t...ation-of-rdc-remote-database-connector.61801/ Upvote 0
What version of jRDC are you using? You should be using: Thread '[B4X] jRDC2 - B4J implementation of RDC (Remote Database Connector)' https://www.b4x.com/android/forum/t...ation-of-rdc-remote-database-connector.61801/
S swan Member Oct 11, 2021 #11 Yep, using the same version, thats not a problem. Just re-capping, what I've done works fine except jRDC2 exits soon after logging out of the VPS. After compiling jRDC2 which files should I take across to the server ? Upvote 0
Yep, using the same version, thats not a problem. Just re-capping, what I've done works fine except jRDC2 exits soon after logging out of the VPS. After compiling jRDC2 which files should I take across to the server ?
OliverA Expert Licensed User Longtime User Oct 12, 2021 #12 How did you create the exe? Have you tried running it from the command line to see if it runs without errors? Upvote 0
How did you create the exe? Have you tried running it from the command line to see if it runs without errors?
OliverA Expert Licensed User Longtime User Oct 12, 2021 #13 Don't create a exe. Just compile the jRDC2 source in release mode. The .jar file will be located in the Objects folder. Use this .jar file on the server. Install the JDK as located at and instructed at https://www.b4x.com/b4j.html. Since this is not a JavaFX application, other JRE's could be installed. Use the installed JRE to run the jar file. Upvote 0
Don't create a exe. Just compile the jRDC2 source in release mode. The .jar file will be located in the Objects folder. Use this .jar file on the server. Install the JDK as located at and instructed at https://www.b4x.com/b4j.html. Since this is not a JavaFX application, other JRE's could be installed. Use the installed JRE to run the jar file.
S swan Member Oct 13, 2021 #15 OK, copied jdk-11 to c:\java then copied my jRDC.jar to C:\jRDC2. How to start. Thanx. Steve .... Upvote 0
OliverA Expert Licensed User Longtime User Oct 13, 2021 #16 Open a command prompt, change to the c:\jRDC2 folder and try Code: C:\java\jdk-11.0.1\bin\java.exe -jar jrdc.jar Note: you may have to adjust the directory in the above command to wherever java.exe is located If everything works (no errors are displayed. Note: you need to run the test link to see if jRDC2 properly connects to your DB), you should see the output in the prompt. You can stop jRDC2 server with Ctrl+C If that works, then you can create a batch file in the jRDC2 folder with Code: C:\java\jdk-11.0.1\bin\java.exe -jar jrdc.jar > stdout.txt 2> stderr.txt as the content. Test the batch file by running it. If that works, then proceed to configure nssm to run the batch file for the service Upvote 0
Open a command prompt, change to the c:\jRDC2 folder and try Code: C:\java\jdk-11.0.1\bin\java.exe -jar jrdc.jar Note: you may have to adjust the directory in the above command to wherever java.exe is located If everything works (no errors are displayed. Note: you need to run the test link to see if jRDC2 properly connects to your DB), you should see the output in the prompt. You can stop jRDC2 server with Ctrl+C If that works, then you can create a batch file in the jRDC2 folder with Code: C:\java\jdk-11.0.1\bin\java.exe -jar jrdc.jar > stdout.txt 2> stderr.txt as the content. Test the batch file by running it. If that works, then proceed to configure nssm to run the batch file for the service
S swan Member Oct 15, 2021 #17 Thanx again. Your instructions were great. Unfortunately my original problem persists. Running the bat file works but after around 20 mins it exits. Then with nssm same error message - "Unexpected status SERVICE_PAUSED in response to START control". Tried another app similar to nssm called : "Alwaysup", same error. I'm starting to doubt if jRDC2 is suitable in this situation. I've come at it now in two different directions ending the same. Upvote 0
Thanx again. Your instructions were great. Unfortunately my original problem persists. Running the bat file works but after around 20 mins it exits. Then with nssm same error message - "Unexpected status SERVICE_PAUSED in response to START control". Tried another app similar to nssm called : "Alwaysup", same error. I'm starting to doubt if jRDC2 is suitable in this situation. I've come at it now in two different directions ending the same.
OliverA Expert Licensed User Longtime User Oct 16, 2021 #18 swan said: Running the bat file works but after around 20 mins it exits. Click to expand... If that is true, run jrdc from a command prompt without batchfile. Any errors should appear on the console. Upvote 0
swan said: Running the bat file works but after around 20 mins it exits. Click to expand... If that is true, run jrdc from a command prompt without batchfile. Any errors should appear on the console.
DonManfred Expert Licensed User Longtime User Oct 18, 2021 #20 swan said: Unfortunately the console closes with it. Click to expand... so it is your server which closes the console-connection? Upvote 0
swan said: Unfortunately the console closes with it. Click to expand... so it is your server which closes the console-connection?