Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-21-2008, 09:10 PM
Member
 
Join Date: May 2008
Location: Belgrade, Serbia
Posts: 3
goropad is on a distinguished road
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?

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

thanks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-22-2008, 08:04 AM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 191
danielstoner is on a distinguished road
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 @ [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
]
Language is froth on the surface of thought
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-22-2008, 05:56 PM
Member
 
Join Date: May 2008
Location: Belgrade, Serbia
Posts: 3
goropad is on a distinguished road
here is part of TestSampleService.bat
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\ set JVMDIR=%JAVA_HOME%\jre\bin\server 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!

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..
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Just getting started with java DuceDuceExplorer Introductions 4 06-29-2008 08:13 AM
How do I get started? programmer-in-training New To Java 4 01-11-2008 09:45 AM
Getting Started Doorsmaniac Java Applets 0 11-24-2007 05:40 AM
I need help getting started Android New To Java 2 10-30-2007 06:46 PM
Web Service from JSP Eric JavaServer Pages (JSP) and JSTL 2 07-02-2007 07:00 PM


All times are GMT +3. The time now is 04:18 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org