Menu

Service doesn't start

Help
2016-01-20
2016-01-22
  • Parag Joshi

    Parag Joshi - 2016-01-20

    Hi,

    I am new to YAJSW and was able to install/uninstall/start/stop the service using example provided in the package with MemoryMonitor. However, the same example class files do not work and the service is not started if I embed the class files into my existing application (by modifiying the package declaration and putting it into the classpath).

    Here is my .cmd file:

    @CALL %JAVA_EXE% -classpath "%ICS_ROOT%"\wrapper.jar;"%ICS_ROOT%"\wrapperApp.jar;"%ICS_ROOT%"\commons-configuration-1.10.jar;"%ICS_ROOT%"\commons-vfs2-2.0.jar;"%ICS_ROOT%"\jna-4.1.0.jar;"%ICS_ROOT%"\jna-platform-4.1.0.jar;"%ICS_ROOT%"\netty-all-4.0.28.Final.jar;"%ICS_ROOT%"\ahessian.jar;"%ICS_ROOT%"\commons-lang-2.4.jar;"%ICS_ROOT%"\commons-logging-1.1.jar;"%ICS_ROOT%"\commons-collections-3.2.1.jar;"%ICS_ROOT%"\groovy-all-2.3.11.jar;"%ICS_ROOT%"\groovy-patch.jar;"%ICS_ROOT%";* com.mycompany.MemoryMonitorServiceWrapper %VAR1%
    
    @cd "C:\ICS Root\scripts\Windows\Service"
    

    Here is my .conf file:

    ##################################################################################
    ##### YAJSW Configuration file to OneStackUp - MemoryMonitor service example #####
    ##################################################################################
    
    # Modify the path to the java.exe as in your machine.
    wrapper.ntservice.java.command=C:\\ICS Root\\jre\\bin\\java
    
    # Change this value with the path to where you have extracted the downloaded zip file.
    wrapper.working.dir=C:\\ICS Root
    
    # Meta information about the service - internal/unique name, display name and the description
    wrapper.ntservice.name=Polling
    wrapper.ntservice.displayname=Polling
    wrapper.ntservice.description=An example for polling.
    
    # The property specify if the service needs to be auto-started or manual when the machine is rebooted
    wrapper.ntservice.starttype=AUTO_START
    
    # Following properties specify the behavior when the application exits. 
    #If the return code is 0, the service is stopped and in other cases, it is restarted.
    wrapper.on_exit.0=SHUTDOWN
    wrapper.on_exit.default=SHUTDOWN
    
    # Here, we specify the fully qualified class name of the Main class
    wrapper.java.app.mainclass=com.mycompany.MemoryMonitor
    
    #Add all the jars in the classpath (including that of YAJSW). You may want to add other jars in your application.
    wrapper.java.classpath.1=${wrapper.working.dir}\\bin\\wrapper.jar
    wrapper.java.classpath.2=${wrapper.working.dir}\\bin\\wrapperApp.jar
    wrapper.java.classpath.3=${wrapper.working.dir}\\bin\\commons-cli.jar
    wrapper.java.classpath.4=${wrapper.working.dir}\\bin\\commons-collections-3.2.1.jar
    wrapper.java.classpath.5=${wrapper.working.dir}\\bin\\commons-configuration-1.10.jar
    wrapper.java.classpath.6=${wrapper.working.dir}\\bin\\commons-io-2.4.jar
    wrapper.java.classpath.7=${wrapper.working.dir}\\bin\\commons-lang-2.4.jar
    wrapper.java.classpath.8=${wrapper.working.dir}\\bin\\commons-logging-1.1.jar
    wrapper.java.classpath.9=${wrapper.working.dir}\\bin\\commons-vfs2-2.0.jar
    wrapper.java.classpath.10=${wrapper.working.dir}\\bin\\jna-4.1.0.jar
    wrapper.java.classpath.11=${wrapper.working.dir}\\bin\\jna-platform-4.1.0.jar
    wrapper.java.classpath.12=${wrapper.working.dir}\\bin\\netty-all-4.0.28.Final.jar
    wrapper.java.classpath.13=${wrapper.working.dir}\\bin\\ahessian.jar
    wrapper.java.classpath.14=${wrapper.working.dir}\\bin\\groovy-all-2.3.11.jar
    wrapper.java.classpath.15=${wrapper.working.dir}\\bin\\groovy-patch.jar
    
    # Here, you can configure properties that need to be passed to the JRE
    #wrapper.java.additional.1=-Dapp.name=ServicesWrapperExample
    #wrapper.java.additional.2=-Xmx512m
    
    # If you need to pass any arguments to your application, you can add them in the following
    #wrapper.app.parameter.1=Test
    
    # These are optional debugging properties that you may want to modify during debugging.
    wrapper.debug=true
    wrapper.debug.comm=true
    wrapper.logfile=C:\\ICS Root\\log\\services.log
    wrapper.logfile.format=LPTM
    wrapper.logfile.loglevel=DEBUG
    wrapper.logfile.maxfiles=2
    wrapper.logfile.maxsize=10m
    wrapper.logfile.rollmode=DATE
    
    # (Optionally) You can also include a configuration file to manage the service stop workflow.
    #wrapper.stop.conf=WinService_UnInstall_Polling.conf
    

    I get following on console:

    C:\ICS Root\scripts\Windows\Service>DataFlow_Service.cmd -install
    Jan 20, 2016 3:50:10 PM org.rzo.yajsw.wrapper.WrappedService jvmOptions
    INFO: Windows & JVM7: Setting -Djava.net.preferIPv4Stack=true (see java bug 7179
    799 )
    service cmd: C:\ICS Root\jre\bin\java.exe -classpath "C:\ICS Root\bin\wrapper.ja
    r;C:\ICS Root\bin\wrapperApp.jar;C:\ICS Root\bin\commons-configuration-1.10.jar;
    C:\ICS Root\bin\commons-vfs2-2.0.jar;C:\ICS Root\bin\jna-4.1.0.jar;C:\ICS Root\b
    in\jna-platform-4.1.0.jar;C:\ICS Root\bin\netty-all-4.0.28.Final.jar;C:\ICS Root
    \bin\ahessian.jar;C:\ICS Root\bin\commons-lang-2.4.jar;C:\ICS Root\bin\commons-l
    ogging-1.1.jar;C:\ICS Root\bin\commons-collections-3.2.1.jar;C:\ICS Root\bin\gro
    ovy-all-2.3.11.jar;C:\ICS Root\bin\groovy-patch.jar;C:\ICS Root\bin;C:\ICS Root\ bin\a3-common.jar;C:\ICS Root\bin\abbot.jar;C:\ICS Root\bin\activation.jar;C:\IC
    S Root\bin\ahessian.jar;C:\ICS Root\bin\axis.jar;C:\ICS Root\bin\bcpg-jdk13-122.
    jar;C:\ICS Root\bin\bsh-2.1.8.jar;C:\ICS Root\bin\com.ibm.mq.headers.jar;C:\ICS
    Root\bin\com.ibm.mq.jar;C:\ICS Root\bin\com.ibm.mq.jmqi.jar;C:\ICS Root\bin\comm
    ons-beanutils-1.7.jar;C:\ICS Root\bin\commons-cli.jar;C:\ICS Root\bin\commons-co
    llections-3.2.1.jar;C:\ICS Root\bin\commons-configuration-1.10.jar;C:\ICS Root\b
    in\commons-dbcp-1.2.1.jar;C:\ICS Root\bin\commons-discovery-0.2.jar;C:\ICS Root\ bin\commons-httpclient-2.0.2.jar;C:\ICS Root\bin\commons-io-2.4.jar;C:\ICS Root\ bin\commons-lang-2.4.jar;C:\ICS Root\bin\commons-logging-1.1.jar;C:\ICS Root\bin
    \commons-net-3.3.jar;C:\ICS Root\bin\commons-pool-1.2.jar;C:\ICS Root\bin\common
    s-validator-1.4.1.jar;C:\ICS Root\bin\commons-vfs2-2.0.jar;C:\ICS Root\bin\dom4j
    -1.6.1.jar;C:\ICS Root\bin\fixengine.jar;C:\ICS Root\bin\gnu-regexp.jar;C:\ICS R
    oot\bin\groovy-all-2.3.11.jar;C:\ICS Root\bin\groovy-patch.jar;C:\ICS Root\bin\h
    sqldb.jar;C:\ICS Root\bin\icepdf-core.jar;C:\ICS Root\bin\jawin.jar;C:\ICS Root\ bin\jaxrpc.jar;C:\ICS Root\bin\jce-jdk13-122.jar;C:\ICS Root\bin\jcommon-0.9.6.j
    ar;C:\ICS Root\bin\jconn4.jar;C:\ICS Root\bin\jcup.jar;C:\ICS Root\bin\jdom.jar;
    C:\ICS Root\bin\jericho-html-3.1.jar;C:\ICS Root\bin\jfreechart-0.9.21.jar;C:\IC
    S Root\bin\jgraph.jar;C:\ICS Root\bin\jh.jar;C:\ICS Root\bin\jna-4.1.0.jar;C:\IC
    S Root\bin\jna-platform-4.1.0.jar;C:\ICS Root\bin\jndi-client.jar;C:\ICS Root\bi
    n\jndi-shared.jar;C:\ICS Root\bin\jndi.jar;C:\ICS Root\bin\joram-client-jms.jar;
    C:\ICS Root\bin\joram-shared.jar;C:\ICS Root\bin\jsch-0.1.53.jar;C:\ICS Root\bin
    \jta.jar;C:\ICS Root\bin\junit.jar;C:\ICS Root\bin\log4j.jar;C:\ICS Root\bin\luc
    ene-core.jar;C:\ICS Root\bin\mail.jar;C:\ICS Root\bin\messagelogger.jar;C:\ICS R
    oot\bin\monolog.jar;C:\ICS Root\bin\MsmqJava64.jar;C:\ICS Root\bin\mysql-connect
    or-java-5.1.28-bin.jar;C:\ICS Root\bin\netty-all-4.0.28.Final.jar;C:\ICS Root\bi
    n\ojdbc7.jar;C:\ICS Root\bin\ow2-jms-2.0-spec.jar;C:\ICS Root\bin\PDFRenderer.ja
    r;C:\ICS Root\bin\poi-3.11-20141221.jar;C:\ICS Root\bin\poi-ooxml-3.11-20141221.
    jar;C:\ICS Root\bin\poi-ooxml-schemas-3.11-20141221.jar;C:\ICS Root\bin\poi-scra
    tchpad-3.11-20141221.jar;C:\ICS Root\bin\saaj.jar;C:\ICS Root\bin\saxon9.jar;C:\ ICS Root\bin\soap.jar;C:\ICS Root\bin\sqljdbc41.jar;C:\ICS Root\bin\tibrvj.jar;C
    :\ICS Root\bin\tibrvjsd.jar;C:\ICS Root\bin\tibrvjweb.jar;C:\ICS Root\bin\torque
    .jar;C:\ICS Root\bin\village-csa.jar;C:\ICS Root\bin\wife.jar;C:\ICS Root\bin\wr
    apper.jar;C:\ICS Root\bin\wrapperApp.jar;C:\ICS Root\bin\wsdl4j-1.5.1.jar;C:\ICS
    Root\bin\xalan.jar;C:\ICS Root\bin\xerces.jar;C:\ICS Root\bin\xml-apis.jar;C:\I
    CS Root\bin\xmlbeans-2.3.0.jar;C:\ICS Root\bin\xmlunit1.0.jar;C:\ICS Root\bin\xo
    m.jar;C:\ICS Root\bin\zeecube.cedric.jar" -Xrs -Dwrapper.service=true -Dwrapper.
    working.dir="C:\ICS Root" -Djava.net.preferIPv4Stack=true -Dwrapper.working.dir=
    "C:\ICS Root" -Dwrapper.config="C:\ICS Root\scripts\Windows\Service\memmon-svc.c
    onf" -Dwrapper.additional.1x=-Xrs -Djna_tmpdir=C:\Users\PARAG~1.JOS\AppData\Loca
    l\Temp org.rzo.yajsw.boot.WrapperServiceBooter
    Service was installed successfully.

    C:\ICS Root\scripts\Windows\Service>DataFlow_Service.cmd -startsvc
    Jan 20, 2016 3:51:08 PM org.rzo.yajsw.wrapper.WrappedService jvmOptions
    INFO: Windows & JVM7: Setting -Djava.net.preferIPv4Stack=true (see java bug 7179
    799 )
    Failed to start the Service. Try running again with "Run as Administrator"

    C:\ICS Root\scripts\Windows\Service>

    I am running it with admin privileges already. I am using YAJSW v 11.11 with JRE1.7.0_79.

    What is missing as I can run the example that comes with the package. I also do not get any logs. Any help would be great as I stuck into this. Thanks.

     
  • rzo

    rzo - 2016-01-22

    hello,

    what you are doing cannot work.
    pls refer to the documentation on how to use yajsw.

    in any case you should not include any of the jar files provided by yajsw except for wrapper.jar
    you should not change the folder structure unless you know what you are doing. what is MemoryMonitorServiceWrapper ?

    take a look at the quickstart instructions in the docs. get your application to run from the command line and then use genconfig to generate the configuration.

    -- Ron

     

Log in to post a comment.