B4J Question running jrdc server as an windows service

Discussion in 'B4J Questions' started by maddy, Oct 14, 2019.

  1. maddy

    maddy Member Licensed User

  2. Erel

    Erel Administrator Staff Member Licensed User

  3. maddy

    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
     

    Attached Files:

  4. inakigarm

    inakigarm Well-Known Member Licensed User

    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: Oct 15, 2019
    José J. Aguilar likes this.
  5. maddy

    maddy Member Licensed User

    No, It is not the problem of port binding because manually i can run my b4j server directly with no errors. any other suggestions from b4a family??
     
  6. Erel

    Erel Administrator Staff Member Licensed User

  7. maddy

    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

    Code:
    <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>
     
  8. maddy

    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
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    There is no relevant information in these logs. Are you using java 8 or Java 11? Maybe the service wrapper uses Java 8.
     
  10. maddy

    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:)
     

    Attached Files:

  11. Erel

    Erel Administrator Staff Member Licensed User

    I never worked with Windows services so cannot help you too much with this. Sorry.
     
  12. maddy

    maddy Member Licensed User

    okay Thanks Alot Erel:)
     
  13. Bladimir Silva Toro

    Bladimir Silva Toro Member Licensed 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

    Code:
    @echo off

    java -jar 
    "D:\jRDC.jar"

    pause
    exit
     
  14. yfleury

    yfleury Active Member Licensed User

    On win10 I dont have the gpedit
     
  15. DonManfred

    DonManfred Expert Licensed User

    Create a batchfile and put it in the autostart folder for each user/for the system.
     
    yfleury likes this.
  16. Bladimir Silva Toro

    Bladimir Silva Toro Member Licensed User

    gpedit is only supported in Windows Professional or Enterprise version.

    You can search Google how to activate it in another version of windows.
     
    yfleury likes this.
  17. OliverA

    OliverA Expert Licensed User

    32bit or 64bit?
     
  18. matt humphreys

    matt humphreys Member Licensed 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.
     
  19. maddy

    maddy Member Licensed User

    Thanks to all and finally i am using task scheduler to run jrdc service and its working fine.
     
  20. matt humphreys

    matt humphreys Member Licensed User

    Last edited: Nov 2, 2019
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice