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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

class cast exception

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hello!

Well, in a jsp system I'm getting java.lang.ClassCastException: java.lang.String error when trying to access a page. It�s strange because when i visit this page for the first time nothing happens. But if i navigate for while and redirect to "the page", this error occurs.

A time this error appeared when i created a session variable two times, with different names....

PS:
Browser feedback:

java.lang.ClassCastException: java.lang.String
at org.apache.jsp.ConsultaSolicitacoes_jsp._jspService(ConsultaSolicitacoes_jsp.java:74)

Servlet:

ns = (YYY.NucleoSolucionador) _jspx_page_context.getAttribute("ns", PageContext.SESSION_SCOPE);

Thank�s for your attention,
Rafael.

Sorry for my bad english....
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Well, something, somewhere in your web app is calling

pageContext.setAttribute("ns", "a string.");

directly or indirectly. Figure out where.
    Bookmark Topic Watch Topic
  • New Topic