When entering a directory that has symbolic links get the following exception (with and without allowLinking enabled). Can fix this by checking childCacheEntry.attributes for null, but the links are not followed when clicked. Have tried this only on Solaris (sparc) and Linux (x86), get the same results. server.xml: <DefaultContext allowLinking="true" caseSensitive="true" crossContext="true" reloadable="true"/> SEVERE: Servlet.service() for servlet default threw exception java.lang.NullPointerException at org.apache.catalina.servlets.DefaultServlet.renderHtml(DefaultServlet.java:1324) at org.apache.catalina.servlets.DefaultServlet.render(DefaultServlet.java:1081) at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:786) at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:323) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:365) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)
See http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html DefaultContext in server.xml is no longer supported by tomcat. cu Fohrer
I have read the doc reference and have I've taken the DefaultContext out of the server.xml and I still get the exception when I open a directory containing a symbolic link.
BZ is not a support list.
Ok then, why should a symbolic link in a directory cause the container to throw exception??, that's why I raised a bug. The web app directory is: ROOT/ | filea | fileb | tmp1/ | filef -> ../filea | | tmp2/ | dirc -> /opt/test/somedir 1. While I open the browser at "/" I get a directory listing 2. When I move the browser into tmp or tmp2 I get an exception (weather I have allowLinking enabled/disabled) bal.
Verified this on Tomcat 5.5.7. Directory listing fails when a symbolic link is present.
Guy, are you getting the same exception stack trace, namely an NPE in line 1324 of DefaultServlet, on 5.5.7? Looking at the source code for DefaultServlet, that line is sb.append where sb.append had been called a few times before in that method, so an NPE there doesn't seem possible.
Please do not reopen an issue without providing further comment or data.