views:

258

answers:

2

Hello,

This error is a nightmare, I have not been able to figure out why Hibernate libraries are not loaded into the classpath during the deploy onto the webserver( eclipse integrated Jetty server, bundled with GWT).I see that hibernate-jpa-2.0-api-1.0.0.Final.jar being added to the web app classpath at deploy time.But, still it is not resolved for some reason.The same code, works fine as a normal java application ( the server side entities i.e); If used from the GWT it throws up.

Do i need an upgrade (eclipse 3.5 with latest updates, I dont seem to get any new versions from Google on this) ? Does this version of the webserver (Jetty) have no support for JPA2 ? Can anyone guide me on this please.

Thanks in advance.

Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1837)
at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:769)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:733)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:636)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:359)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1377)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at com.examples.helloajax.server.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:29)
... 28 more
A: 

Check out this question (and answer).

dagge
A: 

If hibernate boots on the servlet contextInitialized event, I do not see this error !! I don't seem to understand the reason behind this.But it works

panzerschreck