I am stuck with this exception and I can’t seem to get around. How to rid this off? Here it is.
java.lang.NoClassDefFoundError: myBlog/DAOImpls/DAOImplMan
at myBlog.Handlers.HandlerMan.saveComment(HandlerMan.java:34)
at myBlog.Services.ServiceMan.saveComments(ServiceMan.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
In the HandlerMan class i have this method which calls for an instance of DAOImplMan class
public Comment saveComment(Comment comment){
DAOImplMan.getInstance().saveComment(comment);
return comment;
}
and the DAOImplMan class is like this.
package myBlog.DAOImpls;
public class DAOImplMan extends BaseDAOHibernateImpl implements DAOMan{
private static DAOImplMan INSTANCE = null;
public static DAOImplMan getInstance(){
if(INSTANCE == null){
INSTANCE = new DAOImplMan();
}
return INSTANCE;
}
@Override
public void saveComment(Comment comment){//some codes}
I have looked at other posts that deals with this kind of exception. My classpaths are set right. and I actually don’t have this kind of exception in my other projects. And I can’t dig any further on my own.
Remove all of your project .class files and redeploy again. Check this is location of class file in your project.