错误如下
null...1...
四月 04, 2014 5:11:20 下午 org.apache.catalina.core.StandardContext fireRequestInitEvent
严重: Exception sending request initialized lifecycle event to listener instance of class listener.RequestListener java.lang.NullPointerException
at listener.RequestListener.requestInitialized(RequestListener.java:43)
at org.apache.catalina.core.StandardContext.fireRequestInitEvent(StandardContext.java:5711)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:157)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:550)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1684)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
请问这是因为在Listener 才会出这种错误吗? ------解决方案-------------------- 很明显的空指针啊,你刚new了一个User就打印,那肯定是空的啊,你是想问什么呢? ------解决方案--------------------