commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [daemon] How to daemonize a Java app that has a private default constructor
Date Sat, 08 Aug 2015 16:29:35 GMT
On 28 July 2015 at 00:56, Bill Durant <bdurant@g2ss.com> wrote:
> Greetings:
>
> I have Java application that has a private default constructor in order to
> support the singleton pattern.
>
> When I try to daemonize the application with jsvc, I get the following
> exception:
>
> java.lang.IllegalAccessException: Class
> org.apache.commons.daemon.support.DaemonLoader can not access a member of
> class example.App with modifiers "private"
>     at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:101)
>     at java.lang.Class.newInstance(Class.java:432)
>     at
> org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
> Cannot load daemon
> Service exit with a return value of 3
>
> Is it not possible to daemonize a Java application that has a private
> default constructor with jsvc?

I would try writing a wrapper (with a public constructor) that creates
the singleton.

> Thanks!
>
> Bill
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message