Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

SEVERE: javax.faces.FacesException: java.lang.ClassCastException:

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using NetBeans 6.9.1, PrimeFaces 2.2RC1, JSF2, whatever Glassfish that comes w/ 6.9.1.

I'm trying to get past this error and cannot figure it out despite multiple internet searches on the topic.

Below are the code samples:
JSF2:


ManagedBeanCode:


Error Message from the GlassFish server:


The web page shows 10 patients initially. Checking the server log, the 8772 patients are documented in the System.out.println (this is correct). This also is the first page w/ first = 0 and pagesize = 10. Error comes when I either click an entry or I click the next button on the paginator.

If I 'redeploy' the app w/o any changes, the server log shows the following error messages w/o my interacting w/ the app at all:


Any help/ideas would be appreciated. I've not been able to determine what is causing the null pointer exception that shows w/ redeployment...

Thanks in advance...
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The null pointer originates very likely from the fact that the first deployment did not manage to work without errors. One hint for that is in the error message itself "Unable to restore sessions for web module [/QIP1a.1] from previous deployment" which means that the error occurred when GlassFish is getting serialized data from the disk that it presumes is correctly saved and accessible.

The first exception on the other hand is not so clear. Maybe you use incompatible classes for the data. You can try to pin down where the error is by making the code simpler. First of all make the class @RequestScoped instead of @ViewScoped and remove the "implements Serializable". I am new to JSF but I have already found out that the @ViewScoped can be problematic. And remove all the unnecessary code from the xhtml page (including template using and so on).
 
reply
    Bookmark Topic Watch Topic
  • New Topic