当前位置: 代码迷 >> J2EE >> The server encountered an internal error () that prevented it from fulfillin,该如何解决
  详细解决方案

The server encountered an internal error () that prevented it from fulfillin,该如何解决

热度:43   发布时间:2016-04-21 20:06:46.0
The server encountered an internal error () that prevented it from fulfillin
HTTP Status 500 - 

--------------------------------------------------------------------------------

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 /register.jsp at line 9

6:  if (request.getParameter("login") != null) {
7:  String username = request.getParameter("username");
8:  String password = request.getParameter("password");
9:  float money=Float.parseFloat(request.getParameter("money")); 
10:  UsersVo vo = new UsersVo();
11:  vo.setUsername(username);
12:  vo.setPassword(password);


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:519)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:428)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause 

java.lang.NullPointerException
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:991)
java.lang.Float.parseFloat(Float.java:422)
org.apache.jsp.register_jsp._jspService(register_jsp.java:65)
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:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.

------解决方案--------------------

float money=Float.parseFloat(request.getParameter("money"));
//此处request.getParameter("money") ==null,所以 java.lang.NullPointerException,你 debug看一下是
//不是为空

------解决方案--------------------
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause 

java.lang.NullPointerException
org.apache.jsp.index_jsp._jspService(index_jsp.java:299)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.

这个怎么解决啊?

------解决方案--------------------
求解,我也遇到这种问题
------解决方案--------------------
register.jsp at line 9
java.lang.NullPointerException,

找关键错误信息,  明显是 Float.parseFloat()的时候报 的错,  
你String moneys=request.getParameter("money");

 打印一下moneys 看看 有没有值,
  相关解决方案