[jbossws-issues] [JBoss JIRA] Commented: (JBWS-2823) CLONE -NameAlreadyBoundException when more than one virtual host are specified in @WebContext(virtualHosts) annotation variable

András Péteri (JIRA) jira-events at lists.jboss.org
Mon Jul 12 12:31:46 EDT 2010


    [ https://jira.jboss.org/browse/JBWS-2823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12538839#action_12538839 ] 

András Péteri commented on JBWS-2823:
-------------------------------------

I could successfully reproduce the problem using Daniele's sample .ear file, JBoss AS 5.x and JBossWS-Metro-3.3.1. Some debugging revealed that in TomcatDeployment's inner class, EncListener, lookups directed to java:comp end up in ENCFactory, where it is decided if a new NamingContext should be created or a previous one should be returned based on the current thread classloader. During normal deployments the TCL is set to separate WebCtxLoader.ENCLoader instances; this ensures that fresh contexts are returned and the TransactionSynchronizationRegistry bindings don't clash. In the Metro stack, however, WSIT's TransactionManagerImpl invokes a one-time lookup on java:comp with the .ear's BaseClassLoader set as TCL to check if JTA support is available (the end result is stored in a static variable in class Util.hasJTA), so a context gets created for the parent of all following WebCtxLoaders. If the endpoint deployment aspect is executed before web deployment, the same context is returned for all web modules regardless of the TCL, so only the first one gets a chance to bind to a particular JNDI name before a NameAlreadyBoundException is thrown.

This might be the cause of JBAS-7092 as well; the general issue seems to be that anything that initializes java:comp on a classloader removes the possibility of creating separated NamingContexts for its children.

> CLONE -NameAlreadyBoundException when more than one virtual host are specified in @WebContext(virtualHosts) annotation variable
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBWS-2823
>                 URL: https://jira.jboss.org/browse/JBWS-2823
>             Project: JBoss Web Services
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: jbossws-metro
>    Affects Versions:  jbossws-metro-3.2.1
>         Environment: Windows and Solaris
>            Reporter: Daniele Ulrich
>            Assignee: Richard Opalka
>            Priority: Minor
>             Fix For: jbossws-metro-3.4.0
>
>         Attachments: sampleApp.zip, sampleAppEar-1.0.ear, TomcatDeployment.java
>
>
> To reproduce this problem uncomment the jaxws/jbws981 test case in test-excludes-jboss50x files:
> < 08:45:01,579 ERROR [AbstractKernelController] Error installing to Start: name=jboss.web.deployment:war=/jaxws-jbws981 state=Create mode=Manual requiredState=Installed
> < org.jboss.deployers.spi.DeploymentException: URL file:/opt/svn/jbossas/tags/JBoss_5_0_0_CR2/build/output/jboss-5.0.0.CR2/server/default/tmp/deploy/jaxws-jbws981.jar8416-exp.war/ deployment failed
> < 	at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
> < 	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:358)
> < 	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:144)
> < 	at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:459)
> < 	at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
> < 	at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
> < 	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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
> < 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
> < 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
> < 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
> < 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
> < 	at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
> < 	at $Proxy35.start(Unknown Source)
> < 	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
> < 	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
> < 	at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
> < 	at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
> < 	at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
> < 	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
> < 	at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
> < 	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
> < 	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
> < 	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
> < 	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
> < 	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
> < 	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
> < 	at org.jboss.system.ServiceController.doChange(ServiceController.java:672)
> < 	at org.jboss.system.ServiceController.start(ServiceController.java:444)
> < 	at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:146)
> < 	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:104)
> < 	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:45)
> < 	at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
> < 	at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
> < 	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
> < 	at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
> < 	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
> < 	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1024)
> < 	at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
> < 	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
> < 	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
> < 	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
> < 	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
> < 	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
> < 	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
> < 	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
> < 	at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
> < 	at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
> < 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:812)
> < 	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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
> < 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
> < 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
> < 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
> < 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
> < 	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 org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:270)
> < 	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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
> < 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
> < 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
> < 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
> < 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
> < 	at org.jboss.jmx.connector.invoker.SerializableInterceptor.invoke(SerializableInterceptor.java:74)
> < 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
> < 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
> < 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
> < 	at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
> < 	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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
> < 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
> < 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
> < 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
> < 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
> < 	at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:815)
> < 	at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:416)
> < 	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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
> < 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> < 	at java.security.AccessController.doPrivileged(Native Method)
> < 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> < 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
> < 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
> < 	at java.lang.Thread.run(Thread.java:595)
> < Caused by: java.lang.RuntimeException: javax.naming.NameAlreadyBoundException
> < 	at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:539)
> < 	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> < 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4365)
> < 	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:352)
> < 	... 100 more
> < Caused by: javax.naming.NameAlreadyBoundException
> < 	at org.jnp.server.NamingServer.bind(NamingServer.java:165)
> < 	at org.jnp.interfaces.NamingContext.bind(NamingContext.java:593)
> < 	at org.jnp.interfaces.NamingContext.bind(NamingContext.java:554)
> < 	at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:522)
> < 	... 103 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the jbossws-issues mailing list