-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: java.lang.ClassNotFoundException: javax.persistence.Entity
PostPosted: Mon Dec 20, 2010 6:28 pm 
Newbie

Joined: Mon Dec 20, 2010 6:21 pm
Posts: 5
Hello.
I have in my pom.xml:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.0.Final</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.0.Final</version>
</dependency>

and in spring-context.xml:

<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
<property name="url" value="jdbc:hsqldb:mem:jsf2demo"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="annotatedClasses">
<list>
<value>com.maxheapsize.jsf2demo.Book</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.HSQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
</props>
</property>
</bean>


but i get the exception:

Caused by: java.lang.ClassNotFoundException: javax.persistence.Entity
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1671)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
... 41 more


Please help!


Top
 Profile  
 
 Post subject: Re: java.lang.ClassNotFoundException: javax.persistence.Entity
PostPosted: Mon Dec 20, 2010 6:33 pm 
Newbie

Joined: Mon Dec 20, 2010 6:21 pm
Posts: 5
I'm sorry, i wasn't forwarded to next page when posting so it got posted several times.
The other 2 identical posts can be removed.


Top
 Profile  
 
 Post subject: Re: java.lang.ClassNotFoundException: javax.persistence.Entity
PostPosted: Tue Dec 21, 2010 6:42 am 
Beginner
Beginner

Joined: Tue Dec 21, 2010 5:26 am
Posts: 25
Hi. Do you have the .jar containing the Class Entity.class?
For me, it's in the ejb3-persistence.jar

Hope that helps.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.