• 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
  • 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

java.lang.ClassNotFoundException for my generic DAO

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I create a generic DataAccessObject and try to save a data in my database

HibernateDAO.java


I use JSF and Hibernate in my application.

This code works perfect when i call him inside netbeans like a desktop app



but when i try to use him inside a JSF app, he give me a error



this is the ManagedBean that i use to save data through xhtml file

GravaCidade.java


why this don't work in JSF app?

cadastro_cidade.xhtml
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So your error message is "java.lang.NoClassDefFoundError: br/salesianos/dao/HibernateDAO"
It works for your stand-alone application, but not for your web application.

Have you added this class into the classpath for your web application?
Classpath for a web application means the WEB-INF/classes folder and jar files in the WEB-INF/lib folder.

I think the only thing you are missing is to tell NetBeans that your web application wants to use this code.
I don't know much about Netbeans, but presume you already have a "web" project that runs a web server through netbeans? Or are you deploying externally somewhere?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic