Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Initialize HbEntityDataStory correctly with MetaModel(How to create and initialize the HbEntityDataStory correctly so that there is a valid MetaModel for making root entities for queries work.)
[Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1611325] Wed, 11 February 2015 09:43 Go to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hello everybody,

I am currently using Eclipse Teneo with Hibernate and a PostgreSQL to persist and query my Ecore model instances. This works fine as long as I am using the "old-style" Hibernate API with the HbDataStore, hibernate Session, etc.

Now, I would like to switch the implementation to the more general JPA EntityManager based API. For simple saving, deleting and querying, this also works fine after creating and initializing the EntityManager as follows:

entityDataStore = new HbEntityDataStore();
entityDataStore.setName( HIBERNATE_PERSISTENCE_DS2 );
entityDataStore.setEPackages( new EPackage[] { PersonPackage.eINSTANCE, DevicePackage.eINSTANCE, PatientPackage.eINSTANCE, UseraccountPackage.eINSTANCE } );
EntityManager em = entityDataStore.getEntityManagerFactory().createEntityManager();


However, as soon as I want to make more specific queries with an ordering (ORDER BY), I need to use the Query Root API:

final CriteriaBuilder cb = em.getCriteriaBuilder();
final CriteriaQuery<?> query = cb.createQuery( eClass.getInstanceClass() );
final Root<?> root = query.from( eClass.getInstanceClass() );


This fails as the last line causes a NullPointerException since the em.getMetamodel() is null.

What am I missing? How do I have to initialize the EntityManager, and the HbEntityDataStory correctly with my Ecore model?

Thanks for any hints.

Regards
Timo
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1611693 is a reply to message #1611325] Wed, 11 February 2015 14:57 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Timo,
Which version of Teneo are you using? This can be related to the rework I did to fit to the latest version. In that case
can you enter a bugzilla? I will solve issues next week.

gr. Martin

On 11-02-15 10:43, Timo Rohrberg wrote:
> Hello everybody,
>
> I am currently using Eclipse Teneo with Hibernate and a PostgreSQL to persist and query my Ecore model instances. This
> works fine as long as I am using the "old-style" Hibernate API with the HbDataStore, hibernate Session, etc.
>
> Now, I would like to switch the implementation to the more general JPA EntityManager based API. For simple saving,
> deleting and querying, this also works fine after creating and initializing the EntityManager as follows:
>
>
> entityDataStore = new HbEntityDataStore();
> entityDataStore.setName( HIBERNATE_PERSISTENCE_DS2 );
> entityDataStore.setEPackages( new EPackage[] { PersonPackage.eINSTANCE, DevicePackage.eINSTANCE,
> PatientPackage.eINSTANCE, UseraccountPackage.eINSTANCE } );
> EntityManager em = entityDataStore.getEntityManagerFactory().createEntityManager();
>
>
> However, as soon as I want to make more specific queries with an ordering (ORDER BY), I need to use the Query Root API:
>
>
> final CriteriaBuilder cb = em.getCriteriaBuilder();
> final CriteriaQuery<?> query = cb.createQuery( eClass.getInstanceClass() );
> final Root<?> root = query.from( eClass.getInstanceClass() );
>
>
> This fails as the last line causes a NullPointerException since the em.getMetamodel() is null.
>
> What am I missing? How do I have to initialize the EntityManager, and the HbEntityDataStory correctly with my Ecore model?
>
> Thanks for any hints.
>
> Regards
> Timo
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1611748 is a reply to message #1611693] Wed, 11 February 2015 15:44 Go to previous messageGo to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hi Martin,

thanks a lot for your quick reply. I'm currently using Teneo version 2.0.1.v201406151004 which seems to be the latest stable version. Can you tell me if this version is still affected from the pending changes? If yes, I can open a bug report tomorrow, if you wish.

Thanks again.

Regards
Timo
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1611786 is a reply to message #1611748] Wed, 11 February 2015 16:08 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Timo,
Okay not the 2.1.0 version. Can you enter a bugzilla for it? If you have time you can also debug and see what can be
changed, feel free to add your findings to the bugzilla!

gr. Martin

On 11-02-15 16:44, Timo Rohrberg wrote:
> Hi Martin,
>
> thanks a lot for your quick reply. I'm currently using Teneo version 2.0.1.v201406151004 which seems to be the latest
> stable version. Can you tell me if this version is still affected from the pending changes? If yes, I can open a bug
> report tomorrow, if you wish.
>
> Thanks again.
>
> Regards
> Timo


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1612786 is a reply to message #1611786] Thu, 12 February 2015 07:43 Go to previous messageGo to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hello Martin,

