-->
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: Error in simple example - JAVA and WEB
PostPosted: Tue Apr 01, 2014 9:39 am 
Newbie

Joined: Tue Apr 01, 2014 9:34 am
Posts: 2
I made an example. Work fine when I run as Java. Same code, in web application get error

Code:
Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
   at org.hibernate.cfg.AnnotationBinder.bindManyToOne(AnnotationBinder.java:2881)
   at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1795)
   at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:963)
   at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:796)
   at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3790)
   at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3744)
   at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1410)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844)
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
   at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397)
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
   at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:73)
   at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
   at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
   at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
   at net.roseindia.AppTest.main(AppTest.java:27)


What I'm doing wrong?


Top
 Profile  
 
 Post subject: Re: Error in simple example - JAVA and WEB
PostPosted: Thu Apr 03, 2014 4:43 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
I would guess that the web application is using a different JPA version.

Could you give us more details about the dependencies in the classpath and the container you are using?


Top
 Profile  
 
 Post subject: Re: Error in simple example - JAVA and WEB
PostPosted: Thu Apr 03, 2014 9:42 am 
Newbie

Joined: Tue Apr 01, 2014 9:34 am
Posts: 2
davided80 wrote:
Hi,
I would guess that the web application is using a different JPA version.

Could you give us more details about the dependencies in the classpath and the container you are using?


Hi Davided80, tks for you help.

I use this one
-> antlr-2.7.7.jar
-> dom4j-1.6.1.jar
-> hibernate-commons-annotation-4.0.4.FINAL.jar
-> hibernate-core-4.3.4.Final.jar
-> hibernate-entitymenager-4.3.4.jar
-> hibernate-jpa-2.1-api-1.0.0.Final.jar
-> jandex-1.1.0.Final.jar
-> javassist-3.18.1-GA.jar
-> jboss-loggin-3.1.3.GA.jar
-> jboss.-logging-annotation-1.2.0.Beta1.jar
-> jboss-transaction-api_1.2_spec-1.0.0.Final.jar
-> mysql-connector-java-5.1.18-bin.jar

and JBoss 7.0


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.