Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353534 - javax.naming.NamingException: This context is immutable; remaining name 'env'
Summary: javax.naming.NamingException: This context is immutable; remaining name 'env'
Status: RESOLVED DUPLICATE of bug 389956
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 389956
Blocks:
  Show dependency tree
 
Reported: 2011-08-01 22:50 EDT by Alan D. Cabrera CLA
Modified: 2012-09-20 22:35 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan D. Cabrera CLA 2011-08-01 22:50:59 EDT
Build Identifier: 6.1.26

Concurrently deploy hundreds of WARs onto a jetty server and you will eventually get the error:


javax.naming.NamingException: This context is immutable; remaining name 'env'
at org.mortbay.naming.NamingContext.createSubcontext(NamingContext.java:434)
at org.mortbay.naming.NamingContext.createSubcontext(NamingContext.java:517)
at org.mortbay.jetty.plus.webapp.EnvConfiguration.createEnvContext(EnvConfiguration.java:58)
at org.mortbay.jetty.plus.webapp.EnvConfiguration.configureDefaults(EnvConfiguration.java:101)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1262)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)


Reproducible: Sometimes

Steps to Reproduce:
1.Concurrently deploy hundreds of WARs onto a jetty server and you will eventually get the error.
2.
3.
Comment 1 Jan Bartel CLA 2011-08-15 00:11:54 EDT
Hi Alan,

Are you deploying the same webapp hundreds of times, or are these all different webapps? 

Are you deploying statically by placing webapps into $JETTY_HOME/webapps, or are they (hot)deployed via the ContextDeployer, or are you deploying them in code (embedded)? 

What $JETTY_HOME/etc files are on your startup line? 

Do you have any extra jars over and above the ones from the distro in $JETTY_HOME/lib?

Are there any other errors in the log?

Finally, do you have a sample webapp that makes this error happen? 

thanks
Jan
Comment 2 Jan Bartel CLA 2011-08-29 21:31:07 EDT
Hi Allen,

Any further info????

Jan
Comment 3 Greg Wilkins CLA 2011-10-19 01:35:04 EDT
Downgraded priority as no information provided.
Comment 4 Alan D. Cabrera CLA 2011-11-22 10:42:06 EST
(In reply to comment #1)
> Hi Alan,
> 
> Are you deploying the same webapp hundreds of times, or are these all different
> webapps? 

Different webapps

> Are you deploying statically by placing webapps into $JETTY_HOME/webapps, or
> are they (hot)deployed via the ContextDeployer, or are you deploying them in
> code (embedded)? 

Deploying in code

> What $JETTY_HOME/etc files are on your startup line? 

None

> 
> Do you have any extra jars over and above the ones from the distro in
> $JETTY_HOME/lib?

I have scrubbed our proprietary jars from the list:

(linkedin)[acabrera-mn:backend-container 567]$ ls lib
activation-1.0.2.jar
commons-logging-1.1.jar
jetty-util-6.1.26.jar
servlet-api-2.5.jar
ant-1.6.5.jar
jetty-util5-6.1.26.jar
spring-2.5.5.jar
spring-webmvc-2.5.5.jar
json-simple-1.1.jar
jsp-2.1-6.1.1.jar
jaxen-1.1.1.jar
jsp-api-2.1-6.1.1.jar
jdom-1.0.jar
jetty-6.1.26.jar
commons-beanutils-1.7.0.jar
jetty-management-6.1.26.jar
log4j-1.2.15.jar
commons-cli-1.0.jar
jetty-naming-6.1.26.jar
mail-1.3.0.jar
xml-apis-1.3.04.jar
commons-lang-2.4.jar
jetty-plus-6.1.26.jar	
mx4j-tools-3.0.2.jar
 
> Are there any other errors in the log?

none

> Finally, do you have a sample webapp that makes this error happen? 

Other than the hundreds of proprietary WARs, I do not.
Comment 5 Jan Bartel CLA 2012-09-20 22:35:26 EDT
Alan,

I believe this bug has been recently fixed in jetty-7 - see https://bugs.eclipse.org/bugs/show_bug.cgi?id=389956.

If you truly are concurrently deploying webapps, then the value of ContextHandler.getCurrentContext() will change depending on what thread has just started to deploy a webapp. This then affects the jndi impl, which uses the current context to select which java:comp to use. I believe the fix I did in jetty-7 - to use the thread context classloader to determine which java:comp namespace to use - will solve this problem. I've applied it across to the jetty-6 codebase, so if you want to try it out, please checkout and build jetty-6. (Of course, better that you upgrade to jetty-7 if you can).

Jan

*** This bug has been marked as a duplicate of bug 389956 ***