well, when I started the project, I tried to use the most recent version of Teneo - which was already version 2.1.0. Unfortunately by that time, I was unable to download that version as the link [1] was not reachable. For that, I used the older version from [2] which as available.

Before refactoring my code to use the JPA EntityManager based API now, I will probably switch to version 2.1.0 if you are not suggesting to stick with the older one. I will then see, what happens - maybe the problem is solved then.

Best regards.
Timo
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1612913 is a reply to message #1612786] Thu, 12 February 2015 09:26 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Timo,
Okay, I missed the links to which you refer, can you let me know if/which links are broken? Then I can repair them.

gr. Martin

On 12-02-15 08:43, Timo Rohrberg wrote:
> Hello Martin,
>
> well, when I started the project, I tried to use the most recent version of Teneo - which was already version 2.1.0.
> Unfortunately by that time, I was unable to download that version as the link [1] was not reachable. For that, I used
> the older version from [2] which as available.
>
> Before refactoring my code to use the JPA EntityManager based API now, I will probably switch to version 2.1.0 if you
> are not suggesting to stick with the older one. I will then see, what happens - maybe the problem is solved then.
>
> Best regards.
> Timo


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1613089 is a reply to message #1612913] Thu, 12 February 2015 11:54 Go to previous messageGo to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hello Martin,

yes, I forgot to add the links - I'm sorry. Here they are:

Version 2.0.1
http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/

Version 2.1.0 (this one was not working, but works now)
http://download.eclipse.org/modeling/emf/teneo/updates/2.1.0/interim/

As I said, we are going to try the new version and I'm reporting back if the problem still exists.

However, can you maybe tell me how to initalize the HbEntityDataStory correctly? Were the code snippets in my posting correct? Or am I missing something?

Cheers
Timo
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1613521 is a reply to message #1613089] Thu, 12 February 2015 18:21 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Timo,
Your code looks good, can you print the stacktrace here? To check the code path to the entity datestore/entity manager
factory.

gr. Martin

On 12-02-15 12:54, Timo Rohrberg wrote:
> Hello Martin,
>
> yes, I forgot to add the links - I'm sorry. Here they are:
>
> Version 2.0.1
> http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/
>
> Version 2.1.0 (this one was not working, but works now)
> http://download.eclipse.org/modeling/emf/teneo/updates/2.1.0/interim/
>
> As I said, we are going to try the new version and I'm reporting back if the problem still exists.
>
> However, can you maybe tell me how to initalize the HbEntityDataStory correctly? Were the code snippets in my posting
> correct? Or am I missing something?
>
> Cheers
> Timo


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1614396 is a reply to message #1613521] Fri, 13 February 2015 08:05 Go to previous messageGo to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hello Martin,

well, thanks for so much attention to that issue! Of course, I would really like to solve it and will try it again as soon as possible with the new version of Teneo. Up to now, I did not have the time yet.

Here is the stack trace of the NullPointerException thrown when executing

final CriteriaBuilder cb = em.getCriteriaBuilder();
final CriteriaQuery<?> query = cb.createQuery( eClass.getInstanceClass() );
final Root<?> root = query.from( eClass.getInstanceClass() );


with the old 2.0.1 version of Teneo:

java.lang.NullPointerException
	at org.hibernate.ejb.criteria.QueryStructure.from(QueryStructure.java:136)
	at org.hibernate.ejb.criteria.CriteriaQueryImpl.from(CriteriaQueryImpl.java:177)
	at de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.query(HibernatePersistenceService.java:78)
	at de.vitasystems.platform.services.persistence.hibernate.test.internal.HibernatePersistenceServiceUseraccountTest.readUseraccountsTest(HibernatePersistenceServiceUseraccountTest.java:115)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)


A quick debug into the QueryStructure class revealed that the EntityManagerFactory.getMetamodel() call returned null. And that's what triggered my question: How do I achive the meta-model to be correctly initialized within Teneo.

Thanks a lot for your help!

By the way: I do have some further questions about Teneo and best practices with it. Should I post them here, or would it be OK for you to have some eMail and/or even phone contact once?

Cheers
Timo
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1614403 is a reply to message #1614396] Fri, 13 February 2015 08:12 Go to previous messageGo to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hi Martin,

by the way, the download links of the Teneo version 2.1.0 are still not correct. On the website

http://download.eclipse.org/modeling/emf/teneo/updates/2.1.0/interim/

only the source plugins are available. The links to the binary bundles are dead.

Cheers
Timo
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1614644 is a reply to message #1614403] Fri, 13 February 2015 11:44 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Timo,
This is solved now, can you retry it for 2.1.0?

For other questions, it is best to ask them on the forum as others can then also find the answers. For more direct
support or consulting I am available commercially also. If you are interested in this you can contact me at:
mtaal_at_elver.org

