• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

http error?

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTTP Status 500 -

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

type Exception report

message

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

exception

javax.servlet.ServletException: Wrapper cannot find servlet class Person or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)


root cause

java.lang.ClassNotFoundException: Person
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)


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




person.jsp [size=24] [/size]
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!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=ISO-8859-1">
<title>Personnel Details</title>
</head>
<body>
<center>
<form action="/person/person" method="post">

Name:<input value="name"><br>
Father name:<input vaue="fname"><br>
Mobile No:<input values="mno"><br>
Company:<input values="comp"><br>
Address:<textarea values="add" type="addres"></textarea><br>


City:
<select name="City">
<option value="Bangalore">Bangalore</option>
<option value="Chennai">Chennai</option>
<option value="Hyderbad">Hyderbad</option>
<option value="Mumbai">Mumbai</option>
</select>
<br>

States:
<select name="States">
<option value="Kanataka">Kanataka</option>
<option value="Tamilnadu">Tamilnadu</option>
<option value="Andrapradesh">Andrapradesh</option>
<option value="Maharastra">Maharastra</option>
</select><br>

<input type=submit name="b1" value="Save">
<input type=submit name="b1" value="Edit"> <br>
</form>
</center>
</body>

</html>
==========================================================================================================

[color=red] person.java [size=24] [/color][/size]


import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class Person extends HttpServlet {

public void doGet (HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException
{
String paramName = null;

Map<String, String[]> personalDetailsMap=null;
HttpSession session=request.getSession();
Enumeration<String> param = request.getParameterNames();

while(param.hasMoreElements())
{
personalDetailsMap = new HashMap<String, String[]>();
paramName = param.nextElement();
String[] paramValues = request.getParameterValues(paramName);
/* for(int i=0; i<paramValues.length; i++){
String paramName = paramValues.

}*/
personalDetailsMap.put("personalDetailsMap", paramValues);



}
session.setAttribute("paramlist",personalDetailsMap);
String btnVal=request.getParameter("b1");
if("Save".equals(btnVal))
{

RequestDispatcher dispatcher=request.getRequestDispatcher("/jsp/save.jsp");
dispatcher.forward(request,response);
}
else if("Edit".equals(btnVal))
{
RequestDispatcher dispatch=request.getRequestDispatcher("/jsp/output.jsp");
if ( null != dispatch )
{
dispatch.forward(request,response);
}
}
}
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}



===========================================================================================================


[color=red]ouput.jsp[/color][size=24] [/size]
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Map"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" %>
<!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=ISO-8859-1">
<title>Output.jsp</title>
</head>
<body>


<%
out.println(request.getAttribute("paramlist")); %>
<%
List paramlist=(List)request.getAttribute("paramlist");

Iterator itr =paramlist.iterator();
for (itr=paramlist.iterator(); itr.hasNext(); )
{
%>
<tr>
<td ><%=itr.next()%></td>
<td ><%=itr.next()%></td>
</tr>
<%}%>

</body>
</html>

 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This line says it all:

java.lang.ClassNotFoundException: Person
 
Marshal
Posts: 26909
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wonder whether that message means the Person class is really not in the web application's classpath, or whether it actually means that the Person class is not in a package, as it must be to be loaded by a class which is in a package?
 
karthik ekantha
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
now i took some changes .then now i 'm got error in output.jsp.when edit button click.please check my output.jsp

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:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Person.doGet(Person.java:51)
Person.doPost(Person.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.lang.NullPointerException
org.apache.jsp.jsp.output_jsp._jspService(output_jsp.java:78)
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)
Person.doGet(Person.java:51)
Person.doPost(Person.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
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.18 logs.

===================================================================
output.jsp



<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Map"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" %>
<!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=ISO-8859-1">
<title>Output.jsp</title>
</head>
<body>


<%
out.println(request.getAttribute("paramlist")); %>
<%
List paramlist=(List)request.getAttribute("paramlist");

Iterator itr =paramlist.iterator();
for (itr=paramlist.iterator(); itr.hasNext(); )
{
%>
<tr>
<td ><%=itr.next()%></td>
<td ><%=itr.next()%></td>
</tr>
<%}%>

</body>
</html>
 
Ranch Hand
Posts: 171
Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems the following lines causing the problem,


Try to print the above statements line by line or check the below error in compiled output.jsp file under (if tomcat) Tomcat/work/Catalina/localhost/[my-web-app]/org/apache/jsp

org.apache.jsp.jsp.output_jsp._jspService(output_jsp.java:78)
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic