Skip to main content

DeploymentManager.getTargets method blocks Glassfish container

10 replies [Last post]
bytec0de
Offline
Joined: 2006-05-18

Hi,

I've a problem fetching container targets when glassfish restarts. I've confined the code and the problem is that DeploymentManager.getTargets method of JSR88 blocks the ServletContextListener thread when the domain is started with a previously deployed war file.

The test is very simple:
1) Add to the contextInitialized method the following code:
public void contextInitialized(ServletContextEvent arg0) {
DeploymentManager manager = null;
try {
DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
DeploymentFactory df = (DeploymentFactory)Class.forName("com.sun.enterprise.deployapi.SunDeploymentFactory").newInstance();
dfm.registerDeploymentFactory(df);
manager = dfm.getDeploymentManager("deployer:Sun:AppServer::127.0.0.1:4848", "admin", "adminadmin");
System.err.println("Getting targets");
Target[] targets = manager.getTargets(); // Blocks when glassfish starts
for (TargetModuleID m : manager.getRunningModules(ModuleType.WAR, targets))
System.err.println("Running Module: " + m);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e.toString());
} finally {
if (manager != null)
manager.release();
}
}

2) Deploy the war file (everything goes fine)

3) Stop the domain

4) Start the domain
Now the container blocks when reaching the getTargets method.
If the jvm option com.sun.enterprise.server.ss.ASQuickStartup is set to false, instead of blocking it gives the following exception:
java.lang.RuntimeException: java.lang.IllegalStateException: java.io.IOException: Unable to connect to admin-server. Please check if the server is up and running and that the host and port provided are correct.
at jsr88.ContainerTest.contextInitialized(ContainerTest.java:42)

Check with b25, b33 and b40 and the behaviour is the same across all builds.

Any idea how to solve the problem?
The sample eclipse project can be fetched from http://egroupware.ipleiria.pt/jsr88_bug.zip

Thanks,
Vitor

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Hong Zhang

Hi,
Can you use jstack to get the stack trace when it hang?
You need to start the appserver in verbose mode:
asadmin start-domain --verbose
and the stack dump will appear in the shell where you ran the
asadmin command (so redirecting that output to a file will be a good idea).

Thanks,

- Hong

glassfish@javadesktop.org wrote:

>Hi,
>
>I've a problem fetching container targets when glassfish restarts. I've confined the code and the problem is that DeploymentManager.getTargets method of JSR88 blocks the ServletContextListener thread when the domain is started with a previously deployed war file.
>
>The test is very simple:
>1) Add to the contextInitialized method the following code:
> public void contextInitialized(ServletContextEvent arg0) {
> DeploymentManager manager = null;
> try {
> DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
> DeploymentFactory df = (DeploymentFactory)Class.forName("com.sun.enterprise.deployapi.SunDeploymentFactory").newInstance();
> dfm.registerDeploymentFactory(df);
> manager = dfm.getDeploymentManager("deployer:Sun:AppServer::127.0.0.1:4848", "admin", "adminadmin");
> System.err.println("Getting targets");
> Target[] targets = manager.getTargets(); // Blocks when glassfish starts
> for (TargetModuleID m : manager.getRunningModules(ModuleType.WAR, targets))
> System.err.println("Running Module: " + m);
> } catch (Exception e) {
> e.printStackTrace();
> throw new RuntimeException(e.toString());
> } finally {
> if (manager != null)
> manager.release();
> }
> }
>
>2) Deploy the war file (everything goes fine)
>
>3) Stop the domain
>
>4) Start the domain
>Now the container blocks when reaching the getTargets method.
>If the jvm option com.sun.enterprise.server.ss.ASQuickStartup is set to false, instead of blocking it gives the following exception:
>java.lang.RuntimeException: java.lang.IllegalStateException: java.io.IOException: Unable to connect to admin-server. Please check if the server is up and running and that the host and port provided are correct.
> at jsr88.ContainerTest.contextInitialized(ContainerTest.java:42)
>
>Check with b25, b33 and b40 and the behaviour is the same across all builds.
>
>Any idea how to solve the problem?
>The sample eclipse project can be fetched from http://egroupware.ipleiria.pt/jsr88_bug.zip
>
>Thanks,
>Vitor
>[Message sent by forum member 'bytec0de' (bytec0de)]
>
>http://forums.java.net/jive/thread.jspa?messageID=209513
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>

