Results 1 to 3 of 3
  1. #1
    goropad is offline Member
    Join Date
    May 2008
    Location
    Belgrade, Serbia
    Posts
    3
    Rep Power
    0

    Thumbs down SampleService service could not be started

    I've chosen JavaService to be tool for running my java application as NT service.

    but, I didn't manage to start sample service I've got in installation package.

    by starting TestSampleService.bat I get this in console:
    .
    The SampleService service is starting.
    The SampleService service could not be started.

    The service did not report an error.

    More help is available by typing NET HELPMSG 3534.

    .
    Stopping sample service... Press Control-C to abort
    Press any key to continue . . .


    In the Windows Event Log I found no suspicious messages, even there are those:
    "The SampleService service was successfully sent a start control."
    "The SampleService service entered the running state"
    "The SampleService service entered the stopped state"
    but I didnt manage to start SampleService at all..

    javaservice.log file.. I found there those lines for running SampleService.bat:

    ***** Start of new JavaService log session *****
    Invoking Windows Service, register service control dispatcher
    ServiceMain function invoked, with one argument, service name (SampleService)
    Created ProcessGlobals singleton instance
    Logging service event start[ed] event (starting now)...
    logEventMessage (type #1073741828) : SampleService1073741828
    Creating thread (StartServiceThread)
    logEventMessage (type #1073741829) : SampleService1073741829
    Service Main waiting for event flags to be set
    Start Service Thread invoked
    Start Service Thread setting current directory to 'D:\Sole-ws\JavaService\dl\JavaService-src-2.0.7.64\javaservice\bin'
    Start Service Thread starting the java service...
    StartJavaService(serviceParams)
    logFunctionError: LoadLibrary
    logFunctionMessage: LoadLibrary:The specified module could not be found.

    logEventMessage (type #-1073737728) : Could not load the Java Virtual Machine.-1073737728
    logEventMessage (type #-1073737728) : C:\Program-1073737728
    StartJavaService failed
    Start Service Thread failed
    logEventMessage (type #-1073737726) : SampleService-1073737726
    ***** End of JavaService log session *****


    and, in debug mode, starting JavaServiceDebug.exe i got this:

    ***** Start of new JavaService log session *****
    Invoking Windows Service, register service control dispatcher
    Service control dispatcher registration failed!
    logFunctionError: StartServiceCtrlDispatcher
    logFunctionMessage: StartServiceCtrlDispatcher:Overlapped I/O operation is in progress.

    ***** End of JavaService log session *****


    I also fond those messages in Event Viewer/Application, while strarting debug mode:
    chronically:
    The SampleService service is being started.
    The SampleService service has been started.
    The LoadLibrary function failed for the following reason: The specified module could not be found.

    Could not load the Java Virtual Machine.
    C:\java\1.5.15\\jre\bin\server\jvm.dll
    The SampleService service failed to start.
    The StartServiceCtrlDispatcher function failed for the following reason: Overlapped I/O operation is in progress.

    Reds are Errors, and black are Informations..

    Anybody have an idea what I should do? :confused:

    Do you have proposal of another free/gpl/cheap solution for this?

    thanks

  2. #2
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    How do you try to run your application with JavaService? To run your Java application as NT service the JVM will be loaded as a DLL in a native application. So you need to be able to access jvm.dll.
    From what I see in your errors your code tries to use the JRE. I don't think jvm.dll comes with the JRE. I think you need to point your JAVA_HOME environment variable to the JDK or copy the jvm.dll by hand. Hope this helps.
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  3. #3
    goropad is offline Member
    Join Date
    May 2008
    Location
    Belgrade, Serbia
    Posts
    3
    Rep Power
    0

    Talking here is part of TestSampleService.bat

    Java Code:
    setlocal
    @rem note that if JVM not found, service 'does not report an error' when startup fails, although event logged
    if "%JAVA_HOME%" == "" set JAVA_HOME=c:\java\1.5.15\
    [COLOR="Red"]set JVMDIR=%JAVA_HOME%\jre\bin\server[/COLOR]
    set JSBINDIR=%CD%
    set JSEXE=%JSBINDIR%\JavaService.exe
    set SSBINDIR=%JSBINDIR%
    
    
    @echo . Using following version of JavaService executable:
    @echo .
    %JSEXE% -version
    @echo .
    
    
    @echo Installing sample service... Press Control-C to abort
    @pause
    @echo .
    %JSEXE% -install SampleService %JVMDIR%\jvm.dll -Djava.class.path=%SSBINDIR%\SampleService.jar -Xms16M -Xmx32M 
    
    -start org.objectweb.javaservice.test.SampleService -params start memory  -stop 
    
    org.objectweb.javaservice.test.SampleService -method serviceStop -out %JSBINDIR%\stdout.log -err 
    
    %JSBINDIR%\stderr.log -current %JSBINDIR% -manual -description "Sample Java Service"
    @echo .
    
    
    @echo Starting sample service... Press Control-C to abort
    @pause
    @echo .
    net start SampleService
    @echo .
    I've changed red line above:

    set JVMDIR=%JAVA_HOME%\bin\client

    aaaand it's workin! :D

    is it mandatory to have %JAVA_HOME%\bin\server or something like it folder,
    Is server jvm.dll different from clinet jvm.dll?

    I downloaded latest 1.5 JDK and there is no any server folder..

Similar Threads

  1. Just getting started with java
    By DuceDuceExplorer in forum Introductions
    Replies: 4
    Last Post: 06-29-2008, 06:13 AM
  2. How do I get started?
    By programmer-in-training in forum New To Java
    Replies: 4
    Last Post: 01-11-2008, 07:45 AM
  3. Getting Started
    By Doorsmaniac in forum Java Applets
    Replies: 0
    Last Post: 11-24-2007, 03:40 AM
  4. I need help getting started
    By Android in forum New To Java
    Replies: 2
    Last Post: 10-30-2007, 04:46 PM
  5. Web Service from JSP
    By Eric in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-02-2007, 05:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •