By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,600 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,600 IT Pros & Developers. It's quick & easy.

looking for the solutiion of this:The server encountered an internal error () that pr

P: 3
hi buddy,the error is:
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.handle JspException(JspServletWrapper.java:541)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:435)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:390)


root cause

java.lang.NullPointerException
org.apache.jsp.sender_jsp._jspService(sender_jsp.j ava:84)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:390)


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


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

Apache Tomcat/6.0.14
the jsp page:
<%--
Document : sender
Created on : 2008-3-17, 14:01:17
Author : Administrator
--%>

<%@page contentType="text/html;charset=gb2312" pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<title>JSP Page</title>
</head>
<body>

<form method="POST" action="">
绑定用户ID:<input type="text" name="userPhone" value="" /><br>
绑定命令:<input type="text" name="command" value="" /><br>
<input type="radio" name="command" value="single" />单次定位
<input type="radio" name="command" value="consequance" />连续定位
<input type="radio" name="command" value="cease" />停止连续定位
<input type="radio" name="command" value="shutLED" />关闭定位器LED<br>
<input type="reset" value="重置" name="reset" />
<input type="submit" value="提交" name="submit" /><br>
</form>
<%
String commands=request.getParameter("command");
//String userPhone=request.getParameter("userPhone");
String msgPrefix[]={"GG","GM","GS","GL"};
String feedback="";

if(commands.equals("single"))
feedback=new String(msgPrefix[0]);
if(commands.equals("consequance"))
feedback=new String(msgPrefix[1]);
if(commands.equals("cease"))
feedback=new String(msgPrefix[2]);
if(commands.equals("shutLED"))
feedback=new String(msgPrefix[3]);
%>
<jsp:useBean id="sender" class="Bean.Sender" scope="page"/>
<jsp:setProperty name="sender" property="userPhone" param="userPhone"/>
<jsp:setProperty name="sender" property="sendData" param="<%=feedback%>"/>
<jsp:getProperty name="sender" property="userPhone"/>
<jsp:getProperty name="sender" property="sendData"/>
<%
//sender.sendCommands();
%>
<h2>first try,Hello World!</h2>
</body>
</html>
the javaBean code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package Bean;
import java.net.*;
import java.io.*;
/**
*
* @author Administrator
*/
public class Sender {
public String sendData;
public String userPhone;
public void setSendData(String sendData){this.sendData=sendData;}
public void setuserPhone(String add){this.userPhone=add;}
public String getSendData(){return this.sendData;}
public String getuserPhone(){return this.userPhone;}
public Sender(){ }
/*public void sendCommands(){
if(sendData!=null){
byte buffer[]=sendData.getBytes();
try{
InetAddress address=InetAddress.getByName(this.userPhone);
DatagramPacket sendPack=new DatagramPacket(buffer,buffer.length,address,9999);//server receiver port:8888
DatagramSocket sendSocket=new DatagramSocket();
sendSocket.send(sendPack);
}catch(Exception e){e.printStackTrace();}
}
}*/
}
Mar 19 '08 #1
Share this Question
Share on Google+
1 Reply


P: 3
hi buddy,the error is:
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.handle JspException(JspServletWrapper.java:541)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:435)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:390)


root cause

java.lang.NullPointerException
org.apache.jsp.sender_jsp._jspService(sender_jsp.j ava:84)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:390)


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


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

Apache Tomcat/6.0.14
the jsp page:
<%--
Document : sender
Created on : 2008-3-17, 14:01:17
Author : Administrator
--%>

<%@page contentType="text/html;charset=gb2312" pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<title>JSP Page</title>
</head>
<body>

<form method="POST" action="">
绑定用户ID:<input type="text" name="userPhone" value="" /><br>
绑定命令:<input type="text" name="command" value="" /><br>
<input type="radio" name="command" value="single" />单次定位
<input type="radio" name="command" value="consequance" />连续定位
<input type="radio" name="command" value="cease" />停止连续定位
<input type="radio" name="command" value="shutLED" />关闭定位器LED<br>
<input type="reset" value="重置" name="reset" />
<input type="submit" value="提交" name="submit" /><br>
</form>
<%
String commands=request.getParameter("command");
//String userPhone=request.getParameter("userPhone");
String msgPrefix[]={"GG","GM","GS","GL"};
String feedback="";

if(commands.equals("single"))
feedback=new String(msgPrefix[0]);
if(commands.equals("consequance"))
feedback=new String(msgPrefix[1]);
if(commands.equals("cease"))
feedback=new String(msgPrefix[2]);
if(commands.equals("shutLED"))
feedback=new String(msgPrefix[3]);
%>
<jsp:useBean id="sender" class="Bean.Sender" scope="page"/>
<jsp:setProperty name="sender" property="userPhone" param="userPhone"/>
<jsp:setProperty name="sender" property="sendData" param="<%=feedback%>"/>
<jsp:getProperty name="sender" property="userPhone"/>
<jsp:getProperty name="sender" property="sendData"/>
<%
//sender.sendCommands();
%>
<h2>first try,Hello World!</h2>
</body>
</html>
the javaBean code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package Bean;
import java.net.*;
import java.io.*;
/**
*
* @author Administrator
*/
public class Sender {
public String sendData;
public String userPhone;
public void setSendData(String sendData){this.sendData=sendData;}
public void setuserPhone(String add){this.userPhone=add;}
public String getSendData(){return this.sendData;}
public String getuserPhone(){return this.userPhone;}
public Sender(){ }
/*public void sendCommands(){
if(sendData!=null){
byte buffer[]=sendData.getBytes();
try{
InetAddress address=InetAddress.getByName(this.userPhone);
DatagramPacket sendPack=new DatagramPacket(buffer,buffer.length,address,9999);//server receiver port:8888
DatagramSocket sendSocket=new DatagramSocket();
sendSocket.send(sendPack);
}catch(Exception e){e.printStackTrace();}
}
}*/
}
i got the solution:
there lost one sentence in the jsp code:
......
if(commands!=null){
if(commands.equal("single"))
.........
.............
}

remedy the jsp code as above,the jsp work well.
Mar 19 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.