dev@glassfish.java.net

Strange Deployment Issues

From: Jason Lee <jasondlee_at_sun.com>
Date: Tue, 28 Oct 2008 10:20:40 -0500

I've run into some really strange deployment issues in testing my
application restart change, a change I thought would be quick and
easy. :P At any rate, here's the sequence of events and their outcome:

Update working copy
Clean build of server (with and without clearing ~/.m2)
Extract distributions/web
Start server
Deploy test application (my Mojarra Scales demo, fwiw)
Hit the app in the browser, which returns a 404. The log, however,
shows this after the deployment:
[#|2008-10-28T09:56:28.199-0500|INFO|glassfish|
javax.enterprise.system.container.web|
_ThreadID=14;_ThreadName=Thread-3;|Loading application mojarra-scales-
demo-1.1-SNAPSHOT at /mojarra-scales-demo|#]
[#|2008-10-28T09:56:28.218-0500|INFO|glassfish|
javax.enterprise.system.core|_ThreadID=14;_ThreadName=Thread-3;|
Deployment of mojarra-scales-demo-1.1-SNAPSHOT done is 2544 ms|#]
Redeploy the application. The server log shows this:
[#|2008-10-28T09:57:12.938-0500|INFO|glassfish|null|
_ThreadID=14;_ThreadName=Thread-3;|classLoader = WebappClassLoader^M
   delegate: true^M
   repositories:^M
     WEB-INF/classes/^M
----------> Parent Classloader:^M
org.glassfish.internal.api.DelegatingClassLoader_at_328b7fd3^M
|#]
[#|2008-10-28T09:57:12.939-0500|INFO|glassfish|null|
_ThreadID=14;_ThreadName=Thread-3;|
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7_at_2a93980e|#]
[#|2008-10-28T09:57:13.263-0500|INFO|glassfish|
org.jvnet.hk2.osgiadapter|
_ThreadID=14;_ThreadName=Thread-3;org.glassfish.security.websecurity
[93];|Started bundle org.glassfish.security.websecurity [93]|#]
[#|2008-10-28T09:57:13.303-0500|INFO|glassfish|
org.apache.catalina.loader.WebappLoader|
_ThreadID=14;_ThreadName=Thread-3;|Unknown loader
org.glassfish.internal.api.DelegatingClassLoader_at_328b7fd3 class
org.glassfish.internal.api.DelegatingClassLoader|#]
[#|2008-10-28T09:57:13.655-0500|INFO|glassfish|
javax.enterprise.resource.webcontainer.jsf.config|
_ThreadID=14;_ThreadName=Thread-3;/mojarra-scales-demo;|Initializing
Mojarra (1.2_10-b01-FCS) for context '/mojarra-scales-demo'|#]
[#|2008-10-28T09:57:14.773-0500|INFO|glassfish|
javax.enterprise.system.container.web|
_ThreadID=14;_ThreadName=Thread-3;|Loading application mojarra-scales-
demo-1.1-SNAPSHOT at /mojarra-scales-demo|#]
[#|2008-10-28T09:57:14.777-0500|INFO|glassfish|
javax.enterprise.system.core|_ThreadID=14;_ThreadName=Thread-3;|
Deployment of mojarra-scales-demo-1.1-SNAPSHOT done is 1910 ms|#]
Request the app again, which executes correctly
Redeploy the application, which gets me this error:
[#|2008-10-28T10:16:33.129-0500|INFO|glassfish|null|
_ThreadID=14;_ThreadName=Thread-3;|classLoader = WebappClassLoader
   delegate: true
   repositories:
     WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader_at_53c81ca3
|#]
[#|2008-10-28T10:16:33.130-0500|INFO|glassfish|null|
_ThreadID=14;_ThreadName=Thread-3;|
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7_at_42b6fdb2|#]
[#|2008-10-28T10:16:33.479-0500|WARNING|glassfish|
javax.enterprise.system.container.web|
_ThreadID=14;_ThreadName=Thread-3;|java.lang.Exception: WEB0113:
Virtual server [server] already has a web module loaded at [/mojarra-
scales-demo]; therefore web module [mojarra-scales-demo-1.1-SNAPSHOT]
cannot be loaded at this context path on this virtual server.
java.lang.Exception: WEB0113: Virtual server [server] already has a
web module loaded at [/mojarra-scales-demo]; therefore web module
[mojarra-scales-demo-1.1-SNAPSHOT] cannot be loaded at this context
path on this virtual server.
        at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
1995)
        at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:
1881)
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:85)
        at
com
.sun
.enterprise
.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:561)
        at
com
.sun
.enterprise
.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:548)
        at
com
.sun
.enterprise
.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:190)
        at
org
.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:
329)
        at com.sun.enterprise.v3.admin.CommandRunner
$2.execute(CommandRunner.java:302)
        at
com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:
312)
        at
com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:
119)
        at
com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:
259)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:
176)
        at
com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:
147)
        at
com
.sun
.enterprise
.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
        at
com
.sun
.grizzly
.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
        at
com
.sun
.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:
570)
        at
com
.sun
.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:
827)
        at
com
.sun
.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:
152)
        at
com
.sun
.enterprise
.v3
.services
.impl
.GlassfishProtocolChain
.executeProtocolFilter(GlassfishProtocolChain.java:71)
        at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
103)
        at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
89)
        at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:
76)
        at
com
.sun
.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:
67)
        at
com
.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:
56)
        at
com
.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:
325)
        at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
|#]
If I try to undeploy either mojarra-scales-demo or mojarra-scales-
demo-1.1-SNAPSHOT, either name gives me "remote failure:
Application ... not registered" (where ... is the name I provided).

It seems that once I hit this position, my only choice is to bounce my
server. Is anyone else seeing this behavior? Given the similarity in
the error message, I'm wondering if it's related to the error I'm
getting in my restart application Handler...

         Jason Lee
Senior Java Developer
GlassFish Administration Console

Sun Microsystems, Inc.
Phone x31197/+1 405-343-1964
Email jasondlee_at_sun.com
Blog http://blogs.sun.com/jasondlee
Blog http://blogs.steeplesoft.com