Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Wrapper Service Stops after starting

Help
arif
2007-11-01
2012-12-11
  • arif
    arif
    2007-11-01

    Hello everyone,
    i'm new to java service wrapper, trying to create a startstop windows service that will receive SMS from the SMSC via SMPP. i'm using smppapi-0.3.7. i've the application running as a simple desktop application and i want it to make a service. but i'm getting the application stopped just after starting with the following error. I'd be grateful if anyone can help.

    arif

    STATUS | wrapper  | 2007/10/31 22:32:57 | Starting the CommandRx Receiver Application service...
    STATUS | wrapper  | 2007/10/31 22:32:57 | --> Wrapper Started as Service
    STATUS | wrapper  | 2007/10/31 22:32:57 | Launching a JVM...
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperManager class initialized by thread: main  Using classloader: sun.misc.Launcher$AppClassLoader@133056f
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
    INFO   | jvm 1    | 2007/10/31 22:32:58 |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
    INFO   | jvm 1    | 2007/10/31 22:32:58 |
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Wrapper Manager: JVM #1
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Running a 32-bit JVM.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Wrapper Manager: Registering shutdown hook
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Wrapper Manager: Using wrapper
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Load native library.  One or more attempts may fail if platform specific libraries do not exist.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Loading native library failed: wrapper-windows-x86-32.dll  Cause: java.lang.UnsatisfiedLinkError: no wrapper-windows-x86-32 in java.library.path
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Loaded native library: wrapper.dll
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Calling native initialization method.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Initializing WrapperManager native library.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Java Executable: C:\WINDOWS\system32\java.exe
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Windows version: 5.1.2600
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Java Version   : 1.5.0_12-b04 Java HotSpot(TM) Client VM
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Java VM Vendor : Sun Microsystems Inc.
    INFO   | jvm 1    | 2007/10/31 22:32:58 |
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Control event monitor thread started.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperManager.start(org.tanukisoftware.wrapper.WrapperStartStopApp@1d58aae, args["start"]) called by thread: main
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Startup runner thread started.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Communications runner thread started.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Open socket to wrapper...Wrapper-Connection
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Failed attempt to bind using local port 31000
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Opened Socket from 31001 to 32000
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Send a packet KEY : V2Zgzc72o1mikeqD
    INFO   | jvm 1    | 2007/10/31 22:32:58 | handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31001])
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Received a packet LOW_LOG_LEVEL : 1
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Wrapper Manager: LowLogLevel from Wrapper is 1
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Received a packet PING_TIMEOUT : 30
    INFO   | jvm 1    | 2007/10/31 22:32:58 | PingTimeout from Wrapper is 30000
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Received a packet PROPERTIES : (Property Values)
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Received a packet START : start
    INFO   | jvm 1    | 2007/10/31 22:32:58 | calling WrapperListener.start()
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Waiting for WrapperListener.start runner thread to complete.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperListener.start runner thread started.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperStartStopApp: start(args) Will wait up to 2 seconds for the main method to complete.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperStartStopApp: invoking start main method
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperManager.start(ie.omk.smpp.examples.MainClass@83cc67, args["start"]) called by thread: WrapperStartStopAppMain
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Exception in MainClass.main()
    INFO   | jvm 1    | 2007/10/31 22:32:58 | java.lang.IllegalStateException: WrapperManager has already been started with a WrapperListener.
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at org.tanukisoftware.wrapper.WrapperManager.privilegedStart(WrapperManager.java:1797)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at org.tanukisoftware.wrapper.WrapperManager.access$2400(WrapperManager.java:103)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at org.tanukisoftware.wrapper.WrapperManager$5.run(WrapperManager.java:1743)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at java.security.AccessController.doPrivileged(Native Method)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at org.tanukisoftware.wrapper.WrapperManager.start(WrapperManager.java:1740)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at ie.omk.smpp.examples.MainClass.main(MainClass.java:68)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at java.lang.reflect.Method.invoke(Unknown Source)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at org.tanukisoftware.wrapper.WrapperStartStopApp.run(WrapperStartStopApp.java:238)
    INFO   | jvm 1    | 2007/10/31 22:32:58 |     at java.lang.Thread.run(Unknown Source)
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperStartStopApp: start main method completed
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperStartStopApp: start(args) end.  Main Completed=true, exitCode=null
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperListener.start runner thread stopped.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | returned from WrapperListener.start()
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Send a packet STARTED :
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Startup runner thread stopped.
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Wrapper Manager: ShutdownHook started
    INFO   | jvm 1    | 2007/10/31 22:32:58 | WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook
    INFO   | jvm 1    | 2007/10/31 22:32:58 | Send a packet STOP : 0
    INFO   | jvm 1    | 2007/10/31 22:32:59 | Received a packet STOP :
    INFO   | jvm 1    | 2007/10/31 22:33:00 | Thread, Wrapper-Shutdown-Hook, handling the shutdown process.
    INFO   | jvm 1    | 2007/10/31 22:33:00 | calling listener.stop()
    INFO   | jvm 1    | 2007/10/31 22:33:00 | WrapperStartStopApp: stop(0)
    INFO   | jvm 1    | 2007/10/31 22:33:00 | WrapperStartStopApp: invoking stop main method
    INFO   | jvm 1    | 2007/10/31 22:33:00 | WrapperManager.start(ie.omk.smpp.examples.MainClass@de6f34, args["stop"]) called by thread: Wrapper-Shutdown-Hook
    INFO   | jvm 1    | 2007/10/31 22:33:00 | Exception in MainClass.main()
    INFO   | jvm 1    | 2007/10/31 22:33:00 | java.lang.IllegalStateException: WrapperManager has already been started with a WrapperListener.
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperManager.privilegedStart(WrapperManager.java:1797)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperManager.access$2400(WrapperManager.java:103)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperManager$5.run(WrapperManager.java:1743)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at java.security.AccessController.doPrivileged(Native Method)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperManager.start(WrapperManager.java:1740)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at ie.omk.smpp.examples.MainClass.main(MainClass.java:68)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at java.lang.reflect.Method.invoke(Unknown Source)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperStartStopApp.stop(WrapperStartStopApp.java:420)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperManager.privilegedStopInner(WrapperManager.java:3180)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperManager.access$2600(WrapperManager.java:103)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperManager$8.run(WrapperManager.java:1995)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at java.security.AccessController.doPrivileged(Native Method)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperManager.stop(WrapperManager.java:1992)
    INFO   | jvm 1    | 2007/10/31 22:33:00 |     at org.tanukisoftware.wrapper.WrapperManager$2.run(WrapperManager.java:467)
    INFO   | jvm 1    | 2007/10/31 22:33:00 | WrapperStartStopApp: stop main method completed
    INFO   | jvm 1    | 2007/10/31 22:33:00 | returned from listener.stop() -> 0
    INFO   | jvm 1    | 2007/10/31 22:33:00 | shutdownJVM(0) Thread:Wrapper-Shutdown-Hook
    INFO   | jvm 1    | 2007/10/31 22:33:00 | Send a packet STOPPED : 0
    INFO   | jvm 1    | 2007/10/31 22:33:00 | Closing socket.
    INFO   | jvm 1    | 2007/10/31 22:33:00 | Closed socket: java.net.SocketException: socket closed
    STATUS | wrapper  | 2007/10/31 22:33:00 | CommandRx Receiver Application started.
    INFO   | jvm 1    | 2007/10/31 22:33:00 | Server daemon shut down
    INFO   | jvm 1    | 2007/10/31 22:33:00 | Wrapper Manager: ShutdownHook complete
    STATUS | wrapper  | 2007/10/31 22:33:01 | <-- Wrapper Stopped

     
    • Leif Mortenson
      Leif Mortenson
      2007-11-01

      Arif,
      It looks like your omk.smpp.examples.MainClass.main method is calling WrapperManager.start

      When you are using WrapperStartStopApp your main class can be a standard Java class and
      does not need to contain any Wrapper specific code.  At the point that your main method
      is called the Wrapper has already handled all of the initialization.

      The problem you are seeing is that the Wrapper is complaining because your main method
      is recursively attempting to start the WrapperManager.

      Cheers,
      Leif