[att1.html]

bytec0de
Offline
Joined: 2006-05-18

Hi,

here's the trace output: http://egroupware.ipleiria.pt/trace_err.txt.

The call blocks after calling getTargets.

Below is the trace output contained on the above URL.
---------------------
Mar 23, 2007 3:02:20 PM com.sun.enterprise.admin.servermgmt.launch.ASLauncher buildCommand
INFO:
/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/../bin/java
-client
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-Xmx512m
-XX:NewRatio=2
-XX:+LogVMOutput
-XX:LogFile=/home/bytec0de/glassfish-v2-b40/domains/metaverse/logs/jvm.log
-Dcom.sun.aas.ClassPathPrefix=
-Dcom.sun.aas.ClassPathSuffix=/home/bytec0de/glassfish-v2-b40/domains/metaverse/lib/metaportal.realm.jar
-Dcom.sun.aas.ServerClassPath=
-Dcom.sun.aas.classloader.appserverChainJars.ee=
-Dcom.sun.aas.classloader.appserverChainJars=admin-cli.jar,admin-cli-ee.jar,dbschema.jar,j2ee-svc.jar
-Dcom.sun.aas.classloader.optionalOverrideableChain.ee=
-Dcom.sun.aas.classloader.optionalOverrideableChain=webservices-rt.jar,webservices-tools.jar,commons-logging.jar,commons-launcher.jar
-Dcom.sun.aas.classloader.serverClassPath.ee=%HADB_HOME%/lib/hadbjdbc4.jar,/home/bytec0de/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbm.jar,%HADB_HOME%/lib/hadbmgt.jar,%MFWK_HOME%/lib/mfwk_instrum_tk.jar
-Dcom.sun.aas.classloader.serverClassPath=/home/bytec0de/glassfish/lib/install/applications/jmsra/imqjmsra.jar,/home/bytec0de/glassfish/imq/lib/jaxm-api.jar,/home/bytec0de/glassfish/imq/lib/fscontext.jar,/home/bytec0de/glassfish/imq/lib/imqbroker.jar,/home/bytec0de/glassfish/imq/lib/imqjmx.jar,/home/bytec0de/glassfish/lib/ant/lib/ant.jar,/home/bytec0de/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar
-Dcom.sun.aas.classloader.sharedChainJars.ee=appserv-se.jar,appserv-ee.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbjdbc4.jar,jgroups-all.jar,%MFWK_HOME%/lib/mfwk_instrum_tk.jar
-Dcom.sun.aas.classloader.sharedChainJars=javaee.jar,/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/../lib/tools.jar,install/applications/jmsra/imqjmsra.jar,commons-launcher.jar,/home/bytec0de/glassfish/imq/lib/jaxm-api.jar,/home/bytec0de/glassfish/imq/lib/fscontext.jar,/home/bytec0de/glassfish/imq/lib/imqbroker.jar,/home/bytec0de/glassfish/imq/lib/imqjmx.jar,/home/bytec0de/glassfish/imq/lib/imqxm.jar,/home/bytec0de/glassfish/lib/ant/lib/ant.jar,webservices-rt.jar,webservices-tools.jar,mail.jar,jsf-api.jar,jsf-impl.jar,appserv-jstl.jar,appserv-env.jar,jmxremote_optional.jar,/home/bytec0de/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,commons-logging.jar,activation.jar,appserv-rt.jar,appserv-admin.jar,appserv-cmp.jar,/home/bytec0de/glassfish/updatecenter/lib/updatecenter.jar,/home/bytec0de/glassfish/jbi/lib/jbi.jar
-Dcom.sun.aas.configName=server-config
-Dcom.sun.aas.configRoot=/home/bytec0de/glassfish/config
-Dcom.sun.aas.defaultLogFile=/home/bytec0de/glassfish-v2-b40/domains/metaverse/logs/server.log
-Dcom.sun.aas.domainName=metaverse
-Dcom.sun.aas.installRoot=/home/bytec0de/glassfish
-Dcom.sun.aas.instanceName=server
-Dcom.sun.aas.instanceRoot=/home/bytec0de/glassfish-v2-b40/domains/metaverse
-Dcom.sun.aas.processLauncher=SE
-Dcom.sun.aas.promptForIdentity=true
-Dcom.sun.aas.verboseMode=true
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dcom.sun.enterprise.overrideablejavaxpackages=javax.help,javax.portlet
-Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar
-Dcom.sun.enterprise.taglisteners=jsf-impl.jar
-Dcom.sun.updatecenter.home=/home/bytec0de/glassfish/updatecenter
-Ddomain.name=metaverse
-Djava.endorsed.dirs=/home/bytec0de/glassfish/lib/endorsed
-Djava.ext.dirs=/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/../lib/ext:/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/../jre/lib/ext:/home/bytec0de/glassfish-v2-b40/domains/metaverse/lib/ext:/home/bytec0de/glassfish/javadb/lib
-Djava.library.path=/home/bytec0de/glassfish/lib:/home/bytec0de/glassfish/lib:/home/bytec0de/glassfish/lib
-Djava.security.auth.login.config=/home/bytec0de/glassfish-v2-b40/domains/metaverse/config/login.conf
-Djava.security.policy=/home/bytec0de/glassfish-v2-b40/domains/metaverse/config/server.policy
-Djava.util.logging.manager=com.sun.enterprise.server.logging.ServerLogManager
-Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder
-Djavax.net.ssl.keyStore=/home/bytec0de/glassfish-v2-b40/domains/metaverse/config/keystore.jks
-Djavax.net.ssl.trustStore=/home/bytec0de/glassfish-v2-b40/domains/metaverse/config/cacerts.jks
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djmx.invoke.getters=true
-Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000
-cp
:/home/bytec0de/glassfish/lib/appserv-launch.jar
com.sun.enterprise.server.PELaunch
start
verbose
Mar 23, 2007 3:02:20 PM com.sun.enterprise.admin.servermgmt.launch.ASLauncher process
INFO: goodbye
[#|2007-03-23T15:02:21.392+0000|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Starting Sun Java System Application Server 9.1 (build b40-rc) ...|#]
[#|2007-03-23T15:02:23.145+0000|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|CORE5098: AS Socket Service Initialization has been completed.|#]
[#|2007-03-23T15:02:23.170+0000|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;Java HotSpot(TM) Client VM;1.5.0_08;Sun Microsystems Inc.;|CORE5076: Using [Java HotSpot(TM) Client VM, Version 1.5.0_08] from [Sun Microsystems Inc.]|#]
[#|2007-03-23T15:02:23.237+0000|INFO|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=10;_ThreadName=main;|SEC1002: Security Manager is OFF.|#]
[#|2007-03-23T15:02:25.665+0000|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=10;_ThreadName=main;|ADM0001:MBeanServer initialized successfully|#]
[#|2007-03-23T15:02:25.879+0000|INFO|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=10;_ThreadName=main;com.sun.enterprise.security.provider.PolicyWrapper;|SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.|#]
[#|2007-03-23T15:02:26.691+0000|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=10;_ThreadName=main;|RMIClient.getRMIClient: server|#]
[#|2007-03-23T15:02:27.243+0000|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;server;|WEB0114: SSO is disabled in virtual server [server]|#]
[#|2007-03-23T15:02:27.253+0000|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;__asadmin;|WEB0114: SSO is disabled in virtual server [__asadmin]|#]
[#|2007-03-23T15:02:28.314+0000|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=10;_ThreadName=main;|ADM1079: Initialization of AMX MBeans successful|#]
[#|2007-03-23T15:02:29.160+0000|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=11;_ThreadName=Thread-18;service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi;|ADM1504: Here is the JMXServiceURL for the Standard JMXConnectorServer: [service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi]. This is where the remote administrative clients should connect using the standard JMX connectors|#]
[#|2007-03-23T15:02:29.160+0000|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=11;_ThreadName=Thread-18;true;|ADM1506: Status of Standard JMX Connector: Active = [true]|#]
[#|2007-03-23T15:02:31.009+0000|INFO|sun-appserver9.1|com.sun.jbi.framework|_ThreadID=10;_ThreadName=main;|JBIFW0010: JBI framework ready to accept requests.|#]
[#|2007-03-23T15:02:31.079+0000|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;|WEB0302: Starting Sun-Java-System/Application-Server.|#]
[#|2007-03-23T15:02:32.567+0000|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=240e79c3-24af-4ceb-bd14-0e59af44d49b;|Getting targets|#]

Binod

Can you please provide a thread dump of where the block is?

- Binod.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

bytec0de
Offline
Joined: 2006-05-18

Ok, here is the trace with Thread.dumpStack called just before calling getTargets.

If you wish to test some variations you can download the code from my first post (it already has a build.xml file to create the war file).

Thanks

Mar 23, 2007 4:01:02 PM com.sun.enterprise.admin.servermgmt.launch.ASLauncher buildCommand
INFO:
/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/../bin/java
-client
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-Xmx512m
-XX:NewRatio=2
-XX:+LogVMOutput
-XX:LogFile=/home/bytec0de/glassfish-v2-b40/domains/metaverse/logs/jvm.log
-Dcom.sun.aas.ClassPathPrefix=
-Dcom.sun.aas.ClassPathSuffix=/home/bytec0de/glassfish-v2-b40/domains/metaverse/lib/metaportal.realm.jar
-Dcom.sun.aas.ServerClassPath=
-Dcom.sun.aas.classloader.appserverChainJars.ee=
-Dcom.sun.aas.classloader.appserverChainJars=admin-cli.jar,admin-cli-ee.jar,dbschema.jar,j2ee-svc.jar
-Dcom.sun.aas.classloader.optionalOverrideableChain.ee=
-Dcom.sun.aas.classloader.optionalOverrideableChain=webservices-rt.jar,webservices-tools.jar,commons-logging.jar,commons-launcher.jar
-Dcom.sun.aas.classloader.serverClassPath.ee=%HADB_HOME%/lib/hadbjdbc4.jar,/home/bytec0de/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbm.jar,%HADB_HOME%/lib/hadbmgt.jar,%MFWK_HOME%/lib/mfwk_instrum_tk.jar
-Dcom.sun.aas.classloader.serverClassPath=/home/bytec0de/glassfish/lib/install/applications/jmsra/imqjmsra.jar,/home/bytec0de/glassfish/imq/lib/jaxm-api.jar,/home/bytec0de/glassfish/imq/lib/fscontext.jar,/home/bytec0de/glassfish/imq/lib/imqbroker.jar,/home/bytec0de/glassfish/imq/lib/imqjmx.jar,/home/bytec0de/glassfish/lib/ant/lib/ant.jar,/home/bytec0de/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar
-Dcom.sun.aas.classloader.sharedChainJars.ee=appserv-se.jar,appserv-ee.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbjdbc4.jar,jgroups-all.jar,%MFWK_HOME%/lib/mfwk_instrum_tk.jar
-Dcom.sun.aas.classloader.sharedChainJars=javaee.jar,/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/../lib/tools.jar,install/applications/jmsra/imqjmsra.jar,commons-launcher.jar,/home/bytec0de/glassfish/imq/lib/jaxm-api.jar,/home/bytec0de/glassfish/imq/lib/fscontext.jar,/home/bytec0de/glassfish/imq/lib/imqbroker.jar,/home/bytec0de/glassfish/imq/lib/imqjmx.jar,/home/bytec0de/glassfish/imq/lib/imqxm.jar,/home/bytec0de/glassfish/lib/ant/lib/ant.jar,webservices-rt.jar,webservices-tools.jar,mail.jar,jsf-api.jar,jsf-impl.jar,appserv-jstl.jar,appserv-env.jar,jmxremote_optional.jar,/home/bytec0de/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,commons-logging.jar,activation.jar,appserv-rt.jar,appserv-admin.jar,appserv-cmp.jar,/home/bytec0de/glassfish/updatecenter/lib/updatecenter.jar,/home/bytec0de/glassfish/jbi/lib/jbi.jar
-Dcom.sun.aas.configName=server-config
-Dcom.sun.aas.configRoot=/home/bytec0de/glassfish/config
-Dcom.sun.aas.defaultLogFile=/home/bytec0de/glassfish-v2-b40/domains/metaverse/logs/server.log
-Dcom.sun.aas.domainName=metaverse
-Dcom.sun.aas.installRoot=/home/bytec0de/glassfish
-Dcom.sun.aas.instanceName=server
-Dcom.sun.aas.instanceRoot=/home/bytec0de/glassfish-v2-b40/domains/metaverse
-Dcom.sun.aas.processLauncher=SE
-Dcom.sun.aas.promptForIdentity=true
-Dcom.sun.aas.verboseMode=true
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dcom.sun.enterprise.overrideablejavaxpackages=javax.help,javax.portlet
-Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar
-Dcom.sun.enterprise.taglisteners=jsf-impl.jar
-Dcom.sun.updatecenter.home=/home/bytec0de/glassfish/updatecenter
-Ddomain.name=metaverse
-Djava.endorsed.dirs=/home/bytec0de/glassfish/lib/endorsed
-Djava.ext.dirs=/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/../lib/ext:/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/../jre/lib/ext:/home/bytec0de/glassfish-v2-b40/domains/metaverse/lib/ext:/home/bytec0de/glassfish/javadb/lib
-Djava.library.path=/home/bytec0de/glassfish/lib:/home/bytec0de/glassfish/lib:/home/bytec0de/glassfish/lib
-Djava.security.auth.login.config=/home/bytec0de/glassfish-v2-b40/domains/metaverse/config/login.conf
-Djava.security.policy=/home/bytec0de/glassfish-v2-b40/domains/metaverse/config/server.policy
-Djava.util.logging.manager=com.sun.enterprise.server.logging.ServerLogManager
-Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder
-Djavax.net.ssl.keyStore=/home/bytec0de/glassfish-v2-b40/domains/metaverse/config/keystore.jks
-Djavax.net.ssl.trustStore=/home/bytec0de/glassfish-v2-b40/domains/metaverse/config/cacerts.jks
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djmx.invoke.getters=true
-Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000
-cp
:/home/bytec0de/glassfish/lib/appserv-launch.jar
com.sun.enterprise.server.PELaunch
start
verbose
Mar 23, 2007 4:01:02 PM com.sun.enterprise.admin.servermgmt.launch.ASLauncher process
INFO: goodbye
[#|2007-03-23T16:01:03.594+0000|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Starting Sun Java System Application Server 9.1 (build b40-rc) ...|#]

[#|2007-03-23T16:01:06.280+0000|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|CORE5098: AS Socket Service Initialization has been completed.|#]

[#|2007-03-23T16:01:06.310+0000|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;Java HotSpot(TM) Client VM;1.5.0_08;Sun Microsystems Inc.;|CORE5076: Using [Java HotSpot(TM) Client VM, Version 1.5.0_08] from [Sun Microsystems Inc.]|#]

[#|2007-03-23T16:01:06.480+0000|INFO|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=10;_ThreadName=main;|SEC1002: Security Manager is OFF.|#]

[#|2007-03-23T16:01:09.532+0000|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=10;_ThreadName=main;|ADM0001:MBeanServer initialized successfully|#]

[#|2007-03-23T16:01:10.332+0000|INFO|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=10;_ThreadName=main;com.sun.enterprise.security.provider.PolicyWrapper;|SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.|#]

[#|2007-03-23T16:01:11.925+0000|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=10;_ThreadName=main;|RMIClient.getRMIClient: server|#]

[#|2007-03-23T16:01:13.151+0000|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;server;|WEB0114: SSO is disabled in virtual server [server]|#]

[#|2007-03-23T16:01:13.162+0000|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;__asadmin;|WEB0114: SSO is disabled in virtual server [__asadmin]|#]

[#|2007-03-23T16:01:14.747+0000|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=10;_ThreadName=main;|ADM1079: Initialization of AMX MBeans successful|#]

[#|2007-03-23T16:01:15.388+0000|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=11;_ThreadName=Thread-18;service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi;|ADM1504: Here is the JMXServiceURL for the Standard JMXConnectorServer: [service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi]. This is where the remote administrative clients should connect using the standard JMX connectors|#]

[#|2007-03-23T16:01:15.388+0000|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=11;_ThreadName=Thread-18;true;|ADM1506: Status of Standard JMX Connector: Active = [true]|#]

[#|2007-03-23T16:01:18.245+0000|INFO|sun-appserver9.1|com.sun.jbi.framework|_ThreadID=10;_ThreadName=main;|JBIFW0010: JBI framework ready to accept requests.|#]

[#|2007-03-23T16:01:18.315+0000|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;|WEB0302: Starting Sun-Java-System/Application-Server.|#]

[#|2007-03-23T16:01:19.950+0000|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=82cb7c67-47a5-44d9-bd6c-4e802a37f48e;|Getting targets|#]

[#|2007-03-23T16:01:19.961+0000|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=82cb7c67-47a5-44d9-bd6c-4e802a37f48e;|
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1158)
at jsr88.ContainerTest.contextInitialized(ContainerTest.java:37)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4490)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5142)
at com.sun.enterprise.web.WebModule.start(WebModule.java:308)
at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:45)
at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:283)
at com.sun.appserv.management.util.misc.RunnableBase._submit(RunnableBase.java:155)
at com.sun.appserv.management.util.misc.RunnableBase.submit(RunnableBase.java:171)
at com.sun.enterprise.web.VirtualServer.startChildren(VirtualServer.java:1566)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1218)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:938)
at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:45)
at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:283)
at com.sun.appserv.management.util.misc.RunnableBase._submit(RunnableBase.java:155)
at com.sun.appserv.management.util.misc.RunnableBase.submit(RunnableBase.java:171)
at com.sun.enterprise.web.EmbeddedWebContainer$WebEngine.startChildren(EmbeddedWebContainer.java:440)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1218)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:520)
at org.apache.catalina.startup.Embedded.start(Embedded.java:916)
at com.sun.enterprise.web.WebContainer.start(WebContainer.java:852)
at com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:750)
at com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:71)
at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:332)
at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
at com.sun.enterprise.server.PEMain.run(PEMain.java:381)
at com.sun.enterprise.server.PEMain.main(PEMain.java:308)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:274)
|#]

binod
Offline
Joined: 2004-07-06

I will try your code....

In the meantime, can you try moving this code to the doPost or doGet method and see if that works?
Or have you tried it already?

bytec0de
Offline
Joined: 2006-05-18

I already have tried that and it works.
The problem is a timing issue because the code of the servlet context listener runs as soon as the domain starts. For example (with the code from the first post):

1) If the domain is running and the application doesn't have been deployed yet, asadmin deploys the war correctly and the code of the servlet context listener is executed with success

2) After the first deploy, I stop the domain and start it again. And that's the moment glassfish hangs when calling getTargets. It blocks the boot process of the domain but I don't see the reason.

3) Running from a servlet always work because the domain was already started successfully. The problem is only triggered in situation 2).

Any idea how to solve this? I really need to fetch some web modules to check if my application can bootstrap correctly.

Thanks

Jan Luehe

glassfish@javadesktop.org wrote On 03/23/07 04:54 PM,:

>I already have tried that and it works.
>The problem is a timing issue because the code of the servlet context listener runs as soon as the domain starts. For example (with the code from the first post):
>
>1) If the domain is running and the application doesn't have been deployed yet, asadmin deploys the war correctly and the code of the servlet context listener is executed with success
>
>2) After the first deploy, I stop the domain and start it again. And that's the moment glassfish hangs when calling getTargets. It blocks the boot process of the domain but I don't see the reason.
>
>3) Running from a servlet always work because the domain was already started successfully. The problem is only triggered in situation 2).
>
>Any idea how to solve this? I really need to fetch some web modules to check if my application can bootstrap correctly.
>
>

Hmm, I still don't see any output from jstack anywhere in your posting.

After restarting your domain, can you issue this command:

jstack

where
is the id of your appserver process?

*jstack* will print the Java stack traces of all the threads of your
appserver process.

This will tell us which thread is blocked, and why.

Thanks,

Jan

>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

binod
Offline
Joined: 2004-07-06

I think it is a bug.

Basically the webapp that deploys to http-listener will get loaded before admin listener starts up. The app during its initialization will try to access 4848 and will fail.

When QuickStartup is off, it gives a connection failure error. When QuickStartup is on, since the serversockets will be bound early, the client will wait.

binod
Offline
Joined: 2004-07-06
bytec0de
Offline
Joined: 2006-05-18

Binod,

thanks for the bug fill.

Sorry Jan, I've been out this week and only checked your post today.