Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 50544 invoked from network); 4 Dec 2008 12:21:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 12:21:29 -0000 Received: (qmail 40817 invoked by uid 500); 4 Dec 2008 12:21:40 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 40769 invoked by uid 500); 4 Dec 2008 12:21:40 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 40758 invoked by uid 99); 4 Dec 2008 12:21:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 04:21:40 -0800 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jason.dillon@gmail.com designates 209.85.142.188 as permitted sender) Received: from [209.85.142.188] (HELO ti-out-0910.google.com) (209.85.142.188) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 12:20:10 +0000 Received: by ti-out-0910.google.com with SMTP id b6so2752582tic.1 for ; Thu, 04 Dec 2008 04:20:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer:sender; bh=gcTwBA7oXjULplKISujvpPBZ4M10Na+PF8G9/Gqx9x0=; b=ANSlsZeN+/7hUWweDmBbL1AyLZp2+mP8Ert+7mzLCkIr/VqtTy8S9DsHoju96+0tSL eZhja+UT98o6lpC4R12QmOZ9jvP/fMJSAmtrJHw7Qwxhwg1r8Uzg/ryv8ynSVcKjXWf+ 7pRexE1afnguIC0L1ICa5yKnsa3ugIIlSDTuQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer:sender; b=Rza8FU/SoiGJazaI/FPN9pjJaaDWy5qW7sJVnyqH76TsgaEBCywdKVvqAJDUvflWsi KlnldvuiipriNJGVpT2rIbNzG8gWqDcfsV78Yyfltvd89wk1DHbUzf+oI1szpO+Y4rGs EPJjZeDwWRak6d58dYC2QaaDxUeE7jHky16jI= Received: by 10.110.53.19 with SMTP id b19mr7662765tia.38.1228393247357; Thu, 04 Dec 2008 04:20:47 -0800 (PST) Received: from ?10.0.1.100? (ppp-58-11-71-181.revip2.asianet.co.th [58.11.71.181]) by mx.google.com with ESMTPS id b4sm793730tic.2.2008.12.04.04.20.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Dec 2008 04:20:45 -0800 (PST) Message-Id: <0622F476-1F0F-4A9C-99B3-E89DDDC22EF1@planet57.com> From: Jason Dillon To: dev@geronimo.apache.org In-Reply-To: <5e7fd1eb0812040154j1b4160fdj1dd132831f4574de@mail.gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-1-977938992 Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: [discussion] Using Apache Commons Deamon to run Geronimo as a Windows service Date: Thu, 4 Dec 2008 19:20:41 +0700 References: <5e7fd1eb0812040154j1b4160fdj1dd132831f4574de@mail.gmail.com> X-Mailer: Apple Mail (2.929.2) Sender: Jason Dillon X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-1-977938992 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Why not use GShell here? ie. just put lib/boot/gshell-bootstrap.jar on your classpath? --jason On Dec 4, 2008, at 4:54 PM, Jack Cai wrote: > I have been working on enabling Geronimo to run as a Windows service > using Apache Commons Deamon procrun utility. I have been making good > progress. Now I have some problems and would like to hear your > opinions. > > 1. I have gone through all the open JIRAs of that project and are > fixing some of them. I have also reported and fixed several found by > myself, and a few improvements too. But nobody is helping to commit > my patches. Will it be OK that Geronimo just use the binary code > built by me without maintaining the latest code (I mean, which > includes my patches)? Tomcat only include procrun's binary today (as > tomcat6.exe and tomcat6w.exe) which is probably built with the > latest code from Apache Commons. > > 2. Currently procrun need the starter class and stopper class to be > on the same classpath. Unfortunately our server.jar and shutdown.jar > contains different config.ser, which screws things up. So I tried > various ways to work around this problem before I change procrun's > design - > > A. write a wrapper, which use a URLClassloader to load different > jar for startup and shutdown. To do so, I had to first remove the > jpa agent, as the system classloader (parent of my URLClassloader) > will load the config.ser in jpa.jar. After that Geronimo starts to > boot, until the below exception occurs: > > 17:43:19,421 WARN [1/car,j2eeType=GBean,name=JMXService] Failure in > JMXConnector service:jmx:rmi://0.0.0.0:9999/jndi/rmi://0.0.0.0:1099/ > JMXConnector > 17:43:19,421 ERROR [GBeanInstanceState] Error while starting; GBean > is now in the FAILED state: > abstractName="org.apache.geronimo.framework/j2ee-security/2.1.1/car? > ServiceModule=org.apache.geronimo.framework/j2ee-security/2.1.1/ > car,j2eeType=GBean,name=JMXService" > java.lang.NoClassDefFoundError: > org.apache.geronimo.kernel.rmi.RMIClassLoaderSpiImpl > at > java > .rmi.server.RMIClassLoader.initializeProvider(RMIClassLoader.java:680) > > B. so I rewrite the wrapper and use (dirty) reflections to add jar > file to system classloader's classpath based on the action (start/ > stop). Sadly, the jpa.jar again gets into the way. Obviously the > jpa.jar is searched before the newly added jar. If I remove the jpa > agent, then things go smoothly. I could do more hack with the > classloader to work around the jpa.jar. But this hacking does not > sound right to me in the first place. > > C. Use procrun's jvm mode (instead of java command line), and only > put server.jar in classpath. Write a simple class which calls > "System.exit(0)" for stopping Geronimo. This works, but only that > procrun does not clean up properly. > > Are there other better options? Appreciate your help! > > -Jack Cai > --Apple-Mail-1-977938992 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Why not use GShell here? =  ie. just put lib/boot/gshell-bootstrap.jar on your = classpath?

