0

我知道这个错误之前已经发布过,但我无法理解堆栈跟踪,希望有人帮助。

基本上当我进入应用程序时getValue("client")为空:

HttpSession validuser = request.getSession(); 

if (validuser.getValue("client") == null) {  
    response.sendRedirect("/profile/factfind/includes/session_timeout.jsp");
}

我认为这与以下错误有关:

2013-01-09 13:14:35 NamingContextListener[/Tomcat-Standalone/localhost/profile]: Creating JNDI naming context
2013-01-09 13:14:35 StandardManager[/profile]: Seeding random number generator class java.security.SecureRandom
2013-01-09 13:14:35 StandardManager[/profile]: Seeding of random number generator has been completed
2013-01-09 13:14:35 StandardContext[/profile]: Posting standard context attributes
2013-01-09 13:14:35 StandardContext[/profile]: Configuring application event listeners
2013-01-09 13:14:35 StandardContext[/profile]: Sending application start events
2013-01-09 13:14:35 StandardContext[/profile]: Starting filters
2013-01-09 13:14:35 StandardContext[/profile]: Starting completed
2013-01-09 13:14:37 StandardContext[/profile]: Servlet /profile threw load() exception
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
    [javac] Compiling 1 source file



    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:248)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:343)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:427)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:142)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:720)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:888)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:768)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3484)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3710)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:777)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:760)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:538)
    at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:667)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
    at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:217)
    at org.apache.commons.digester.Rule.end(Rule.java:253)
    at org.apache.commons.digester.Digester.endElement(Digester.java:1222)
    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1765)
    at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:343)
    at org.apache.catalina.core.StandardHost.install(StandardHost.java:762)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:443)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:377)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:808)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:335)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1156)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:697)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1148)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:311)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2213)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:484)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:371)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:134)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:151)

该会话存在于另一个应用程序中,然后加载“配置文件”,所以我不太确定当一个启动另一个时会发生什么。

任何帮助将非常感激。谢谢。

4

3 回答 3

1

原来对我的修复与一些论坛建议的相同。我在一个没有空格的目录中创建了一个新的 Tomcat 安装(即C:\Tomcat4.1),并且工作正常。

不知道为什么或如何,但确实如此。

于 2013-01-09T22:18:12.877 回答
0

我认为这是个问题

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

清理您的项目(或手动删除所有 .class 文件)然后尝试从头开始编译。如果错误消失 - 检查它应该工作。如果不是 - 您显然应该消除第一个错误。

于 2013-01-09T04:13:07.623 回答
-1

似乎getValue(String)方法已被弃用。所以试试下面的代码null == validuser.getAttribute(String)

于 2013-01-09T04:03:35.130 回答