Project

General

Profile

Problem creating modified auth1 example project

Added by Uldis Kalniņš about 10 years ago

I'm trying to write my first project webpage with jwt. As I need authentication, I'm trying to adapt auth1 example.

I got to the point where the Persistence.createEntityManagerFactory(..) is called.

At that point I get the following :

_

Feb 04, 2014 2:41:46 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000115: Hibernate connection pool size: 20 (min=1)

Feb 04, 2014 2:41:47 PM org.hibernate.dialect.Dialect

INFO: HHH000400: Using dialect: org.hibernate.dialect.H2Dialect

Exception in thread "qtp886256583-17" java.lang.ExceptionInInitializerError

at obemanager.MainWindow.(MainWindow.java:15)

at obemanager.ObeApp.createApplication(ObeApp.java:15)

at eu.webtoolkit.jwt.WtServlet.doCreateApplication(WtServlet.java:288)

at eu.webtoolkit.jwt.WebSession.start(WebSession.java:2054)

at eu.webtoolkit.jwt.WebSession.handleRequest(WebSession.java:1455)

at eu.webtoolkit.jwt.WtServlet.doHandleRequest(WtServlet.java:351)

at eu.webtoolkit.jwt.ServletApi.handleRequest(ServletApi.java:27)

at eu.webtoolkit.jwt.ServletApi3$1.run(ServletApi3.java:94)

at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1119)

at org.eclipse.jetty.server.AsyncContinuation$1.run(AsyncContinuation.java:875)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)

at java.lang.Thread.run(Thread.java:744)

Caused by: javax.persistence.PersistenceException: Unable to build entity manager factory

at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:81)

at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)

at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)

at obemanager.JpaUtil.(JpaUtil.java:15)

... 13 more

Caused by: java.lang.RuntimeException: Trying to instanciate interface javax.persistence.Table with unknown elements

at org.hibernate.annotations.common.annotationfactory.AnnotationProxy.getAnnotationValues(AnnotationProxy.java:88)

at org.hibernate.annotations.common.annotationfactory.AnnotationProxy.(AnnotationProxy.java:69)

at org.hibernate.annotations.common.annotationfactory.AnnotationFactory.create(AnnotationFactory.java:47)

at org.hibernate.cfg.annotations.reflection.JPAOverriddenAnnotationReader.getTable(JPAOverriddenAnnotationReader.java:2772)

at org.hibernate.cfg.annotations.reflection.JPAOverriddenAnnotationReader.initAnnotations(JPAOverriddenAnnotationReader.java:357)

at org.hibernate.cfg.annotations.reflection.JPAOverriddenAnnotationReader.isAnnotationPresent(JPAOverriddenAnnotationReader.java:326)

at org.hibernate.annotations.common.reflection.java.JavaXAnnotatedElement.isAnnotationPresent(JavaXAnnotatedElement.java:60)

at org.hibernate.cfg.Configuration$MetadataSourceQueue.syncAnnotatedClasses(Configuration.java:3725)

at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1409)

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:399)

at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)

at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:73)

... 16 more

_

By trial and error I noticed, that this is caused by orm.xml file, where by removing all

lines, the error goes away . I think, I'm missing something simple, but I have been fighting with this error all day and got nowhere ..

Has anybody any ideas, whats not happening?


Replies (2)

RE: Problem creating modified auth1 example project - Added by Uldis Kalniņš about 10 years ago

As soon as I started crying in the internet the problem vanished. I think I had some version mismatch in jars.

RE: Problem creating modified auth1 example project - Added by Koen Deforche about 10 years ago

Hey,

You'll probably learn that build system fails and library version issues are all too common in java.

As well as stack-traces involving lots of factories and other (redundant) abstraction layers that make them quite unhelpful.

Regards,

koen

    (1-2/2)