org.hibernate.MappingException: Unable to load class declared as <mapping class="org.appfuse.model.User"/> in the configuration:

tip

You might've forgot to add a dependency or it's written wrong. Also, you might be using incompatible versions of Java and Hibernate. More on this here: https://goo.gl/SjSlRA

tip

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.

tip

This error means there's a class missing in your classpath during runtime. You need to create a jar with all your dependencies and have it in your classpath. Check Maven Assembly Plugin and how to add your dependencies to a jar: https://goo.gl/U2zr8k

tip

jsp-api and servlet-api jars must NOT be deployed by your web app. They should be marked as provided but not deployed by your app.

tip

The server rejects all jars that already belong to the server runtime (such as tomcat-**.jar, servlet**.jar). Consider substituting the CORS filter you're using for this one: https://goo.gl/ctQ7Fs

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • I started with a "vanilla" AppFuse 2.0-M5 (Spring-MVC modular), where "mvn site" works as expected. I then checked out the core classes as described in the Wiki (http://appfuse.org/display/APF/AppFuse+Core+Classes) and left them unchanged. After that I ran the following commands on the root pom in this order: mvn clean mvn install mvn site mvn site -Dmaven.test.skip=true Both of the site tasks failed with the same error message quoted below: --- SNIP --- [INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Unable to load class declared as <mapping class="org.appfuse.model.User"/> in the configuration: [INFO] ------------------------------------------------------------------------ [INFO] Trace org.hibernate.MappingException: Unable to load class declared as <mapping class="org.appfuse.model.User"/> in the configuration: at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:545) [...] Caused by: java.lang.ClassNotFoundException: org.appfuse.model.User at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [...] --- SNAP --- Seems like there's something missing in the maven.test.classpath. ------------------------------------------------------------- Workaround by Matt: Adding <skip>${maven.test.skip}</skip> to the "componentProperties" section of the hibernate3 plugin, allows the 2nd command to work.
    via by Tobias Vogel,
  • Groovy Web Service (Geertjan's Blog)
    via by Unknown author,
  • connection 1 « mysql « Java Database Q&A
    via by Unknown author,
    • org.hibernate.MappingException: Unable to load class declared as <mapping class="org.appfuse.model.User"/> in the configuration: at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:545)[...] Caused by: java.lang.ClassNotFoundException: org.appfuse.model.User at java.net.URLClassLoader$1.run(URLClassLoader.java:200)[...]

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    davidvanlaatum
    davidvanlaatum1 times, last one,
    1189 more bugmates