Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

ClassCastException in JSP?!!

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.ClassCastException
at org.apache.struts.util.RequestUtils.retrieveMessageResources(RequestUtils.java:1089)
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:1043)
at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:294)
at _jsp._ttsendmessage__jsp._jspService(C:\resin-2.1.10\webapps\xoraapps\jsp\TTSendMessage.jsp:9)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.subservice(Page.java:506)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
at com.caucho.server.http.Invocation.service(Invocation.java:315)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:222)
at com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:103)
at com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:80)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
at com.caucho.server.http.Invocation.service(Invocation.java:315)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:164)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:534)

Can anybody give a reason for this exception although other jsps with bean tags work fine...???
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nicolas,

ClassCastException is thrown when your java code cannot find the specified class. That may be because you may not have imported the class or qualified it with the package name.

Hope this helps!

Regards,

Amit.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've seen this before. You probably are using the <html:errors> tag, but in you code, you have something like:



Change ActionMessage to ActionError
 
Marshal
Posts: 67445
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

ClassCastException is thrown when your java code cannot find the specified class.



That is incorrect. In such a case a ClassNotFound exception will be thrown.

A ClassCastException occurs when a cast is performed upon an object to a type which is not in the class hierarchy of an object, or to an unimplemented interface. For example, if an object is of class String, you can cast it to a String, or to an Object (since String extends Object), or to a Comparable (since String implements that interface). But you cannot cast it to a Double or to any other class that it is not one of, not an extension of, or to an interface that it does not implement.
[ June 03, 2004: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What code creates this Exception?

Note that if it's JSP-specific code, and not specific to a web application framework, then the JSP forum would be the appropriate place to have this conversation.
 
Bear Bibeault
Marshal
Posts: 67445
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like it's being thrown from within one of the Struts tags so probably appropriate here.

To the original poster: don't you think that including some context with your stack trace might have been just a tad more useful? Like the tag syntax originating the error, no?
 
Look ma! I'm selling my stuff!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic