B4J Question running jrdc server as an windows service

maddy

Member
Licensed User
i successfully created it as a service in my local but currently facing issue with the start of program. can you please help? here is the screenshot of the error i am getting @Erel @tchart
 

Attachments

  • to_b4a_error.png
    to_b4a_error.png
    307.5 KB · Views: 190
Upvote 0

inakigarm

Well-Known Member
Licensed User
Longtime User
i successfully created it as a service in my local but currently facing issue with the start of program. can you please help? here is the screenshot of the error i am getting @Erel @tchart
Sometimes, the jRDC ip-port binding is in use when you try to launch jRDC (maybe this can cause the error above ; https://stackoverflow.com/questions...ally-if-they-are-not-in-use-by-other-services)
Check the logs with https://www.b4x.com/android/forum/threads/jrdc2-log-file-location.94037/#post-595065
 
Last edited:
Upvote 0

maddy

Member
Licensed User
Description:
A service was installed in the system.
Service Name: jrdcShyam
Service File Name: M:\service\JavaService64.exe
Service Type: user mode service
Service Start Type: demand start
Service Account: LocalSystem

B4X:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
    <EventID Qualifiers="16384">7045</EventID>
    <Version>0</Version>
    <Level>4</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8080000000000000</Keywords>
    <TimeCreated SystemTime="2019-10-15T18:12:31.130963700Z" />
    <EventRecordID>13870</EventRecordID>
    <Correlation />
    <Execution ProcessID="836" ThreadID="5204" />
    <Channel>System</Channel>
    <Computer>DESKTOP-TPCJ03U</Computer>
    <Security UserID="S-1-5-21-3011934078-1726636858-2272458934-1001" />
  </System>
  <EventData>
    <Data Name="ServiceName">jrdcShyam</Data>
    <Data Name="ImagePath">M:\service\JavaService64.exe</Data>
    <Data Name="ServiceType">user mode service</Data>
    <Data Name="StartType">demand start</Data>
    <Data Name="AccountName">LocalSystem</Data>
  </EventData>
</Event>
 
Upvote 0

maddy

Member
Licensed User
hello erel i have gone through the event viewer and find the logs only with information. there are no such error or warning related to jrdc service. Can you please help me in this?

Is there any problem with my service path. it points to javaService64.exe file. Is it correct or it should point to jrdc.jar
 
Upvote 0

maddy

Member
Licensed User
I am using Java 8 itself.:( This is the attachment of the JRDC2 server from your website can you please run this in local and try if you can able to run this as a service. Or can you provide a different working JavaService file. Currently I am using Windows 10 - 64 bit . Thanks In Advance:)
 

Attachments

  • jRDC2.zip
    5.4 KB · Views: 139
Upvote 0

Bladimir Silva Toro

Active Member
Licensed User
Longtime User
Hello

You can also do it in the following way that consists of executing a BAT file at the Start of the PC

Here are the steps:

1. Run Gpedit.msc

upload_2019-10-17_7-46-0.png


2. Click on device configuration

upload_2019-10-17_8-22-57.png


3. Script (Start / Off)

upload_2019-10-17_8-24-10.png


4. Click start and add the BAT file

upload_2019-10-17_8-26-17.png

I leave the text content of the BAT file, I remind you that you must have the JAVA virtual machine installed

B4X:
@echo off

java -jar "D:\jRDC.jar"

pause
exit
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

matt humphreys

Member
Licensed User
Longtime User
Perhaps Task Scheduler may be useful for you.
I run the server from a batch file which is started (at system startup) by the Task Scheduler which allows more granular control- like allowing it to run when no user is logged on.

The actual command line in the batch file is :
cmd /k ""%ProgramFiles%\Java\jre1.8.0_181\bin\java.exe" "-jar" "C:\MyCompany\MyApplication\Server\ServerApp.jar""
Admittedly it's on Windows Server 2008 however I see no reason why a discrete workstation cannot accomplish the same result.
 
Upvote 0

matt humphreys

Member
Licensed User
Longtime User
Last edited:
Upvote 0
Top