DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=40580>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=40580 Summary: Multiple ServletContext objects for same web-app in 5.5.17, only one is the real one. Okay in 5.5.12 Product: Tomcat 5 Version: Nightly Build Platform: Other OS/Version: Linux Status: NEW Severity: blocker Priority: P2 Component: Unknown AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] Note: the version select list in ASF Bugzilla is missing 5.5.17 so I choose Nightly Build instead. My web-app is being supplied with the wrong ServletContext when the path is not /. In general it is getting a different ServletContext for each path, but each path gets the same ServletContext. To check this the method "dump" dumps the attributes of the ServletContext object and it's id. When the method "dump" is invoked when requesting /index.html this dumped, dump start dump: application: [EMAIL PROTECTED] dump: application: 26556037 dump: org.apache.catalina.jsp_classpath dump: javax.servlet.context.tempdir dump: intl-channel-attribute dump: service-locator-default dump: service-locator-intl-chid dump: org.apache.catalina.resources dump: org.apache.catalina.WELCOME_FILES dump end This is the "dump" method, private static void dump(ServletContext application) { System.out.println("dump start"); System.out.println("dump: application: " + application.toString()); System.out.println("dump: application: " + System.identityHashCode(application)); for (Enumeration e = application.getAttributeNames(); e.hasMoreElements();) { String attrName = (String) e.nextElement(); System.out.println("dump: " + attrName); } System.out.println("dump end"); } HOWEVER when a different path is requested the ServletContext is different and has lost the attributes that were set on it, This is what I got when requesting /search/search.html dump start dump: application: [EMAIL PROTECTED] dump: application: 27581845 dump: org.apache.catalina.jsp_classpath dump: javax.servlet.context.tempdir dump: org.apache.catalina.resources dump: org.apache.catalina.WELCOME_FILES dump end In general different paths give different ServletContext and only /index.html gives the ServletContext as it was initialised by the ServletContextListener. I do not have this problem with 5.5.12. The web-app is deployed as a directory containing WEB-INF, index.html etc jsp> ls -d1 intl/W* intl/i* intl/search/search.html intl/index.html intl/search/search.html intl/WEB-INF This is the <Host> element <Host name="intl.development" debug="0" appBase="/opt/xl/web/jsp/intl" unpackWARs="false" autoDeploy="false" liveDeploy="false"> <Context path="" docBase="" debug="0" allowLinking="true" /> </Host> What has changed between 5.5.12 and 5.5.17 to cause this and can I prevent it? -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]