|
From: Leif M. <le...@ta...> - 2003-12-10 14:41:19
|
Vladan,
Ok, that told me what I needed to know, The start method of the
WrapperListener
is never returning. If you read the Java docs, you will see that the
Wrapper requires
that this method returns. This makes it possible for your application
to control when
the application is considered to have fully started. At some point, you
will need to spawn
a new thread if your main never returns.
I am not sure why your application is working when running as a
console but not
as a service. Does your Bootstrap class work differently in that case?
Are you sure that you really need to be implementing the
WrapperListener yourself?
Unless you really really need it, you will find that life is much easier
when using either the
WrapperSimpleApp or WrapperStartStopApp methods of integration with the
Wrapper. Since methods 1 and 2 have been created, I very rarely find
it necessary
to use method 3 any more. You will not have to worry about whether or
not your
main method returns when using either of these methods. It is all taken
care of for you.
Cheers,
Leif
Vladan Obradovic wrote:
>Leif
>
>I wrote new Main.java class and implemented the WrapperListener interface
>as described in integration method 3.
>
>Add the wrapper.debug=true property to my conf file and try again.
>
>
>
>In log file got next messages:
>
>
>
>DEBUG | wrapper | 2003/12/09 17:16:22 | Service command:
>C:\JOnAS-3.3-Tomcat\wrapper\bin\Wrapper.exe -s
>C:\JOnAS-3.3-Tomcat\wrapper\wrapper_jonas.conf
>STATUS | wrapper | 2003/12/09 17:16:22 | JOnAS Server installed.
>STATUS | wrapper | 2003/12/09 17:16:28 | Starting the JOnAS Server
>service...
>STATUS | wrapper | 2003/12/09 17:16:28 | --> Wrapper Started as Service
>DEBUG | wrapperp | 2003/12/09 17:16:28 | server listening on port 15012.
>STATUS | wrapper | 2003/12/09 17:16:29 | Launching a JVM...
>DEBUG | wrapper | 2003/12/09 17:16:29 | command:
>"D:\j2sdk1.4.1_01\bin\java" -Dinstall.root=C:\JOnAS-3.3-Tomcat -Djonas.base=
>C:\JOnAS-3.3-Tomcat -Djava.security.policy=C:\JOnAS-3.3-Tomcat\conf\java.pol
>icy -Djonas.classpath= -Djonas.default.classloader=true -Djavax.rmi.CORBA.Po
>rtableRemoteObjectClass=org.objectweb.carol.rmi.multi.MultiPRODelegate -Djav
>a.naming.factory.initial=org.objectweb.carol.jndi.spi.MultiOrbInitialContext
>Factory -Djava.security.auth.login.config=C:\JOnAS-3.3-Tomcat\conf\jaas.conf
>ig -Djava.rmi.server.RMIClassLoaderSpi=org.objectweb.jonas.server.RemoteClas
>sLoaderSpi -Xms16m -Xmx64m -Djava.library.path="C:/JOnAS-3.3-Tomcat/wrapper/
>lib" -classpath
>"C:/JOnAS-3.3-Tomcat/wrapper/classes/;C:/JOnAS-3.3-Tomcat/lib/common/ow_jona
>s_bootstrap.jar;C:/JOnAS-3.3-Tomcat/conf/;C:/JOnAS-3.3-Tomcat/wrapper/lib/wr
>apper.jar;C:/JOnAS-3.3-Tomcat/wrapper/lib/wrappertest.jar;D:/j2sdk1.4.1_01/l
>ib/comm.jar;D:/j2sdk1.4.1_01/lib/dt.jar;D:/j2sdk1.4.1_01/lib/htmlconverter.j
>ar;D:/j2sdk1.4.1_01/lib/tools.jar" -Dwrapper.key="No2M5eZdKYDYx0Rz" -Dwrappe
>r.port=15012 -Dwrapper.debug="TRUE" -Dwrapper.service="TRUE" -Dwrapper.cpu.t
>imeout="10" -Dwrapper.jvmid=1 Main
>DEBUG | wrapper | 2003/12/09 17:16:29 | Java Virtual Machine started
>(PID=1604)
>INFO | jvm 1 | 2003/12/09 17:16:29 | Wrapper Manager: JVM #1
>INFO | jvm 1 | 2003/12/09 17:16:29 | Wrapper Manager: Registering
>shutdown hook
>INFO | jvm 1 | 2003/12/09 17:16:29 | Wrapper Manager: Using wrapper
>INFO | jvm 1 | 2003/12/09 17:16:29 | Calling native initialization
>method.
>INFO | jvm 1 | 2003/12/09 17:16:29 | Initializing WrapperManager native
>library.
>INFO | jvm 1 | 2003/12/09 17:16:29 | Java Executable:
>D:\j2sdk1.4.1_01\bin\java.exe
>INFO | jvm 1 | 2003/12/09 17:16:29 | Java Version : 1.4.1_01-b01 Java
>HotSpot(TM) Client VM
>INFO | jvm 1 | 2003/12/09 17:16:29 | Java VM Vendor : Sun Microsystems
>Inc.
>INFO | jvm 1 | 2003/12/09 17:16:29 |
>INFO | jvm 1 | 2003/12/09 17:16:29 | Wrapper (Version 3.0.5)
>INFO | jvm 1 | 2003/12/09 17:16:29 |
>INFO | jvm 1 | 2003/12/09 17:16:29 | Open socket to wrapper...
>INFO | jvm 1 | 2003/12/09 17:16:29 | Opened Socket
>INFO | jvm 1 | 2003/12/09 17:16:29 | Send a packet KEY :
>No2M5eZdKYDYx0Rz
>INFO | jvm 1 | 2003/12/09 17:16:29 |
>handleSocket(Socket[addr=/127.0.0.1,port=15012,localport=1197])
>DEBUG | wrapperp | 2003/12/09 17:16:29 | accepted a socket from 127.0.0.1
>on port 1197
>DEBUG | wrapperp | 2003/12/09 17:16:29 | read a packet KEY :
>No2M5eZdKYDYx0Rz
>DEBUG | wrapper | 2003/12/09 17:16:29 | Got key from JVM: No2M5eZdKYDYx0Rz
>DEBUG | wrapperp | 2003/12/09 17:16:29 | send a packet LOW_LOG_LEVEL : 1
>DEBUG | wrapperp | 2003/12/09 17:16:29 | send a packet PING_TIMEOUT : 40
>DEBUG | wrapper | 2003/12/09 17:16:29 | Start Application.
>DEBUG | wrapperp | 2003/12/09 17:16:29 | send a packet START : start
>INFO | jvm 1 | 2003/12/09 17:16:29 | Received a packet LOW_LOG_LEVEL :
>1
>INFO | jvm 1 | 2003/12/09 17:16:29 | Wrapper Manager: LowLogLevel from
>Wrapper is 1
>INFO | jvm 1 | 2003/12/09 17:16:29 | Received a packet PING_TIMEOUT :
>40
>INFO | jvm 1 | 2003/12/09 17:16:29 | Wrapper Manager: PingTimeout from
>Wrapper is 40000
>INFO | jvm 1 | 2003/12/09 17:16:29 | Received a packet START : start
>INFO | jvm 1 | 2003/12/09 17:16:30 | calling listener.start()
>INFO | jvm 1 | 2003/12/09 17:16:31 | 2003-12-09 17:16:31,353 :
>TraceCarol.infoCarol : Name service for jrmp is started on port 1099
>INFO | jvm 1 | 2003/12/09 17:16:31 | 2003-12-09 17:16:31,433 :
>ServiceManager.startRegistry : registry service started
>INFO | jvm 1 | 2003/12/09 17:16:31 | 2003-12-09 17:16:31,764 :
>ServiceManager.startJmx : jmx service started
>INFO | jvm 1 | 2003/12/09 17:16:32 | 2003-12-09 17:16:31,964 :
>ServiceManager.startServices : jtm service started
>INFO | jvm 1 | 2003/12/09 17:16:32 | 2003-12-09 17:16:31,964 :
>ServiceManager.startServices : dbm service started
>INFO | jvm 1 | 2003/12/09 17:16:33 | 2003-12-09 17:16:33,006 :
>ServiceManager.startServices : security service started
>INFO | wrapper | 2003/12/09 17:16:33 | Waiting to start...
>INFO | jvm 1 | 2003/12/09 17:16:33 | 2003-12-09 17:16:33,787 :
>JmsAdminForJoram.startMOM : starting MOM on host localhost, port 16010
>INFO | jvm 1 | 2003/12/09 17:16:33 | 2003-12-09 17:16:33,817 :
>JmsAdminForJoram.start : starting JmsAdmin with host localhost, port 16010
>INFO | jvm 1 | 2003/12/09 17:16:34 | 2003-12-09 17:16:34,057 :
>JmsAdminForJoram.start : starting Jms Monitoring with host localhost, port
>16010
>INFO | jvm 1 | 2003/12/09 17:16:34 | 2003-12-09 17:16:34,568 :
>ServiceManager.startServices : jms service started
>INFO | jvm 1 | 2003/12/09 17:16:35 | 2003-12-09 17:16:35,019 :
>ResourceServiceImpl.createResourceAdapter :
>C:\JOnAS-3.3-Tomcat\rars\autoload\JOnAS_jdbcCP.rar available
>INFO | jvm 1 | 2003/12/09 17:16:35 | 2003-12-09 17:16:35,079 :
>ResourceServiceImpl.createResourceAdapter :
>C:\JOnAS-3.3-Tomcat\rars\autoload\JOnAS_jdbcDM.rar available
>INFO | jvm 1 | 2003/12/09 17:16:35 | 2003-12-09 17:16:35,289 :
>ResourceServiceImpl.createResourceAdapter :
>C:\JOnAS-3.3-Tomcat\rars\autoload\JOnAS_jdbcDS.rar available
>INFO | jvm 1 | 2003/12/09 17:16:35 | 2003-12-09 17:16:35,369 :
>ResourceServiceImpl.createResourceAdapter :
>C:\JOnAS-3.3-Tomcat\rars\autoload\JOnAS_jdbcXA.rar available
>INFO | jvm 1 | 2003/12/09 17:16:35 | 2003-12-09 17:16:35,369 :
>ServiceManager.startServices : resource service started
>INFO | jvm 1 | 2003/12/09 17:16:35 | 2003-12-09 17:16:35,389 :
>ServiceManager.startServices : ejb service started
>INFO | jvm 1 | 2003/12/09 17:16:35 | 2003-12-09 17:16:35,419 :
>Registry.loadRegistry : Loading registry information
>INFO | jvm 1 | 2003/12/09 17:16:35 | 2003-12-09 17:16:35,419 :
>Registry.getRegistry : Creating new Registry instance
>INFO | jvm 1 | 2003/12/09 17:16:36 | 2003-12-09 17:16:35,770 :
>Registry.loadRegistry : Loading registry information
>INFO | jvm 1 | 2003/12/09 17:16:36 | 2003-12-09 17:16:36,461 :
>Http11Protocol.init : Initializing Coyote HTTP/1.1 on port 8080
>INFO | jvm 1 | 2003/12/09 17:16:36 | Starting service Tomcat-JOnAS
>INFO | jvm 1 | 2003/12/09 17:16:36 | Apache Tomcat/4.1.27
>INFO | jvm 1 | 2003/12/09 17:16:36 | 2003-12-09 17:16:36,731 :
>Http11Protocol.start : Starting Coyote HTTP/1.1 on port 8080
>INFO | jvm 1 | 2003/12/09 17:16:37 | 2003-12-09 17:16:37,612 :
>AbsJWebContainerServiceImpl.registerWar : War
>/C:/JOnAS-3.3-Tomcat/webapps/autoload/ctxroot.war available at the context
>/.
>INFO | wrapper | 2003/12/09 17:16:38 | Waiting to start...
>INFO | jvm 1 | 2003/12/09 17:16:41 | 2003-12-09 17:16:41,358 :
>AbsJWebContainerServiceImpl.registerWar : War
>/C:/JOnAS-3.3-Tomcat/webapps/autoload/jonasAdmin.war available at the
>context /jonasAdmin.
>INFO | wrapper | 2003/12/09 17:16:43 | Waiting to start...
>INFO | jvm 1 | 2003/12/09 17:16:44 | 2003-12-09 17:16:44,512 :
>PropertyMessageResources.<init> : Initializing,
>config='org.apache.struts.util.LocalStrings', returnNull=true
>INFO | jvm 1 | 2003/12/09 17:16:44 | 2003-12-09 17:16:44,512 :
>PropertyMessageResources.<init> : Initializing,
>config='org.apache.struts.action.ActionResources', returnNull=true
>INFO | jvm 1 | 2003/12/09 17:16:45 | 2003-12-09 17:16:45,093 :
>PropertyMessageResources.<init> : Initializing,
>config='org.apache.webapp.admin.ApplicationResources', returnNull=true
>INFO | jvm 1 | 2003/12/09 17:16:45 | 2003-12-09 17:16:45,814 :
>AbsJWebContainerServiceImpl.registerWar : War
>/C:/JOnAS-3.3-Tomcat/webapps/autoload/tomcat-admin.war available at the
>context /tomcat-admin.
>INFO | jvm 1 | 2003/12/09 17:16:46 | 2003-12-09 17:16:45,974 :
>AbsJWebContainerServiceImpl.registerWar : War
>/C:/JOnAS-3.3-Tomcat/webapps/autoload/tomcat-docs.war available at the
>context /tomcat-docs.
>INFO | jvm 1 | 2003/12/09 17:16:46 | 2003-12-09 17:16:45,974 :
>ServiceManager.startServices : web service started
>INFO | jvm 1 | 2003/12/09 17:16:46 | 2003-12-09 17:16:46,575 :
>JContainer.addBean : EarOp available
>INFO | jvm 1 | 2003/12/09 17:16:46 | 2003-12-09 17:16:46,976 :
>AbsJWebContainerServiceImpl.registerWar : War
>/C:/JOnAS-3.3-Tomcat/apps/jonas/earsample_2003.09.26-17.17.52/earsample.war
>available at the context /earsample.
>INFO | jvm 1 | 2003/12/09 17:16:46 | 2003-12-09 17:16:46,986 :
>EarServiceImpl.deployEar : Ear
>file:/C:/JOnAS-3.3-Tomcat/apps/autoload/earsample.ear available.
>INFO | jvm 1 | 2003/12/09 17:16:47 | 2003-12-09 17:16:47,006 :
>ServiceManager.startServices : ear service started
>INFO | jvm 1 | 2003/12/09 17:16:47 | The JOnAS Server 'jonas' version
>3.3 is ready
>INFO | jvm 1 | 2003/12/09 17:16:47 | 2003-12-09 17:16:47,006 :
>Server.start : Jonas server jonas started on rmi/jrmp
>INFO | wrapper | 2003/12/09 17:16:48 | Waiting to start...
>INFO | wrapper | 2003/12/09 17:16:53 | Waiting to start...
>INFO | wrapper | 2003/12/09 17:16:58 | Waiting to start...
>INFO | wrapper | 2003/12/09 17:17:03 | Waiting to start...
>INFO | wrapper | 2003/12/09 17:17:08 | Waiting to start...
>ERROR | wrapper | 2003/12/09 17:17:10 | Startup failed: Timed out waiting
>for signal from JVM.
>ERROR | wrapper | 2003/12/09 17:17:10 | Java Virtual Machine did not exit
>on request, terminated
>DEBUG | wrapper | 2003/12/09 17:17:10 | JVM was only running for 41
>seconds leading to a failed restart count of 1.
>FATAL | wrapper | 2003/12/09 17:17:10 | There were 1 failed launches in a
>row, each lasting less than 300 seconds. Giving up.
>FATAL | wrapper | 2003/12/09 17:17:10 | There may be a configuration
>problem: please check the logs.
>STATUS | wrapper | 2003/12/09 17:17:11 | <-- Wrapper Stopped
>ERROR | wrapper | 2003/12/09 17:17:12 | The JOnAS Server service was
>launched, but failed to start.
>
>
>
>File Main.java is show below:
>
>***************************************************************
>
>Main.java
>
>***************************************************************
>
>import org.tanukisoftware.wrapper.WrapperManager;
>import org.tanukisoftware.wrapper.WrapperListener;
>import org.objectweb.jonas.server.Bootstrap;
>
>public class Main implements WrapperListener
>{
> private Bootstrap m_app;
>
> private Main()
> {
> }
>
> public Integer start( String[] args )
> {
>
>
>
> String myargs[] = {"org.objectweb.jonas.server.Server"};
> m_app = new Bootstrap();
> m_app.main( myargs );
>
> return null;
> }
>
> public int stop( int exitCode )
> {
>
> String myargs[] = {"org.objectweb.jonas.adm.JonasAdmin","-s"};
> m_app.main( myargs );
> return exitCode;
> }
> public void controlEvent( int event )
> {
> if (WrapperManager.isControlledByNativeWrapper()) {
>
> } else {
> if ((event == WrapperManager.WRAPPER_CTRL_C_EVENT) ||
> (event == WrapperManager.WRAPPER_CTRL_CLOSE_EVENT) ||
> (event == WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT)){
> WrapperManager.stop(0);
> }
> }
> }
>
> public static void main( String[] args )
> {
> WrapperManager.start( new Main(), args );
> }
>}
>****************************************************************************
>
>
>
>Do you have any suggestion about this ?
>
>
>
>It's work fine as wrapper console application.
>
>
>
>
>
>> Also, they are not a problem, but what is the point of all the
>>variable declarations
>>using set.xxx at the top of your conf file?
>>
>>
>
>
>
>Some other class when server is started used this enviroment variables.
>
>
>
>Regards
>Vladan Obradovic
>
>
>
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: IBM Linux Tutorials.
>Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
>Free Linux Tutorials. Learn everything from the bash shell to sys admin.
>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
>_______________________________________________
>Wrapper-user mailing list
>Wra...@li...
>https://lists.sourceforge.net/lists/listinfo/wrapper-user
>
>
>
|