Search code examples
hibernateexceptionstruts2java-6

Exception in login application


I am new to Struts and hibernate. For understanding it i tried doing a login application. I use Struts 2, Hibernate 3.2.5, Java 6, Tomcat 6, in netbeans IDE 7.1.2. I am getting an exception like

Exception

java.lang.reflect.InvocationTargetException

root cause: java.lang.NoClassDefFoundError: Could not initialize class hibernateutilities.HibernateUtil

Server log

Initial SessionFactory creation failed.java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter

I am getting this exception when executing

SessionFactory sessionFactory = HibernateUtil.getSessionFactory();

If anyone want more details please specify.


Solution

  • As per my understanding with the error, You have asm version that is incompatible with your Hibernate version.

    It's hard to tell at this time the exact matching version so i believe my best bet will be to take help of maven and let maven do this in correct way for me,

    other way is to look hibernate-core for dependencies and its version