For the metamodel generation there is this code in the HbEntityDataStore:
// set this as this gives errors in the hibernate entity manager
// see this bugzilla:
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330855
// Using HbEntityDataStore causes org.hibernate.MappingException:
// Unknown entity:...
if (!properties.containsKey("hibernate.ejb.metamodel.generation")) {
properties.setProperty("hibernate.ejb.metamodel.generation", "disabled");
}

so metamodel generation is disabled if not set otherwise.

But looking at your code snippet, I see that you build the criteria query using the eClass.getInstanceClass(). The EMF
-> Hibernate mapping uses the Impl class, while eClass.getInstanceClass() (I think) can return the interface class.

So instead of using eClass.getInstanceClass(), can you try using: ERuntime.INSTANCE.getJavaClass(eClass)

gr. Martin

On 13-02-15 09:12, Timo Rohrberg wrote:
> Hi Martin,
>
> by the way, the download links of the Teneo version 2.1.0 are still not correct. On the website
>
> http://download.eclipse.org/modeling/emf/teneo/updates/2.1.0/interim/
>
> only the source plugins are available. The links to the binary bundles are dead.
>
> Cheers
> Timo


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1614888 is a reply to message #1614644] Fri, 13 February 2015 15:12 Go to previous messageGo to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hi Martin,

ok, we tried the download of the 2.1.0 version. Unfortunately, our application does not work with that version anymore. It seems there are missing transitive dependencies of the hibernate context. When accessing our services which end up in the persistence service using the teneo/hibernate framework, the following stack trace is thrown:

2015-02-13 15:42:36.840:WARN:oejs.ServletHandler:ERROR:  /services/device
org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory
        at org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:256)
        at org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:238)
        at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:439)
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
        at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:360)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:370)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Unknown Source)
Caused by:
java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.privateGetMethodRecursive(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:124)
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:312)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930)
        at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSessionFactory(HbSessionDataStore.java:270)
        at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initialize(HbSessionDataStore.java:117)
        at de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.getDataStore(HibernatePersistenceService.java:183)
        at de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.getHibernateSession(HibernatePersistenceService.java:173)
        at de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.query(HibernatePersistenceService.java:70)
        at de.vitasystems.platform.services.rest.device.impl.internal.DeviceServiceImpl.read(DeviceServiceImpl.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103)
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
        at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:360)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:370)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Unknown Source)
Caused by:
java.lang.ClassNotFoundException: javax.validation.ValidatorFactory cannot be found by org.hibernate_4.3.7
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.privateGetMethodRecursive(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:124)
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:312)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930)
        at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSessionFactory(HbSessionDataStore.java:270)
        at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initialize(HbSessionDataStore.java:117)
        at de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.getDataStore(HibernatePersistenceService.java:183)
        at de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.getHibernateSession(HibernatePersistenceService.java:173)
        at de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.query(HibernatePersistenceService.java:70)
        at de.vitasystems.platform.services.rest.device.impl.internal.DeviceServiceImpl.read(DeviceServiceImpl.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103)
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
        at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:360)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:370)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Unknown Source)


I have to say that we did not analyze the problem in detail, but just switched back to version 2.0.1 of teneo as this worked without problems. Maybe you can figure if there's missing something in the dependencies of the teneo framework version 2.1.0.

Unfortunately, I did not yet have the time to check the JPA EntityManager based API again. Your hint with the implementation classes vs. interfaces of EMF sounds logical. I will try this with the old version of teneo.

Cheers
Timo
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1614960 is a reply to message #1614888] Fri, 13 February 2015 16:05 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Timo,
The testcases work fine without this class not found exception. So seems a different setup/environment thing.

The javax.validation.ValidatorFactory is part of the standard jdk afaik. Or not?

gr. Martin

