title: Using JSVC to daemonize a Java app packaged with the Maven One-Jar Plugin
body: <p>Here is the problem:</p>
  
  <p>I have packaged my Java application into a single jar using the <a href="http://code.google.com/p/onejar-maven-plugin/" rel="nofollow">Maven plugin One-Jar</a>. </p>
  
  <p>Now I want to run the application as a Unix Daemon using JSVC, i.e. Apache Commons Daemon.</p>
  
  <p>I am using JSVC as follows (which works for Jars made with the Maven assembly plugin, etc):</p>
  
  <pre><code>jsvc -user $USER -home $HOME -pidfile $PID_PATH -cp $PATH_TO_ONE_JAR my.package.MyClass
  </code></pre>
  
  <p>The error is this: </p>
  
  <pre><code>jsvc.exec error: Cannot find daemon loader org/apache/commons/daemon/support/DaemonLoader
  jsvc.exec error: Service exit with a return value of 1
  </code></pre>
  
  <p>Does anyone know if it is even possible to use JSVC and One-Jar together, since One-Jar uses a custom class loader? The jar runs just fine when I run java -jar my-one-jar.jar.</p>
  
  <p>What can be done? </p>
  
  <p>Thank you for any insight! </p>