Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AA672182F0 for ; Sat, 8 Aug 2015 16:46:30 +0000 (UTC) Received: (qmail 14555 invoked by uid 500); 8 Aug 2015 16:46:29 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 14410 invoked by uid 500); 8 Aug 2015 16:46:29 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 14393 invoked by uid 99); 8 Aug 2015 16:46:29 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Aug 2015 16:46:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id EB0471A9A9F for ; Sat, 8 Aug 2015 16:46:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.801 X-Spam-Level: * X-Spam-Status: No, score=1.801 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id saLdcZ0Uz-jd for ; Sat, 8 Aug 2015 16:46:22 +0000 (UTC) Received: from mail7c25-2586.carrierzone.com (mail154c25.carrierzone.com [64.29.147.224]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 19E5B24B33 for ; Sat, 8 Aug 2015 16:46:20 +0000 (UTC) X-Authenticated-User: bdurant.g2ss.com Received: from [192.168.43.166] (184-250-136-76.pools.spcsdns.net [184.250.136.76] (may be forged)) (authenticated bits=0) by mail7c25-2586.carrierzone.com (8.14.9/8.13.1) with ESMTP id t78Gk8Mq025354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Aug 2015 16:46:11 +0000 Subject: Re: [daemon] How to daemonize a Java app that has a private default constructor Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Bill Durant In-Reply-To: Date: Sat, 8 Aug 2015 09:46:10 -0700 Cc: Bill Durant Content-Transfer-Encoding: quoted-printable Message-Id: <01874189-ED71-4808-9F24-2EEE9E6059DE@g2ss.com> References: <55B6C531.2020605@g2ss.com> To: Commons Users List X-Mailer: Apple Mail (2.2102) X-CSC: 0 X-CHA: v=2.1 cv=MpNrtQqe c=1 sm=1 tr=0 a=PbkhTyVHk4aT8T+y0QF0Jw==:117 a=PbkhTyVHk4aT8T+y0QF0Jw==:17 a=g0qM3YM6AAAA:8 a=8oXEYd_VAAAA:8 a=IkcTkHD0fZMA:10 a=pGLkceISAAAA:8 a=mV9VRH-2AAAA:8 a=Dwc-8Zywel0-TQGEVtAA:9 a=QEXdDO2ut3YA:10 X-CTCH-RefID: str=0001.0A020204.55C63254.00FA,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-WHL: LR On Aug 8, 2015, at 9:29 AM, sebb wrote: >=20 > On 28 July 2015 at 00:56, Bill Durant wrote: >> Greetings: >>=20 >> I have Java application that has a private default constructor in = order to >> support the singleton pattern. >>=20 >> When I try to daemonize the application with jsvc, I get the = following >> exception: >>=20 >> 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 >>=20 >> Is it not possible to daemonize a Java application that has a private >> default constructor with jsvc? >=20 > I would try writing a wrapper (with a public constructor) that creates > the singleton. Yes, that=E2=80=99s what I ended up doing in the end. Thanks! -Bill >=20 >> Thanks! >>=20 >> Bill >>=20 >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >> For additional commands, e-mail: user-help@commons.apache.org >>=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org