Skip to main content

Problem deploying the same app in different directories more than 2 times

9 replies [Last post]
edilmar
Offline
Joined: 2003-11-13
Points: 0

My env is CentOS6.2 64 bits + GF3.1.2.2 + JDK1.7.09 64 bits.
I have a webapp made with NetBeans7.2 + JSF2.1 + CDI/WELD + CODI + RichFaces + JTA + Hibernate.

Then, I put the same webapp in many directories, changing web.xml, persistence.xml (to point to right database pool). My server runs one webapp per client of my enterprise.

The problem is that when I try to deploy a webapp after the second or third, GF arises this error:
Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener. Please see server.log for more details.

But there isn't more helpful information in server.log. If I stop/start GF, sometimes I got to deploy until 3 webapps, not more than that. But I would like to put 7 same webapps running here.

The strange is that sometimes the error is not this above. The error is this, for the same attempt to deploy:
[#|2012-10-23T15:01:56.476-0200|INFO|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=254;_ThreadName=Thread-2;|No timers to be deleted for id: 88539854347632640|#]
[#|2012-10-23T15:01:56.484-0200|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=254;_ThreadName=Thread-2;|Exception while shutting down application container : java.lang.NullPointerException|#]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hzhang_jn
Offline
Joined: 2005-07-22
Points: 0

If you deploy the same application multiple times, you need to make sure
the JNDI names do not conflict etc. But I am not sure about this
particular exception you are seeing w.r.t WSServletContextListener.
Maybe the webservices team has some ideas...
So there is no additional information in the server log? For example, if
the JNDI name is in conflict, it will fail to publish the object in the
JNDI name space which could cause the later injection to fail...

forums@java.net wrote:
> My env is CentOS6.2 64 bits + GF3.1.2.2 + JDK1.7.09 64 bits. I have a
> webapp
> made with NetBeans7.2 + JSF2.1 + CDI/WELD + CODI + RichFaces + JTA +
> Hibernate. Then, I put the same webapp in many directories, changing
> web.xml,
> persistence.xml (to point to right database pool). My server runs one
> webapp
> per client of my enterprise. The problem is that when I try to deploy a
> webapp after the second or third, GF arises this error: Error occurred
> during
> deployment: Exception while loading the app :
> java.lang.IllegalStateException: ContainerBase.addChild: start:
> org.apache.catalina.LifecycleException:
> java.lang.IllegalArgumentException:
> javax.servlet.ServletException:
> com.sun.enterprise.container.common.spi.util.InjectionException: Error
> creating managed object for class: class
> org.glassfish.webservices.WSServletContextListener. Please see
> server.log for
> more details. But there isn't more helpful information in server.log.
> If I
> stop/start GF, sometimes I got to deploy until 3 webapps, not more
> than that.
> But I would like to put 7 same webapps running here.
>
> --
>
> [Message sent by forum member 'edilmar']
>
> View Post: http://forums.java.net/node/891698
>
>

edilmar
Offline
Joined: 2003-11-13
Points: 0

The complete exceptions are here:

[#|2012-10-23T15:36:04.341-0200|SEVERE|glassfish3.1.2|org.apache.catalina.core.ContainerBase|_ThreadID=271;_ThreadName=Thread-2;|ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5332)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener
at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2743)
at org.apache.catalina.core.StandardContext.addApplicationListener(StandardContext.java:1966)
at com.sun.enterprise.web.TomcatDeploymentConfig.configureApplicationListener(TomcatDeploymentConfig.java:235)
at com.sun.enterprise.web.TomcatDeploymentConfig.configureWebModule(TomcatDeploymentConfig.java:94)
at com.sun.enterprise.web.WebModuleContextConfig.start(WebModuleContextConfig.java:274)
at com.sun.enterprise.web.WebModuleContextConfig.lifecycleEvent(WebModuleContextConfig.java:172)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5329)
... 39 more
Caused by: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener
at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2853)
at org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:4806)
at com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1599)
at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2740)
... 46 more
Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:315)
at com.sun.enterprise.web.WebContainer.createListenerInstance(WebContainer.java:761)
at com.sun.enterprise.web.WebModule.createListenerInstance(WebModule.java:1987)
at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2851)
... 49 more
Caused by: java.lang.NullPointerException
at com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:477)
at com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:420)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:299)
... 52 more
|#]

