OK, i've removed the other use of getCause and modified the SimpleDaemon to
use the exception if it can't bind to its server port.

I'm going to have a look and see if I can get the failure message to come
out on stderr, as well as out to the logs (if they are used). Reason being
that if you are running /etc/init.d/my-jsvc-daemon start you will see the
actual failure reason, rather than just inspecting $? and then having to
trawl through the logs.


Cheers,
Nick

On Sat, Oct 16, 2010 at 11:05 PM, Nick Griffiths <nicobre...@gmail.com>wrote:

> Ah crap. Will fix tomo.
> On 16 Oct 2010 16:34, "sebb" <seb...@gmail.com> wrote:
> > On 16 October 2010 15:58, <mt...@apache.org> wrote:
> >> Author: mturk
> >> Date: Sat Oct 16 14:58:39 2010
> >> New Revision: 1023303
> >>
> >> URL: http://svn.apache.org/viewvc?rev=1023303&view=rev
> >> Log:
> >> DAEMON-177: Allow fail during init. Patch provided by Nick Griffiths
> >>
> >> Added:
> >>
>  
> commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/DaemonInitException.java
>   (with props)
> >> Modified:
> >>    commons/proper/daemon/trunk/RELEASE-NOTES.txt
> >>
>  commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/Daemon.java
> >>
>  
> commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java
> >>
> >
> >> Modified:
> commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java
> >> URL:
> http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java?rev=1023303&r1=1023302&r2=1023303&view=diff
> >>
> ==============================================================================
> >> ---
> commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java
> (original)
> >> +++
> commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java
> Sat Oct 16 14:58:39 2010
> >> @@ -19,7 +19,9 @@ package org.apache.commons.daemon.suppor
> >>
> >>  import org.apache.commons.daemon.DaemonContext;
> >>  import org.apache.commons.daemon.DaemonController;
> >> +import org.apache.commons.daemon.DaemonInitException;
> >>
> >> +import java.lang.reflect.InvocationTargetException;
> >>  import java.lang.reflect.Method;
> >>
> >>  /*
> >> @@ -169,6 +171,15 @@ public final class DaemonLoader
> >>                 init.invoke(daemon, arg);
> >>             }
> >>
> >> +        } catch (InvocationTargetException e) {
> >> +          Throwable thrown = e.getCause();
> >
> > That's not available in 1.3.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
>

Reply via email to