0 Replies Latest reply on Jan 30, 2008 2:37 PM by Tuan Truong

    Running JBM as a Window service

    Tuan Truong Newbie

      Hi,

      My messaging configuration stops working when I run it as a Window service. FYI, below is my wrapper config file for the messaing configuration:

      wrapper.java.command=C:\hk\3rdParty\Sun\jdk1.5.0_11\bin\java

      wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

      wrapper.java.classpath.1=C:/hk/3rdParty/JBoss/jboss-4.2.2.GA/bin/wrapper.jar
      wrapper.java.classpath.2=C:/hk/3rdParty/Sun/jdk1.5.0_11/lib/tools.jar
      wrapper.java.classpath.3=./run.jar
      wrapper.java.classpath.4=C:/hk/ITF/Distribution/server/3rdparty/ojdbc14.jar

      wrapper.java.library.path.1=C:/hk/3rdParty/JBoss/jboss-4.2.2.GA/lib

      # these are the JAVA_OPTS
      wrapper.java.additional.1=-server
      # enviroment variables - define the ones that match your desired environment
      wrapper.java.additional.2=-Denviromnment.variable=value
      # memory parameters - define the ones that match your desired environment
      wrapper.java.additional.3=-Xms64m
      wrapper.java.additional.4=-Xmx96m
      # If you need serialization suppport
      wrapper.java.additional.5=-Dsession.serialization.jboss=true

      wrapper.app.parameter.1=org.jboss.Main
      # Parameters to be passed to the application (Jboss)
      # Define server name (configuration) - If you need a config that is different than the "default" or need to run multiple configs
      wrapper.app.parameter.2=-c RRSMessaging
      # Define listening IP - If you have more than one IP or want to indicate to listen on a specific IP
      wrapper.app.parameter.3=-b mke06390
      # wrapper log location
      wrapper.logfile=C:/hk/3rdParty/JBoss/jboss-4.2.2.GA/server/RRSMessaging/log/wrapper.log

      # You must not change below parameters without first uninstall the service
      # service name
      wrapper.ntservice.name=14599RRSMessaging
      # service display name
      wrapper.ntservice.displayname=RRS Messaging Engine



      If I started my messaging configuration using the command line "jboss-4.2.2.GA\bin\run.bat -c <CONFIG_NAME>", everything works fine. My client programs are able to publish and subscribe to the topics no problem. The jndi properties used by the clients are as follow:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://localhost:1099
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


      However, when if I started my configuration as a Window service, my clients programs stop working. I think the problem has to do with the clients are not able to find the Naming Service at jnp://localhost:1099.

      Please help. Thank you in advance.

      The exception I am getting is

      [i]avax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at com.irista.messaging.framework.JndiHelper.lookup(JndiHelper.java:114)
      at com.irista.messaging.adapter.topic.JmsTopicManager.initialize(JmsTopicManager.java:119)
      at com.irista.messaging.adapter.topic.JmsTopicManager.(JmsTopicManager.java:98)
      at com.irista.rrs.messaging.adapter.JmsTopicPublisher.initialize(JmsTopicPublisher.java:86)
      at com.irista.rrs.messaging.adapter.JmsTopicPublisher.(JmsTopicPublisher.java:70)
      at com.irista.rrs.messaging.framework.RRSPublisherShell.startObject(RRSPublisherShell.java:262)
      at com.irista.foundation.systemmanagement.objectshell.FoundationJavaShellImpl.start(FoundationJavaShellImpl.java:561)
      at com.irista.foundation.systemmanagement.objectshell.FoundationJavaShellImpl.initialize(FoundationJavaShellImpl.java:290)
      at com.irista.foundation.systemmanagement.objectshell.FoundationJavaShellImpl.(FoundationJavaShellImpl.java:110)
      at com.irista.foundation.systemmanagement.objectshell.FoundationJavaShellImpl.main(FoundationJavaShellImpl.java:390)
      Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
      ... 13 more
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
      ... 14 more
      Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      at java.net.Socket.connect(Socket.java:519)
      at java.net.Socket.connect(Socket.java:469)
      at java.net.Socket.(Socket.java:366)
      at java.net.Socket.(Socket.java:266)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)
      ... 14 more