• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.ClassNotFoundException: org.hibernate.HibernateException

 
Ravinder Dhadrall
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi-ya,

I am creating a web application to display forms and store the information in a MySQL database via hibernate. The error I am getting is probably a noddy one but I have looked at the posts for this none have help. Been trying for days to work out what is wrong.

I run a JSP page (CreditTpeEdit.jsp). it’s a form allows me to enter a credit type. This is then posted to a servlet com.lazygym.transaction.servlet.CreditTypeEditServlet, where the error occurs.

I am running it on tomcat 7 server via eclipse.

The jars that I have included in the build path are :

  • antlr-2.7.7.jar
    classmate-0.5.4.jar
    commons-collections-3.2.1.jar
    dom4j-1.6.1.jar
    hibernate-commons-annotations-4.0.1.Final.jar
    hibernate-core-4.0.0.Final.jar
    hibernate-jpa-2.0-api-1.0.1.Final.jar
    jandex-1.0.3.Final.jar
    javassist-3.12.1.GA.jar
    jboss-logging-3.1.0.CR2.jar
    jboss-transaction-api_1.1_spec-1.0.0.Final.jar
    hibernate-c3p0-4.0.0.Final.jar
    hibernate-entitymanager-4.0.0.Final.jar
    log4j-1.2.16.jar
    ehcache-core-2.4.3.jar
    jstl-1.2.jar



  • I have also place a copy of
    <CATALINA_HOME>\lib\mysql-connector-java-5.0.8-bin.jar

    Browser ERROR





    web.xml





    hibernate.cfg.xml - This under main src directory in eclipse




    /WEB-INF/jsp/credittype/CreitTypeEdit.jsp


    com.lazygym.transaction.servlet.CreditTypeEditServlet

    Please note that I have commented out the top doGet and doPost just to make the code simplier for me while locating the problem.




    com.lazygym.util.HibernateUtil


     
    Bharat Kasodariya
    Ranch Hand
    Posts: 36
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    are those jars in classpath? you can check it from eclipse run config.
     
    Ravinder Dhadrall
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I right click on project -> Run as -> Run Configurations -> under the tomcat instance I have added all the jars.

    Still sam issue.

    Go to project right click -> properties -> under Libraries tab

    Made sure all jars are listed.

    Still same issue.
     
    Ravinder Dhadrall
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I have managed to get it working. It must be something to do with the classpath entry but not sure what. What I did was to install new JUNO eclipse version and that had a classpath error. Used quick fix on it and the applicaiton worked ok.

    Thankyou
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic