Question

I am using hibernate 3.6, normally annotation comes in 3.6 but i am getting an error

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
        <property name="hibernate.connection.url">jdbc:postgresql://localhost/postgres</property>
        <property name="hibernate.connection.username">postgres</property>
        <property name="hibernate.connection.password">noor</property>
        <property name="hibernate.connection.pool_size">10</property>
        <property name="show_sql">false</property>
        <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
        <property name="hibernate.hbm2ddl.auto">update</property>
        <property name="current_session_context_class">thread</property> 

        <mapping resource="com/BiddingSystem/Models/Users.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/ForumTopic.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/ForumMessage.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/Administrator.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/PersonalUser.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/BusinessUser.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/BusinessContactNumbers.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/Attribute.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/AttributeOption.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/Category.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/Item.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/Auction.hbm.xml"/>
        <mapping resource="com/BiddingSystem/Models/Picture.hbm.xml"/>

    </session-factory>
</hibernate-configuration>

I am getting the following error

java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ReflectionManager
    at com.BiddingSystem.server.ServiceImpl.<init>(ServiceImpl.java:63)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
    at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.ReflectionManager
    at java.lang.ClassLoader.findClass(ClassLoader.java:359)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:352)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
    ... 26 more
Was it helpful?

Solution

You need hibernate-commons-annotations.jar in your class path version of it you will have to decide by your self by this compatibility matrix

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top