--jason


On Dec 4, 2008, at 4:54 PM, Jack Cai wrote:

I have = been working on enabling Geronimo to run as a Windows service using = Apache Commons Deamon procrun utility. I have been making good progress. = Now I have some problems and would like to hear your opinions.

1. = I have gone through all the open JIRAs of that project and are fixing = some of them. I have also reported and fixed several found by myself, = and a few improvements too. But nobody is helping to commit my patches. = Will it be OK that Geronimo just use the binary code built by me without = maintaining the latest code (I mean, which includes my patches)? Tomcat = only include procrun's binary today (as tomcat6.exe and tomcat6w.exe) = which is probably built with the latest code from Apache Commons.
=
2. Currently procrun need the starter class and stopper class to be = on the same classpath. Unfortunately our server.jar and shutdown.jar = contains different config.ser, which screws things up. So I tried = various ways to work around this problem before I change procrun's = design -

 A. write a wrapper, which use a URLClassloader to = load different jar for startup and shutdown. To do so, I had to first = remove the jpa agent, as the system classloader (parent of my = URLClassloader) will load the config.ser in jpa.jar. After that Geronimo = starts to boot, until the below exception occurs:

17:43:19,421 = WARN  [1/car,j2eeType=3DGBean,name=3DJMXService] Failure in = JMXConnector service:jmx:rmi://0.0.0.0:= 9999/jndi/rmi://0.0.0.0:1099/JMXConnector
17:43:19,421 ERROR = [GBeanInstanceState] Error while starting; GBean is now in the FAILED = state: = abstractName=3D"org.apache.geronimo.framework/j2ee-security/2.1.1/car?Serv= iceModule=3Dorg.apache.geronimo.framework/j2ee-security/2.1.1/car,j2eeType= =3DGBean,name=3DJMXService"
java.lang.NoClassDefFoundError: = org.apache.geronimo.kernel.rmi.RMIClassLoaderSpiImpl
   = at = java.rmi.server.RMIClassLoader.initializeProvider(RMIClassLoader.java:680)=

 B. so I rewrite the wrapper and use (dirty) reflections to = add jar file to system classloader's classpath based on the action = (start/stop). Sadly, the jpa.jar again gets into the way. Obviously the = jpa.jar is searched before the newly added jar. If I remove the jpa = agent, then things go smoothly. I could do more hack with the = classloader to work around the jpa.jar. But this hacking does not sound = right to me in the first place.

 C. Use procrun's jvm mode = (instead of java command line), and only put server.jar in classpath. = Write a simple class which calls "System.exit(0)" for stopping Geronimo. = This works, but only that procrun does not clean up properly.
=
Are there other better options? Appreciate your help!

-Jack = Cai


= --Apple-Mail-1-977938992--