我正在使用 Tomcat 6,但我注意到一件奇怪的事情 - 在它启动后,它会立即加载我的Login.jsp
页面。在我看来,它应该没有理由这样做,谷歌搜索这个问题我一无所获。任何帮助,将不胜感激。
线索和注释:
Login.jsp
它是而不是其他东西的原因很可能是我web.xml
将它列为唯一的<welcome-file>Login.jsp</welcome-file>
.如果我在 中打印堆栈跟踪
Login.jsp
,我会得到:java.lang.Exception at org.apache.jsp.Login_jsp._jspService(Login_jsp.java:64) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.mycompany.StartupFilter.doFilter(StartupFilter.java:33) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:722)
您会注意到有一个 custom
StartupFilter
,但它可能不是原因。到目前为止,这看起来就像由浏览器引起的任何其他网页加载一样。- 让我们检查导致这种情况的请求:
remoteAddr
andremoteHost
is127.0.0.1
。remotePort
是-1
,这真的很奇怪。请求中没有参数。(还有什么我应该在这里关注的吗?) - 我有一些在后台运行的预定线程,但它们没有触及 JSP 前端。
启动日志如下所示:
Nov 07, 2013 6:45:17 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/vektor/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:. Nov 07, 2013 6:45:17 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:RealPadWeb' did not find a matching property. Nov 07, 2013 6:45:17 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Nov 07, 2013 6:45:18 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8443 Nov 07, 2013 6:45:18 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 931 ms Nov 07, 2013 6:45:18 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 07, 2013 6:45:18 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.35 Nov 07, 2013 6:45:19 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Nov 07, 2013 6:45:19 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8443 Nov 07, 2013 6:45:19 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Nov 07, 2013 6:45:19 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/18 config=null Nov 07, 2013 6:45:19 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 1622 ms <here I found logged my System.out.println() I put in Login.jsp>
当我打开访问日志阀时,我得到以下行:
127.0.0.1 - - [07/Nov/2013:19:01:54 +0100] "GET / HTTP/1.1" 200 5136
- 我在端口 8443 上使用 HTTPS 连接器,它重定向到通常的 8080。
- 我尝试关闭 Chrome,但没有帮助(一个奇怪的插件可能会触及最近访问过的服务器左右)。
- 我正在从 Eclipse Juno 启动服务器。
这是我得到的。任何帮助将非常感激。如果您需要查看任何其他配置文件,请告诉我!
在折叠之下:细节
- OS X 10.8.5(可能是防火墙吗?)
- Java 1.6.0.35
- 雄猫 6.0.35
- 该项目使用 AspectJ,日志记录是通过 Log4J 2 beta cca 9 完成的(它可能是一个日志记录守护线程吗?)