On 13-02-15 16:12, Timo Rohrberg wrote:
> Hi Martin,
>
> ok, we tried the download of the 2.1.0 version. Unfortunately, our application does not work with that version anymore.
> It seems there are missing transitive dependencies of the hibernate context. When accessing our services which end up in
> the persistence service using the teneo/hibernate framework, the following stack trace is thrown:
>
>
> 2015-02-13 15:42:36.840:WARN:oejs.ServletHandler:ERROR: /services/device
> org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory
> at org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:256)
> at org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:238)
> at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:439)
> at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
> at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
> at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
> at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
> at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
> at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
> at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
> at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
> at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
> at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
> at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:360)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> at org.eclipse.jetty.server.Server.handle(Server.java:370)
> at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
> at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
> at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
> at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> at java.lang.Thread.run(Unknown Source)
> Caused by:
> java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory
> at java.lang.Class.getDeclaredMethods0(Native Method)
> at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> at java.lang.Class.privateGetMethodRecursive(Unknown Source)
> at java.lang.Class.getMethod0(Unknown Source)
> at java.lang.Class.getMethod(Unknown Source)
> at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:124)
> at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:312)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSessionFactory(HbSessionDataStore.java:270)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initialize(HbSessionDataStore.java:117)
> at
> de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.getDataStore(HibernatePersistenceService.java:183)
>
> at
> de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.getHibernateSession(HibernatePersistenceService.java:173)
>
> at
> de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.query(HibernatePersistenceService.java:70)
>
> at de.vitasystems.platform.services.rest.device.impl.internal.DeviceServiceImpl.read(DeviceServiceImpl.java:129)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
>
> at
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
>
> at
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
>
> at
> org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
>
> at
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
>
> at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387)
> at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331)
> at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103)
> at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271)
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
> at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
> at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
> at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
> at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
> at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
> at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
> at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
> at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
> at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
> at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:360)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> at org.eclipse.jetty.server.Server.handle(Server.java:370)
> at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
> at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
> at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
> at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> at java.lang.Thread.run(Unknown Source)
> Caused by:
> java.lang.ClassNotFoundException: javax.validation.ValidatorFactory cannot be found by org.hibernate_4.3.7
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
> at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.getDeclaredMethods0(Native Method)
> at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> at java.lang.Class.privateGetMethodRecursive(Unknown Source)
> at java.lang.Class.getMethod0(Unknown Source)
> at java.lang.Class.getMethod(Unknown Source)
> at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:124)
> at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:312)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSessionFactory(HbSessionDataStore.java:270)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initialize(HbSessionDataStore.java:117)
> at
> de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.getDataStore(HibernatePersistenceService.java:183)
>
> at
> de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.getHibernateSession(HibernatePersistenceService.java:173)
>
> at
> de.vitasystems.platform.services.persistence.hibernate.internal.HibernatePersistenceService.query(HibernatePersistenceService.java:70)
>
> at de.vitasystems.platform.services.rest.device.impl.internal.DeviceServiceImpl.read(DeviceServiceImpl.java:129)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
>
> at
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
>
> at
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
>
> at
> org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
>
> at
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
>
> at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387)
> at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331)
> at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103)
> at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271)
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
> at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
> at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
> at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
> at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
> at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
> at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
> at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
> at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
> at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
> at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:360)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> at org.eclipse.jetty.server.Server.handle(Server.java:370)
> at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
> at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
> at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
> at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> at java.lang.Thread.run(Unknown Source)
>
>
> I have to say that we did not analyze the problem in detail, but just switched back to version 2.0.1 of teneo as this
> worked without problems. Maybe you can figure if there's missing something in the dependencies of the teneo framework
> version 2.1.0.
>
> Unfortunately, I did not yet have the time to check the JPA EntityManager based API again. Your hint with the
> implementation classes vs. interfaces of EMF sounds logical. I will try this with the old version of teneo.
>
> Cheers
> Timo


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1620466 is a reply to message #1614960] Tue, 17 February 2015 07:54 Go to previous messageGo to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hello Martin,

thanks again for your answer. As far as we could analyze the problem, you're right: The javax.validation.ValidatorFactory is part of the JDK's javax stuff. But it seemed that this only applies to an interface for which we were missing a valid implementation. However, if the testcases work on your side, we probably had another problem here.

Due to timing issues, we reverted everything back to Teneo version 2.0.1 which worked for us so far. However, we are going to try the upgrade again as we definitely want the new version - and especially - the newer version of the hibernate dependencies. I'll come back to you, once we tried it again.

Thanks a lot for your help so far. Maybe, you can check my other questions in this forum as well Wink.

Cheers
Timo
Re: [Teneo] Initialize HbEntityDataStory correctly with MetaModel [message #1623753 is a reply to message #1620466] Thu, 19 February 2015 09:56 Go to previous message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hello Martin,

in the meantime we did further analyze the problem with the missing dependency. The only thing missing was the package javax.validation and we resolved that dependency by including the following Maven artifact:

<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>


I attached the plugin downloaded from Maven Central and the feature that we built ourselves to this message.

Maybe you can include this artifact into the download of the teneo dependencies?

Thanks again for your help.

Regards
Timo

[Updated on: Thu, 19 February 2015 11:22]

Report message to a moderator

Previous Topic:[TEXO] Mapped superclass in a containment relation
Next Topic:[Texo] generation IllegalStateException
Goto Forum:
  


Current Time: Thu Mar 28 22:14:43 GMT 2024

Powered by FUDForum. Page generated in 0.02963 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top