0 Replies Latest reply: Nov 1, 2008 8:34 AM by Nanda Kishore RSS

Servlet.service() for servlet jsp threw exception

Nanda Kishore Newbie

Hi i am using jboss 5.0.0 CR2 version. When i am deploying the application it is throwing this exception. I did not got this error in jboss 5.0.0 beta4.


This is from jboss consoule

13:13:53,234 INFO [STDOUT] Hibernate: select temperatur0_.loggerid as loggerid6
_, temperatur0_.date as date6_, temperatur0_.temp_logger as temp3_6_, temperatur
0_.text as text6_, temperatur0_.time as time6_ from temperature temperatur0_
13:13:53,843 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException: com.TemperatureEntityBeans.Temperature
 at org.apache.jsp.index_jsp._jspService(index_jsp.java:233)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:366)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
22)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
lter.java:96)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:235)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
yAssociationValve.java:189)
 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
e.java:91)
 at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invok
e(SecurityContextEstablishmentValve.java:92)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
onnectionValve.java:157)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:325)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:828)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:601)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
 at java.lang.Thread.run(Thread.java:595)


This is from web page.
where Temperature=entity beans
org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 168


166:
167: for (int i = 0; i < temp1.size(); i++) {
168: Temperature c = (Temperature)(temp1).get(i);

170: SimpleDateFormat t = new SimpleDateFormat("HH:mm:ss");
171: StringBuilder nowMMDDYYYY = new StringBuilder( dateformatMMDDYYYY.format( c.getDate() ) );


Stacktrace:
 org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

java.lang.ClassCastException: com.TemperatureEntityBeans.Temperature
 org.apache.jsp.index_jsp._jspService(index_jsp.java:231)
 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:366)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)