[#|2012-10-23T15:36:04.382-0200|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=271;_ThreadName=Thread-2;|java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:921)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
|#]

[#|2012-10-23T15:36:04.385-0200|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=271;_ThreadName=Thread-2;|Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:138)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
|#]

[#|2012-10-23T15:36:04.386-0200|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=271;_ThreadName=Thread-2;|Exception while loading the app|#]

[#|2012-10-23T15:36:08.045-0200|INFO|glassfish3.1.2|org.hibernate.impl.SessionFactoryImpl|_ThreadID=951;_ThreadName=Thread-2;|closing|#]

[#|2012-10-23T15:36:08.065-0200|INFO|glassfish3.1.2|org.hibernate.impl.SessionFactoryImpl|_ThreadID=951;_ThreadName=Thread-2;|closing|#]

[#|2012-10-23T15:36:08.075-0200|INFO|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=271;_ThreadName=Thread-2;|[2] timers deleted for id: 88539854347894784|#]

[#|2012-10-23T15:36:08.111-0200|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=271;_ThreadName=Thread-2;|Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener|#]
edilmar
Offline
Joined: 2003-11-13
Points: 0

Now, I used the Update Tool from GF Admin Console, update somethings, and I got to deploy 5 webapps. This is to prove that there is no problem with deployment descriptors. Just I undeploy 1 or 2 webapps, and I got to deploy other 1/2/3, and after this, the exception occurs again. I don't understando the logic of this.

edilmar
Offline
Joined: 2003-11-13
Points: 0

I solved the problem uninstalling GF 3.1.2.2 and installing GF 3.1.1.
After this, I got to deploy 7 same webapps easily.
Then, I think there is some bug in GF 3.1.2.2 deployment system.

hzhang_jn
Offline
Joined: 2005-07-22
Points: 0

I see. Will you be able to provide a reproducible test case with
associated steps? We will look into this. You should file a GlassFish
issue for this with the test case attached so this is tracked.

Thanks,

- Hong

On 10/26/2012 9:45 AM, forums@java.net wrote:
> I solved the problem uninstalling GF 3.1.2.2 and installing GF 3.1.1.
> After
> this, I got to deploy 7 same webapps easily. Then, I think there is
> some bug
> in GF 3.1.2.2 deployment system.
>
> --
>
> [Message sent by forum member 'edilmar']
>
> View Post: http://forums.java.net/node/891698
>
>

edilmar
Offline
Joined: 2003-11-13
Points: 0

The problem is that, if I create a simple webapp without database, richfaces, etc and try to deploy in GF 3.1.2.2, all works fine. I think there is a problem with Timers registered by GF 3.1.2.2 that are better managed by 3.1.1. I made the following test in 3.1.2.2:
1) start GF
2) deploy webapp1
3) stop GF
4) start GF
5) deploy webapp2
ALL worked fine!!!
But I hadn't the same luck deploying webapp3.
I think GF 3.1.2.2 leaves the Timers "arrested" and arises some conflits here.
My webapp has 4 Timers configured by ejb-jar.xml.
But, again, this doesn't occur in GF 3.1.1, and today I have 7 same webapps running fine.

hzhang_jn
Offline
Joined: 2005-07-22
Points: 0

I see. But will be hard for us to find the underlying cause without a
reproducible case here, maybe you could try to strip down your
application to a small test case but still can be used to reproduce the
problem?

On 10/26/2012 12:25 PM, forums@java.net wrote:
> The problem is that, if I create a simple webapp without database,
> richfaces,
> etc and try to deploy in GF 3.1.2.2, all works fine. I think there is a
> problem with Timers registered by GF 3.1.2.2 that are better managed by
> 3.1.1. I made the following test in 3.1.2.2: 1) start GF 2) deploy
> webapp1 3)
> stop GF 4) start GF 5) deploy webapp2 ALL worked fine!!! But I hadn't the
> same luck deploying webapp3. I think GF 3.1.2.2 leaves the Timers
> "arrested"
> and arises some conflits here. My webapp has 4 Timers configured by
> ejb-jar.xml. But, again, this doesn't occur in GF 3.1.1, and today I
> have 7
> same webapps running fine.
>
> --
>
> [Message sent by forum member 'edilmar']
>
> View Post: http://forums.java.net/node/891698
>
>

mvatkina
Offline
Joined: 2005-04-04
Points: 0

What do you mean by "arrested" timers? The info message that he is seeing (no timers to delete) is most probably from cleanup of a failed deploy, and the NPE in the original stack trace is from injection of a managed bean. Are there any warnings or error messages from the timer service? Timers are created per app-id, so they cannot clash between applications.

It would be the best if you can file an issue with test case(s) that reproduce the problem.

edilmar
Offline
Joined: 2003-11-13
Points: 0

I'll try to create a small webapp for this.
I don't know if really the problem is the timers, but it is interesting that after stop/start GF, the 2nd deploy works. I thought could be registered timers or webservices (I have 2 in the webapp) locked by GF.