title: java service wrapper, very basic step by step setup with startup failure
body: <p>I have simply donwloaded JSW community edition, unwrapped into a directory: <br/>
  <code>c:\servicetest</code><br/>
  So here i have a bin, conf, lib and log subdirs, among others.
  From now on this will be (root).<br/>
  I referenced the (root)/lib/wrapper.jar into my ide (netbeans) and create a very simple service (remember the class name is Main): <br/></p>
  
  <pre><code>public class Main extends WrapperSimpleApp {
  
  public Main(String[] args) {
      super(args);
  }
  
  @Override
  public void run() {
  
      while(true) {
          Logger.getLogger(Main.class.getName()).log(Level.INFO, "I'm alive");
  
          try 
             { Thread.sleep(2000); } 
          catch (InterruptedException ex) 
             { return; }
      }
  }
  
  }
  </code></pre>
  
  <p>As you see, it basically does nothing but logging a message. But actually it neither starts.<br/></p>
  
  <p>I compiled the project (MyProject.jar), copied the jar into the (root) directory and modified the (root)/config/wrapper.conf adding:</p>
  
  <pre><code>wrapper.java.classpath.3=../MyProject.jar
  </code></pre>
  
  <p>and </p>
  
  <pre><code>wrapper.java.mainclass=textappender.Main
  </code></pre>
  
  <p>Then i've installed the service in command line, with: </p>
  
  <pre><code>C:\servicetest\bin&gt;wrapper -i ../conf/wrapper.conf
  </code></pre>
  
  <p>then i've started the service, either via services.msc control panel or via</p>
  
  <pre><code>C:\servicetest\bin&gt;wrapper -t ../conf/wrapper.conf
  </code></pre>
  
  <p>In logs/wrapper.log i get:</p>
  
  <pre><code>ERROR  | wrapper  | 2012/05/21 21:35:11 | JVM exited while loading the application.
  </code></pre>
  
  <h3>UPDATE 1</h3>
  
  <p>Following Tanuki Software advice, i've set in my (root)/config/wrapper.conf (well, uncommented since it already was):</p>
  
  <pre><code>wrapper.debug=TRUE
  </code></pre>
  
  <p>And now i get this: </p>
  
  <pre><code>INFO   | jvm 1    | 2012/05/22 10:46:37 | WrapperManager Debug: WrapperManager.stop(1) called by thread: main
  INFO   | jvm 1    | 2012/05/22 10:46:37 | WrapperManager Debug: Backend not connected, not sending packet STOP : 1
  INFO   | jvm 1    | 2012/05/22 10:46:37 | WrapperManager Debug: Stopped checking for  control events.
  DEBUG  | wrapper  | 2012/05/22 10:46:37 | Pause reading child process output to share cycles.
  INFO   | jvm 1    | 2012/05/22 10:46:37 | WrapperManager Debug: Thread, main, handling the shutdown process.
  INFO   | jvm 1    | 2012/05/22 10:46:37 | WrapperManager Debug: shutdownJVM(1) Thread: main
  INFO   | jvm 1    | 2012/05/22 10:46:38 | WrapperManager Debug: wait for 0 shutdown locks to be released.
  INFO   | jvm 1    | 2012/05/22 10:46:38 | WrapperManager Debug: Backend not connected, not sending packet STOPPED : 1
  INFO   | jvm 1    | 2012/05/22 10:46:38 | WrapperManager Debug: calling System.exit(1)
  DEBUG  | wrapper  | 2012/05/22 10:46:38 | JVM process exited with a code of 1, setting the wrapper exit code to 1.
  </code></pre>
  
  <p>But given my very simple implementation, i cannot guess what is going wrong.</p>