[jboss-jira] [JBoss JIRA] Commented: (JBAS-8836) org.jboss.test.web.test.RootContextUnitTestCase
Daniel Bevenius (JIRA)
jira-events at lists.jboss.org
Fri Jun 17 08:37:24 EDT 2011
[ https://issues.jboss.org/browse/JBAS-8836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609436#comment-12609436 ]
Daniel Bevenius commented on JBAS-8836:
---------------------------------------
The error above can be tracked to AbstractWarDeployment and it's linkSecurityDomain method:
{code}
protected void linkSecurityDomain(String securityDomain, Context javaCompCtx) throws NamingException
{
if (securityDomain == null)
{
securityDomain = getDefaultSecurityDomain();
log.debug("No security-domain given, using default: " + securityDomain);
}
// JBAS-6060: Tolerate a Security Domain configuration without the java:/jaas prefix
if (securityDomain.startsWith(SecurityConstants.JAAS_CONTEXT_ROOT) == false)
securityDomain = SecurityConstants.JAAS_CONTEXT_ROOT + "/" + securityDomain;
log.debug("Linking security/securityMgr to JNDI name: " + securityDomain);
Util.bind(javaCompCtx, "env/security/securityMgr", new LinkRef(securityDomain));
Util.bind(javaCompCtx, "env/security/realmMapping", new LinkRef(securityDomain + "/realmMapping"));
Util.bind(javaCompCtx, "env/security/authorizationMgr", new LinkRef(securityDomain + "/authorizationMgr"));
Util.bind(javaCompCtx, "env/security/security-domain", new LinkRef(securityDomain));
Util.bind(javaCompCtx, "env/security/subject", new LinkRef(securityDomain + "/subject"));
}
{code}
Now changing the bind method calls and calling rebind instead lets the test pass. But it seems like the context is not getting cleaned up when undeployed that is the real issue. I've looked into this and tried cleaning up the context. I'm attaching a patch, jbas-8836.patch, which shows the changes I made.
Would be great if you can take a look and see if this seems resonable.
> org.jboss.test.web.test.RootContextUnitTestCase
> -----------------------------------------------
>
> Key: JBAS-8836
> URL: https://issues.jboss.org/browse/JBAS-8836
> Project: Legacy JBoss Application Server 6
> Issue Type: Sub-task
> Security Level: Public(Everyone can see)
> Components: Test Suite
> Reporter: Shelly McGowan
> Assignee: Shelly McGowan
> Fix For: 6.1.0
>
>
> org.jboss.test.web.test.RootContextUnitTestCase.testRootContextEAR
> org.jboss.test.web.test.RootContextUnitTestCase.testRootContextWAR
> 2011-01-24 05:41:05,869 DEBUG [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (RMI TCP Connection(606)-10.16.93.209) Linking security/securityMgr to JNDI name: java:/jaas/jboss-web-policy
> 2011-01-24 05:41:05,869 ERROR [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (RMI TCP Connection(606)-10.16.93.209) ENC setup failed: javax.naming.NameAlreadyBoundException: securityMgr
> at org.jnp.server.NamingServer.bind(NamingServer.java:209) [:5.0.5.Final]
> at org.jnp.server.NamingServer.bind(NamingServer.java:167) [:5.0.5.Final]
> at org.jnp.server.NamingServer.bind(NamingServer.java:167) [:5.0.5.Final]
> at org.jnp.interfaces.NamingContext.bind(NamingContext.java:652) [:5.0.5.Final]
> at org.jnp.interfaces.NamingContext.bind(NamingContext.java:613) [:5.0.5.Final]
> at org.jboss.util.naming.Util.bind(Util.java:105) [jboss-common-core.jar:2.2.17.GA]
> at org.jboss.util.naming.Util.bind(Util.java:91) [jboss-common-core.jar:2.2.17.GA]
> at org.jboss.web.deployers.AbstractWarDeployment.linkSecurityDomain(AbstractWarDeployment.java:836) [:6.0.1-SNAPSHOT]
> at org.jboss.web.tomcat.service.deployers.TomcatDeployment.access$200(TomcatDeployment.java:85) [:6.0.1-SNAPSHOT]
> at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:437) [:6.0.1-SNAPSHOT]
> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [:]
> at org.apache.catalina.core.StandardContext.start(StandardContext.java:3823) [:]
> at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:294) [:6.0.1-SNAPSHOT]
> at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146) [:6.0.1-SNAPSHOT]
> at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:477) [:6.0.1-SNAPSHOT]
> at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) [:6.0.1-SNAPSHOT]
> at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.1-SNAPSHOT]
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list