tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: ClassCastException In Tomee/Hibernate
Date Mon, 02 Jul 2012 16:26:50 GMT
Hmm, let me guess, hibernate is in lib/?

maybe add openejb-jpa-integration in lib.

If it doesn't work i think you'll need to implement (copy ;)) your own
JtaPltaform.

- Romain


2012/7/2 cri_sys <serjec@gmail.com>

> Hello,
>
> I  have been dealing with some problems in the Hibernate/Tomee
> implementation.
> i configured and copied all the hibernate libs as it says in,
> http://openejb.apache.org/tomee-and-hibernate.html. But still with no
> success.
> I am getting:
> org.apache.openejb.OpenEJBException: Creating application failed:
>
> C:\Users\cserje\Cristian\Documents\Personal\Polyglong\polyglong\target\polyglong-1.0-SNAPSHOT:
> java.util.concurrent.ExecutionException:
> javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable to
> build EntityManagerFactory: javax.persistence.PersistenceException:
> [PersistenceUnit: PolyPU] Unable to build EntityManagerFactory
>         at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:909)
>         at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:506)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:634)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:588)
>         at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:117)
>         at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>         at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>         at
>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at
>
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
>         at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
>         at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
>         at
>
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
>         at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:530)
>         at
> org.apache.catalina.startup.HostConfig.check(HostConfig.java:1471)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
>
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
>         at
>
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
>         at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
>         at
> org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)
>         at
> org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:856)
>         at
> org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:353)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>         at
>
> org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>         at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
>         at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
>         at
> org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
>         at
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
>         at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
>         at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
>         at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>         at
>
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
>         at
>
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
>         at
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.openejb.OpenEJBException:
> java.util.concurrent.ExecutionException:
> javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable to
> build EntityManagerFactory: javax.persistence.PersistenceException:
> [PersistenceUnit: PolyPU] Unable to build EntityManagerFactory
>         at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:635)
>         ... 46 more
> Caused by: java.util.concurrent.ExecutionException:
> javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable to
> build EntityManagerFactory
>         at
> java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
>         at java.util.concurrent.FutureTask.get(FutureTask.java:91)
>         at
>
> org.apache.openejb.assembler.classic.PersistenceBuilder.createEmf(PersistenceBuilder.java:169)
>         at
>
> org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:150)
>         at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:629)
>         ... 46 more
> Caused by: javax.persistence.PersistenceException: [PersistenceUnit:
> PolyPU]
> Unable to build EntityManagerFactory
>         at
>
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915)
>         at
>
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
>         at
>
> org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
>         at
>
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:45)
>         at
>
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:27)
>         at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>         ... 3 more
> Caused by: org.hibernate.service.spi.ServiceException: Unable to create
> requested service [org.hibernate.service.jta.platform.spi.JtaPlatform]
>         at
>
> org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:186)
>         at
>
> org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:150)
>         at
>
> org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
>         at
> org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:96)
>         at
>
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2277)
>         at
> org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2273)
>         at
>
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1742)
>         at
>
> org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
>         at
>
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
>         ... 9 more
> Caused by: org.hibernate.HibernateException: Unable to create specified
> JtaPlatform class [org.apache.openejb.hibernate.OpenEJBJtaPlatform]
>         at
>
> org.hibernate.service.jta.platform.internal.JtaPlatformInitiator.initiateService(JtaPlatformInitiator.java:89)
>         at
>
> org.hibernate.service.jta.platform.internal.JtaPlatformInitiator.initiateService(JtaPlatformInitiator.java:47)
>         at
>
> org.hibernate.service.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:69)
>         at
>
> org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176)
>         ... 17 more
> Caused by: java.lang.ClassCastException:
> org.apache.openejb.hibernate.OpenEJBJtaPlatform cannot be cast to
> org.hibernate.service.jta.platform.spi.JtaPlatform
>         at
>
> org.hibernate.service.jta.platform.internal.JtaPlatformInitiator.initiateService(JtaPlatformInitiator.java:86)
>         ... 20 more
>
>
> When i tested in a my Unittest everything works fine, but it just happen
> when i want to deploy my ear.
>
> Any suggestion?
>
> Thanks in advance.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/ClassCastException-In-Tomee-Hibernate-tp4655957.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message