我用的netBeans报错:
java.lang.NullPointerException
com.google.appengine.api.users.UserServiceImpl.getCurrentUser(UserServiceImpl.java:79)
guestbook.GuestbookServlet.doGet(GuestbookServlet.java:61)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
但是我上传到Google app engine 上后是正常的,请问这是为什么呢?
另一段错误:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /guestbook.jsp at line 23
20:
21: <%
22: UserService userService = UserServiceFactory.getUserService();
23: User user = userService.getCurrentUser();
24: if (user != null) {
25: %>
26: <p>Hello, <%= user.getNickname() %>! (You can
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.NullPointerException
com.google.appengine.api.users.UserServiceImpl.getCurrentUser(UserServiceImpl.java:79)
org.apache.jsp.guestbook_jsp._jspService(guestbook_jsp.java:74)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
回复 更多评论