This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JSP and the fly likes Servlet.service() for servlet jsp threw exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Servlet.service() for servlet jsp threw exception" Watch "Servlet.service() for servlet jsp threw exception" New topic
Author

Servlet.service() for servlet jsp threw exception

ethiraj
Greenhorn

Joined: Sep 23, 2002
Posts: 1
Hi All,

I'm working with:
Borland Application Server 5.1
JVM 1.4.0_02
Apache Tomcat/4.1.10
MSSQL 2000
MicroSoft SQL Server 2000 JDBC Driver
CMP 2.0 - Entity Bean

I tried with sample application which insert values to the table in database and retreive values from database

These are the following errors i am getting when i am runnning the application with JSP/Servlet. when i am running the same in client(console) it works fine.

can any one help me

StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception

java.lang.ClassCastException: testcustomerdob19sep2002.CustomerDOB19Sep2002RemoteHomePOAInvokeHandler

java.lang.ClassCastException: testcustomerdob19sep2002.CustomerDOB19Sep2002RemoteHomePOAInvokeHandler

at testcustomerdob19sep2002._CustomerDOB19Sep2002RemoteHome_Stub.findByPrimaryKey(_CustomerDOB19Sep200 2RemoteHome_Stub.java:53)

at org.apache.jsp.indexdob$jsp._jspService(indexdob$jsp.java:84)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:246)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2410)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1018)

at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1113)

at java.lang.Thread.run(Thread.java:479)
[ March 18, 2005: Message edited by: Bear Bibeault ]
Sean MacLean
author
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
"ethiraj",
Thanks for participating here at the Ranch. However, the name you are using does not comply with our naming convention described at http://www.javaranch.com/name.jsp . Please log in with a new name, which meets these requirements.
You can change your name here.
Thanks.
Sean
Chris Smith
Ranch Hand

Joined: May 03, 2002
Posts: 42
Incidentally, this is an EJB problem, not a JSP one. The JSP stuff is doing exactly what it should do, calling findByPrimaryKey, and getting a ClassCastException from there. Look at your EJB code for the problem, not your JSP file.
Chris
Sean MacLean
author
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
Make sure that you do not have your beans in both the jar and the classes directory (only put the interfaces in the classes directory in the WEB-INF). The ejb container will end up using one and the web app will find the other causing a class cast exception. This is purely a guess but worth a shot.
Sean
Jake Lee
Greenhorn

Joined: Apr 02, 2002
Posts: 18
I have got the same error but I was doing something only in jsp with a bean in Tomcat 5.0 while running a web app with salesforce.com - what I was trying to do is simply sending form data to a result page for processing...and it got bombed when posting data to result.jsp. anyone can shed some light here? Thx

2005-03-18 09:45:10 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.result_jsp._jspService(result_jsp.java:77)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61103
    
  66

Actually your problem is completely unrelated to the original poster's.

The beef of your error is in these two lines:



Your JSP result.jsp is throwing a null pointer exception.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet.service() for servlet jsp threw exception