Error when using EH Cache with Hibernate

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Error when using EH Cache with Hibernate

cri_sys
This post was updated on .
I have tried everything to make ehcache work together with hibernate without success.
I am getting the error:
"Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given"

Off course i have added the hibernate.cache.region.factory_class already on my persistence.xml file but i still the same error is prompting.
here are my dependencies of my pom.xml:
      <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-ehcache</artifactId>
            <version>4.2.21.Final</version>
        </dependency>
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache-core</artifactId>
            <version>2.4.3</version>
        </dependency>
<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.2.21.Final</version>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate.javax.persistence</groupId>
                    <artifactId>hibernate-jpa-2.0-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.spec.javax.transaction</groupId>
                    <artifactId>jboss-transaction-api_1.1_spec</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>javassist</artifactId>
                    <groupId>org.javassist</groupId>
                </exclusion>
            </exclusions>
        </dependency>

Here my persistence.xml hibernate configurations configurations:

      <property name="hibernate.cache.use_second_level_cache" value="true"/>
     
     
     
      <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/>
     
      <property name="hibernate.cache.use_query_cache" value="true"/>


and finally the whole stacktrace:

org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/project]] in state [STARTING_PREP]
        at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:401)
        at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:291)
        at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1038)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1537)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1518)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(TomcatWebAppBuilder.java:762)
        at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:1982)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:839)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(TomcatWebAppBuilder.java:663)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(TomcatWebAppBuilder.java:622)
        at org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(TomcatWebappDeployer.java:43)
        at org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:176)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(InternalSecurityInterceptor.java:35)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
        at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
        at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:227)
        at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:194)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:181)
        at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:344)
        at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:240)
        at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:104)
        at org.apache.openejb.server.httpd.ServerServlet.service(ServerServlet.java:58)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
        at org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(CrawlerSessionManagerValve.java:180)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

Apr 18, 2017 3:40:25 PM org.apache.tomee.catalina.TomcatWebAppBuilder startInternal
SCHWERWIEGEND: Unable to deploy collapsed ear in war StandardEngine[Catalina].StandardHost[localhost].StandardContext[/project]
org.apache.openejb.OpenEJBException: Creating application failed: /Users/user/workspace/personal/web/project-core/project-frontend/target/polyglong-1.0-SNAPSHOT: org.apache.openejb.OpenEJBRuntimeException: 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:843)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(TomcatWebAppBuilder.java:663)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(TomcatWebAppBuilder.java:622)
        at org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(TomcatWebappDeployer.java:43)
        at org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:176)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(InternalSecurityInterceptor.java:35)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
        at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
        at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:227)
        at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:194)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:181)
        at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:344)
        at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:240)
        at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:104)
        at org.apache.openejb.server.httpd.ServerServlet.service(ServerServlet.java:58)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
        at org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(CrawlerSessionManagerValve.java:180)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.openejb.OpenEJBException: org.apache.openejb.OpenEJBRuntimeException: 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.loadPersistenceUnits(Assembler.java:988)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:741)
        ... 64 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable to build EntityManagerFactory
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:118)
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:102)
        at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:154)
        at org.apache.openejb.assembler.classic.Assembler.loadPersistenceUnits(Assembler.java:982)
        ... 65 more
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable to build EntityManagerFactory
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:925)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:900)
        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:76)
        at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:64)
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:116)
        ... 68 more
Caused by: org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given, please either disable second level cache or set correct region factory class name to property hibernate.cache.region.factory_class (and make sure the second level cache provider, hibernate-infinispan, for example, is available in the classpath).
        at org.hibernate.cache.internal.NoCachingRegionFactory.buildEntityRegion(NoCachingRegionFactory.java:69)
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:352)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1799)
        at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915)
        ... 72 more

Apr 18, 2017 3:40:25 PM org.apache.catalina.core.ContainerBase addChildInternal
SCHWERWIEGEND: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/project]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(TomcatWebAppBuilder.java:663)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(TomcatWebAppBuilder.java:622)
        at org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(TomcatWebappDeployer.java:43)
        at org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:176)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(InternalSecurityInterceptor.java:35)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
        at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
        at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:227)
        at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:194)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:181)
        at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:344)
        at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:240)
        at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:104)
        at org.apache.openejb.server.httpd.ServerServlet.service(ServerServlet.java:58)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
        at org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(CrawlerSessionManagerValve.java:180)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Creating application failed: /Users/user/workspace/personal/web/project-core/project-frontend/target/polyglong-1.0-SNAPSHOT: org.apache.openejb.OpenEJBRuntimeException: javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable to build EntityManagerFactory: javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable to build EntityManagerFactory
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1270)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        ... 56 more
Caused by: org.apache.openejb.OpenEJBException: Creating application failed: /Users/user/workspace/personal/web/project-core/project-frontend/target/polyglong-1.0-SNAPSHOT: org.apache.openejb.OpenEJBRuntimeException: 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:843)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
        ... 62 more
Caused by: org.apache.openejb.OpenEJBException: org.apache.openejb.OpenEJBRuntimeException: 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.loadPersistenceUnits(Assembler.java:988)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:741)
        ... 64 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable to build EntityManagerFactory
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:118)
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:102)
        at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:154)
        at org.apache.openejb.assembler.classic.Assembler.loadPersistenceUnits(Assembler.java:982)
        ... 65 more
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable to build EntityManagerFactory
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:925)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:900)
        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:76)
        at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:64)
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:116)
        ... 68 more
Caused by: org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given, please either disable second level cache or set correct region factory class name to property hibernate.cache.region.factory_class (and make sure the second level cache provider, hibernate-infinispan, for example, is available in the classpath).
        at org.hibernate.cache.internal.NoCachingRegionFactory.buildEntityRegion(NoCachingRegionFactory.java:69)
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:352)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1799)
        at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915)
        ... 72 more

Apr 18, 2017 3:40:25 PM org.apache.openejb.core.transaction.EjbTransactionUtil handleSystemException
SCHWERWIEGEND: EjbTransactionUtil.handleSystemException: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/project]]
org.apache.openejb.OpenEJBRuntimeException: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/project]]
        at org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(TomcatWebappDeployer.java:45)
        at org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:176)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(InternalSecurityInterceptor.java:35)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
        at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100)
        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:498)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
        at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
        at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
        at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:227)
        at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:194)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370)
        at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:181)
        at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:344)
        at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:240)
        at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:104)
        at org.apache.openejb.server.httpd.ServerServlet.service(ServerServlet.java:58)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
        at org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(CrawlerSessionManagerValve.java:180)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/project]]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:903)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(TomcatWebAppBuilder.java:663)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(TomcatWebAppBuilder.java:622)
        at org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(TomcatWebappDeployer.java:43)
        ... 50 more
Reply | Threaded
Open this post in threaded view
|

Re: Error when using EH Cache with Hibernate

Romain Manni-Bucau
Hi

if you use plus distribution maybe check you dont get a conflict with the
ehcache of the server (tomee/lib), if not then  or ppackaging is not be
right I think.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-18 15:35 GMT+02:00 cri_sys <[hidden email]>:

> I have tried everything to make ehcache work together with hibernate
> without
> success.
> I am getting the error:
> "Second-level cache is used in the application, but property
> hibernate.cache.region.factory_class is not given"
>
> Off course i have added the hibernate.cache.region.factory_class already
> on
> my persistence.xml file but i still the same error is prompting.
> here are my dependencies of my pom.xml:
>       <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-ehcache</artifactId>
>             <version>4.2.21.Final</version>
>         </dependency>
>         <dependency>
>             <groupId>net.sf.ehcache</groupId>
>             <artifactId>ehcache-core</artifactId>
>             <version>2.4.3</version>
>         </dependency>
> <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-entitymanager</artifactId>
>             <version>4.2.21.Final</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>org.hibernate.javax.persistence</groupId>
>                     <artifactId>hibernate-jpa-2.0-api</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>org.jboss.spec.javax.transaction</groupId>
>                     <artifactId>jboss-transaction-
> api_1.1_spec</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <artifactId>javassist</artifactId>
>                     <groupId>org.javassist</groupId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>
> Here my persistence.xml hibernate configurations configurations:
>
>       <property name="hibernate.cache.use_second_level_cache"
> value="true"/>
>
>
>
>       <property name="hibernate.cache.region.factory_class"
> value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/>
>
>       <property name="hibernate.cache.use_query_cache" value="true"/>
>
>
> and finally the whole stacktrace:
>
> org.apache.catalina.LifecycleException: An invalid Lifecycle transition
> was
> attempted ([before_destroy]) for component
> [StandardEngine[Catalina].StandardHost[localhost].
> StandardContext[/glossong]]
> in state [STARTING_PREP]
>         at
> org.apache.catalina.util.LifecycleBase.invalidTransition(
> LifecycleBase.java:401)
>         at org.apache.catalina.util.LifecycleBase.destroy(
> LifecycleBase.java:291)
>         at
> org.apache.catalina.core.ContainerBase.removeChild(
> ContainerBase.java:1038)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(
> TomcatWebAppBuilder.java:1537)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(
> TomcatWebAppBuilder.java:1518)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(
> TomcatWebAppBuilder.java:762)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> destroyApplication(Assembler.java:1982)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:839)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:677)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(
> TomcatWebAppBuilder.java:1261)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(
> TomcatWebAppBuilder.java:1100)
>         at
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(
> GlobalListenerSupport.java:130)
>         at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
> LifecycleSupport.java:117)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> LifecycleBase.java:90)
>         at
> org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5472)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:147)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(
> ContainerBase.java:899)
>         at org.apache.catalina.core.ContainerBase.addChild(
> ContainerBase.java:875)
>         at org.apache.catalina.core.StandardHost.addChild(
> StandardHost.java:652)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(
> TomcatWebAppBuilder.java:663)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(
> TomcatWebAppBuilder.java:622)
>         at
> org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(
> TomcatWebappDeployer.java:43)
>         at org.apache.openejb.assembler.DeployerEjb.deploy(
> DeployerEjb.java:176)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(
> InternalSecurityInterceptor.java:35)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.record(
> StatsInterceptor.java:181)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.invoke(
> StatsInterceptor.java:100)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.core.interceptor.InterceptorStack.
> invoke(InterceptorStack.java:85)
>         at
> org.apache.openejb.core.stateless.StatelessContainer._
> invoke(StatelessContainer.java:227)
>         at
> org.apache.openejb.core.stateless.StatelessContainer.
> invoke(StatelessContainer.java:194)
>         at
> org.apache.openejb.server.ejbd.EjbRequestHandler.
> doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370)
>         at
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(
> EjbRequestHandler.java:181)
>         at
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.
> java:344)
>         at org.apache.openejb.server.ejbd.EjbDaemon.service(
> EjbDaemon.java:240)
>         at org.apache.openejb.server.ejbd.EjbServer.service(
> EjbServer.java:104)
>         at
> org.apache.openejb.server.httpd.ServerServlet.service(
> ServerServlet.java:58)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:303)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:220)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:122)
>         at org.apache.tomee.catalina.OpenEJBValve.invoke(
> OpenEJBValve.java:44)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:169)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:103)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
>         at
> org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(
> CrawlerSessionManagerValve.java:180)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:116)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:436)
>         at
> org.apache.coyote.http11.AbstractHttp11Processor.process(
> AbstractHttp11Processor.java:1078)
>         at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
> process(AbstractProtocol.java:625)
>         at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.
> run(JIoEndpoint.java:318)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
>         at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
> TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:745)
>
> Apr 18, 2017 3:40:25 PM org.apache.tomee.catalina.TomcatWebAppBuilder
> startInternal
> SCHWERWIEGEND: Unable to deploy collapsed ear in war
> StandardEngine[Catalina].StandardHost[localhost].
> StandardContext[/glossong]
> org.apache.openejb.OpenEJBException: Creating application failed:
> /Users/cristian.serje/workspace/personal/web/glossong-core/glossong-
> frontend/target/polyglong-1.0-SNAPSHOT:
> org.apache.openejb.OpenEJBRuntimeException:
> 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:843)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:677)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(
> TomcatWebAppBuilder.java:1261)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(
> TomcatWebAppBuilder.java:1100)
>         at
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(
> GlobalListenerSupport.java:130)
>         at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
> LifecycleSupport.java:117)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> LifecycleBase.java:90)
>         at
> org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5472)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:147)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(
> ContainerBase.java:899)
>         at org.apache.catalina.core.ContainerBase.addChild(
> ContainerBase.java:875)
>         at org.apache.catalina.core.StandardHost.addChild(
> StandardHost.java:652)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(
> TomcatWebAppBuilder.java:663)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(
> TomcatWebAppBuilder.java:622)
>         at
> org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(
> TomcatWebappDeployer.java:43)
>         at org.apache.openejb.assembler.DeployerEjb.deploy(
> DeployerEjb.java:176)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(
> InternalSecurityInterceptor.java:35)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.record(
> StatsInterceptor.java:181)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.invoke(
> StatsInterceptor.java:100)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.core.interceptor.InterceptorStack.
> invoke(InterceptorStack.java:85)
>         at
> org.apache.openejb.core.stateless.StatelessContainer._
> invoke(StatelessContainer.java:227)
>         at
> org.apache.openejb.core.stateless.StatelessContainer.
> invoke(StatelessContainer.java:194)
>         at
> org.apache.openejb.server.ejbd.EjbRequestHandler.
> doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370)
>         at
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(
> EjbRequestHandler.java:181)
>         at
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.
> java:344)
>         at org.apache.openejb.server.ejbd.EjbDaemon.service(
> EjbDaemon.java:240)
>         at org.apache.openejb.server.ejbd.EjbServer.service(
> EjbServer.java:104)
>         at
> org.apache.openejb.server.httpd.ServerServlet.service(
> ServerServlet.java:58)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:303)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:220)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:122)
>         at org.apache.tomee.catalina.OpenEJBValve.invoke(
> OpenEJBValve.java:44)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:169)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:103)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
>         at
> org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(
> CrawlerSessionManagerValve.java:180)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:116)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:436)
>         at
> org.apache.coyote.http11.AbstractHttp11Processor.process(
> AbstractHttp11Processor.java:1078)
>         at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
> process(AbstractProtocol.java:625)
>         at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.
> run(JIoEndpoint.java:318)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
>         at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
> TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.openejb.OpenEJBException:
> org.apache.openejb.OpenEJBRuntimeException:
> 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.loadPersistenceUnits(
> Assembler.java:988)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:741)
>         ... 64 more
> Caused by: org.apache.openejb.OpenEJBRuntimeException:
> javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable
> to
> build EntityManagerFactory
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .createDelegate(ReloadableEntityManagerFactory.java:118)
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .<init>(ReloadableEntityManagerFactory.java:102)
>         at
> org.apache.openejb.assembler.classic.PersistenceBuilder.
> createEntityManagerFactory(PersistenceBuilder.java:154)
>         at
> org.apache.openejb.assembler.classic.Assembler.loadPersistenceUnits(
> Assembler.java:982)
>         ... 65 more
> Caused by: javax.persistence.PersistenceException: [PersistenceUnit:
> PolyPU]
> Unable to build EntityManagerFactory
>         at
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
> Ejb3Configuration.java:925)
>         at
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
> Ejb3Configuration.java:900)
>         at
> org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFa
> ctory(HibernatePersistence.java:76)
>         at
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(
> EntityManagerFactoryCallable.java:64)
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .createDelegate(ReloadableEntityManagerFactory.java:116)
>         ... 68 more
> Caused by: org.hibernate.cache.NoCacheRegionFactoryAvailableException:
> Second-level cache is used in the application, but property
> hibernate.cache.region.factory_class is not given, please either disable
> second level cache or set correct region factory class name to property
> hibernate.cache.region.factory_class (and make sure the second level cache
> provider, hibernate-infinispan, for example, is available in the
> classpath).
>         at
> org.hibernate.cache.internal.NoCachingRegionFactory.buildEntityRegion(
> NoCachingRegionFactory.java:69)
>         at
> org.hibernate.internal.SessionFactoryImpl.<init>(
> SessionFactoryImpl.java:352)
>         at
> org.hibernate.cfg.Configuration.buildSessionFactory(
> Configuration.java:1799)
>         at
> org.hibernate.ejb.EntityManagerFactoryImpl.<init>(
> EntityManagerFactoryImpl.java:96)
>         at
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
> Ejb3Configuration.java:915)
>         ... 72 more
>
> Apr 18, 2017 3:40:25 PM org.apache.catalina.core.ContainerBase
> addChildInternal
> SCHWERWIEGEND: ContainerBase.addChild: start:
> org.apache.catalina.LifecycleException: Failed to start component
> [StandardEngine[Catalina].StandardHost[localhost].
> StandardContext[/glossong]]
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:153)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(
> ContainerBase.java:899)
>         at org.apache.catalina.core.ContainerBase.addChild(
> ContainerBase.java:875)
>         at org.apache.catalina.core.StandardHost.addChild(
> StandardHost.java:652)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(
> TomcatWebAppBuilder.java:663)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(
> TomcatWebAppBuilder.java:622)
>         at
> org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(
> TomcatWebappDeployer.java:43)
>         at org.apache.openejb.assembler.DeployerEjb.deploy(
> DeployerEjb.java:176)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(
> InternalSecurityInterceptor.java:35)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.record(
> StatsInterceptor.java:181)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.invoke(
> StatsInterceptor.java:100)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.core.interceptor.InterceptorStack.
> invoke(InterceptorStack.java:85)
>         at
> org.apache.openejb.core.stateless.StatelessContainer._
> invoke(StatelessContainer.java:227)
>         at
> org.apache.openejb.core.stateless.StatelessContainer.
> invoke(StatelessContainer.java:194)
>         at
> org.apache.openejb.server.ejbd.EjbRequestHandler.
> doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370)
>         at
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(
> EjbRequestHandler.java:181)
>         at
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.
> java:344)
>         at org.apache.openejb.server.ejbd.EjbDaemon.service(
> EjbDaemon.java:240)
>         at org.apache.openejb.server.ejbd.EjbServer.service(
> EjbServer.java:104)
>         at
> org.apache.openejb.server.httpd.ServerServlet.service(
> ServerServlet.java:58)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:303)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:220)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:122)
>         at org.apache.tomee.catalina.OpenEJBValve.invoke(
> OpenEJBValve.java:44)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:169)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:103)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
>         at
> org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(
> CrawlerSessionManagerValve.java:180)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:116)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:436)
>         at
> org.apache.coyote.http11.AbstractHttp11Processor.process(
> AbstractHttp11Processor.java:1078)
>         at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
> process(AbstractProtocol.java:625)
>         at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.
> run(JIoEndpoint.java:318)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
>         at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
> TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.tomee.catalina.TomEERuntimeException:
> org.apache.openejb.OpenEJBException: Creating application failed:
> /Users/cristian.serje/workspace/personal/web/glossong-core/glossong-
> frontend/target/polyglong-1.0-SNAPSHOT:
> org.apache.openejb.OpenEJBRuntimeException:
> javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable
> to
> build EntityManagerFactory: javax.persistence.PersistenceException:
> [PersistenceUnit: PolyPU] Unable to build EntityManagerFactory
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(
> TomcatWebAppBuilder.java:1270)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(
> TomcatWebAppBuilder.java:1100)
>         at
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(
> GlobalListenerSupport.java:130)
>         at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
> LifecycleSupport.java:117)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> LifecycleBase.java:90)
>         at
> org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5472)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:147)
>         ... 56 more
> Caused by: org.apache.openejb.OpenEJBException: Creating application
> failed:
> /Users/cristian.serje/workspace/personal/web/glossong-core/glossong-
> frontend/target/polyglong-1.0-SNAPSHOT:
> org.apache.openejb.OpenEJBRuntimeException:
> 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:843)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:677)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(
> TomcatWebAppBuilder.java:1261)
>         ... 62 more
> Caused by: org.apache.openejb.OpenEJBException:
> org.apache.openejb.OpenEJBRuntimeException:
> 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.loadPersistenceUnits(
> Assembler.java:988)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:741)
>         ... 64 more
> Caused by: org.apache.openejb.OpenEJBRuntimeException:
> javax.persistence.PersistenceException: [PersistenceUnit: PolyPU] Unable
> to
> build EntityManagerFactory
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .createDelegate(ReloadableEntityManagerFactory.java:118)
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .<init>(ReloadableEntityManagerFactory.java:102)
>         at
> org.apache.openejb.assembler.classic.PersistenceBuilder.
> createEntityManagerFactory(PersistenceBuilder.java:154)
>         at
> org.apache.openejb.assembler.classic.Assembler.loadPersistenceUnits(
> Assembler.java:982)
>         ... 65 more
> Caused by: javax.persistence.PersistenceException: [PersistenceUnit:
> PolyPU]
> Unable to build EntityManagerFactory
>         at
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
> Ejb3Configuration.java:925)
>         at
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
> Ejb3Configuration.java:900)
>         at
> org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFa
> ctory(HibernatePersistence.java:76)
>         at
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(
> EntityManagerFactoryCallable.java:64)
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .createDelegate(ReloadableEntityManagerFactory.java:116)
>         ... 68 more
> Caused by: org.hibernate.cache.NoCacheRegionFactoryAvailableException:
> Second-level cache is used in the application, but property
> hibernate.cache.region.factory_class is not given, please either disable
> second level cache or set correct region factory class name to property
> hibernate.cache.region.factory_class (and make sure the second level cache
> provider, hibernate-infinispan, for example, is available in the
> classpath).
>         at
> org.hibernate.cache.internal.NoCachingRegionFactory.buildEntityRegion(
> NoCachingRegionFactory.java:69)
>         at
> org.hibernate.internal.SessionFactoryImpl.<init>(
> SessionFactoryImpl.java:352)
>         at
> org.hibernate.cfg.Configuration.buildSessionFactory(
> Configuration.java:1799)
>         at
> org.hibernate.ejb.EntityManagerFactoryImpl.<init>(
> EntityManagerFactoryImpl.java:96)
>         at
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
> Ejb3Configuration.java:915)
>         ... 72 more
>
> Apr 18, 2017 3:40:25 PM
> org.apache.openejb.core.transaction.EjbTransactionUtil
> handleSystemException
> SCHWERWIEGEND: EjbTransactionUtil.handleSystemException:
> java.lang.IllegalStateException: ContainerBase.addChild: start:
> org.apache.catalina.LifecycleException: Failed to start component
> [StandardEngine[Catalina].StandardHost[localhost].
> StandardContext[/glossong]]
> org.apache.openejb.OpenEJBRuntimeException: java.lang.
> IllegalStateException:
> ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
> Failed to start component
> [StandardEngine[Catalina].StandardHost[localhost].
> StandardContext[/glossong]]
>         at
> org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(
> TomcatWebappDeployer.java:45)
>         at org.apache.openejb.assembler.DeployerEjb.deploy(
> DeployerEjb.java:176)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(
> InternalSecurityInterceptor.java:35)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.record(
> StatsInterceptor.java:181)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.invoke(
> StatsInterceptor.java:100)
>         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:498)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$
> Invocation.invoke(ReflectionInvocationContext.java:192)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(
> ReflectionInvocationContext.java:173)
>         at
> org.apache.openejb.core.interceptor.InterceptorStack.
> invoke(InterceptorStack.java:85)
>         at
> org.apache.openejb.core.stateless.StatelessContainer._
> invoke(StatelessContainer.java:227)
>         at
> org.apache.openejb.core.stateless.StatelessContainer.
> invoke(StatelessContainer.java:194)
>         at
> org.apache.openejb.server.ejbd.EjbRequestHandler.
> doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370)
>         at
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(
> EjbRequestHandler.java:181)
>         at
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.
> java:344)
>         at org.apache.openejb.server.ejbd.EjbDaemon.service(
> EjbDaemon.java:240)
>         at org.apache.openejb.server.ejbd.EjbServer.service(
> EjbServer.java:104)
>         at
> org.apache.openejb.server.httpd.ServerServlet.service(
> ServerServlet.java:58)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:303)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:220)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:122)
>         at org.apache.tomee.catalina.OpenEJBValve.invoke(
> OpenEJBValve.java:44)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:169)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:103)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
>         at
> org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(
> CrawlerSessionManagerValve.java:180)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:116)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:436)
>         at
> org.apache.coyote.http11.AbstractHttp11Processor.process(
> AbstractHttp11Processor.java:1078)
>         at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
> process(AbstractProtocol.java:625)
>         at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.
> run(JIoEndpoint.java:318)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
>         at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
> TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.IllegalStateException: ContainerBase.addChild: start:
> org.apache.catalina.LifecycleException: Failed to start component
> [StandardEngine[Catalina].StandardHost[localhost].
> StandardContext[/glossong]]
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(
> ContainerBase.java:903)
>         at org.apache.catalina.core.ContainerBase.addChild(
> ContainerBase.java:875)
>         at org.apache.catalina.core.StandardHost.addChild(
> StandardHost.java:652)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(
> TomcatWebAppBuilder.java:663)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(
> TomcatWebAppBuilder.java:622)
>         at
> org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(
> TomcatWebappDeployer.java:43)
>         ... 50 more
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Error-when-using-EH-Cache-with-Hibernate-tp4681560.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Error when using EH Cache with Hibernate

cri_sys
In reply to this post by cri_sys
Thanks of the suggestion, I managed to run the app after long time looking for the solution.
It looks that the configuration on persistance.xml was never being setter or being overwritten.
My solution was to set:
hibernate.cache.region.factory_class = org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
on the system.properties in the conf file from tomee.

Now the app it is running but it looks that my queries are never hitting the cache and it is always quering the DB even though i am annotating my entity with @Cachable and @Cache. Any suggestion?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Error when using EH Cache with Hibernate

Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-21 10:54 GMT+02:00 cri_sys <[hidden email]>:

> Thanks of the suggestion, I managed to run the app after long time looking
> for the solution.
> It looks that the configuration on persistance.xml was never being setter
> or
> being overwritten.
>

you should be able to check it in JMX, persistence units are listed normally


> My solution was to set:
> hibernate.cache.region.factory_class =
> org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
> on the system.properties in the conf file from tomee.
>
> Now the app it is running but it looks that my queries are never hitting
> the
> cache and it is always quering the DB even though i am annotating my entity
> with @Cachable and @Cache. Any suggestion?
>
>
Looks like you can still hit a conflict or packaging issue as mentionned
before, didnt you check both? Can you share a sample on github reproducing
it?


> Thanks
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Error-when-using-EH-Cache-with-Hibernate-
> tp4681560p4681574.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Error when using EH Cache with Hibernate

cri_sys
In reply to this post by Romain Manni-Bucau
Yeah i am using the plus distribution: version 1.7.4

I tried again with the dependencies in case there is a conflict as you said but still not success, currently ive got in my pom.xml
<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.2.21.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.2.21.Final</version>
            <exclusions>
                <exclusion>
                    <artifactId>hibernate-core</artifactId>
                    <groupId>org.hibernate</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache-core</artifactId>
            <version>2.4.3</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>4.0.5.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-ehcache</artifactId>
            <version>4.2.21.Final</version>
            <exclusions>
                <exclusion>
                    <artifactId>hibernate-core</artifactId>
                    <groupId>org.hibernate</groupId>
                </exclusion>
            </exclusions>
        </dependency>


and in my lib folder/
hibernate-annotations-3.5.6-Final.jar
hibernate-commons-annotations-4.0.5.Final.jar
hibernate-core-4.2.21.Final.jar
hibernate-ehcache-4.2.21.Final.jar
hibernate-entitymanager-4.2.21.Final.jar
hibernate-validator-4.3.0.Final.jar


i am using even same versioning, still no idea why my cache it is not working. Any other suggestion?
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Error when using EH Cache with Hibernate

Romain Manni-Bucau
hmm maybe try these:

1. put hibernate/ehcache in tomee/lib (avoid duplicates) and give it a try
removing it from your app
2. if 1 didnt work it means your config is wrong for that version, if 1
worked it means there is a conflict
2.a you can confirm a conflict using tomee webprofile probably - since
there is no ehcache there it should work
2.b  best is likely to debug hibernate when loading, happy to help you on
that if you setup tomee-maven-plugin in a github project easy to run


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-24 12:04 GMT+02:00 cri_sys <[hidden email]>:

> Yeah i am using the plus distribution: version 1.7.4
>
> I tried again with the dependencies in case there is a conflict as you said
> but still not success, currently ive got in my pom.xml
> <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-core</artifactId>
>             <version>4.2.21.Final</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-entitymanager</artifactId>
>             <version>4.2.21.Final</version>
>             <exclusions>
>                 <exclusion>
>                     <artifactId>hibernate-core</artifactId>
>                     <groupId>org.hibernate</groupId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <dependency>
>             <groupId>net.sf.ehcache</groupId>
>             <artifactId>ehcache-core</artifactId>
>             <version>2.4.3</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate.common</groupId>
>             <artifactId>hibernate-commons-annotations</artifactId>
>             <version>4.0.5.Final</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-ehcache</artifactId>
>             <version>4.2.21.Final</version>
>             <exclusions>
>                 <exclusion>
>                     <artifactId>hibernate-core</artifactId>
>                     <groupId>org.hibernate</groupId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>
>
> and in my lib folder/
> hibernate-annotations-3.5.6-Final.jar
> hibernate-commons-annotations-4.0.5.Final.jar
> hibernate-core-4.2.21.Final.jar
> hibernate-ehcache-4.2.21.Final.jar
> hibernate-entitymanager-4.2.21.Final.jar
> hibernate-validator-4.3.0.Final.jar
>
>
> i am using even same versioning, still no idea why my cache it is not
> working. Any other suggestion?
> Thanks
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Error-when-using-EH-Cache-with-Hibernate-
> tp4681560p4681580.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Error when using EH Cache with Hibernate

cri_sys
I want to try the option 1 you just gave me, but i am not sure if i got the idea, you want me to remove the depencies from the pom o my project? and just keep the libraries in the tomee/lib? should i put it as provided?

BTW, the error just prompt whenever i use on my entity, @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "feed"), if i remove that line, the error dissapears. But still i want to activate the cache.
Reply | Threaded
Open this post in threaded view
|

Re: Error when using EH Cache with Hibernate

cri_sys
I deleted the @Cache from my entity, and checked on JMX the persistance-unit properties, and indeed the configuration from properties it is not there.
any of the folloing properties are there:
      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
      <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/polyglong"/>
     
     
     
      <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory"/>
     
      <property name="hibernate.cache.use_second_level_cache" value="true"/>
      <property name="hibernate.cache.use_query_cache" value="true"/>

      <property name="hibernate.generate_statistics" value="true"/>
      <property name="net.sf.ehcache.configurationResourceName" value="/ehcache.xml"/>

      <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
      <property name="hibernate.connection.username"/>
      <property name="hibernate.connection.password"/>

Maybe because it is being overritten by the Resource from tomee.xml?
Reply | Threaded
Open this post in threaded view
|

Re: Error when using EH Cache with Hibernate

cri_sys
Finally it looks i found the solution.
I removed my Resource Jdbc from tomee.xml and it is loading and getting the configurations done in persistance.xml.

Even though still i see that my query it is not really improved and it is not hitting the cache.
I activated the stats and as result i get:
2017-04-24 15:12:19 INFO  StatisticalLoggingSessionEventListener:275 - Session Metrics {
    892456 nanoseconds spent acquiring 27 JDBC connections;
    172511 nanoseconds spent releasing 27 JDBC connections;
    217866203 nanoseconds spent preparing 27 JDBC statements;
    2646336502 nanoseconds spent executing 27 JDBC statements;
    0 nanoseconds spent executing 0 JDBC batches;
    0 nanoseconds spent performing 0 L2C puts;
    1239845 nanoseconds spent performing 19 L2C hits;
    490312 nanoseconds spent performing 1 L2C misses;
    17828739 nanoseconds spent executing 1 flushes (flushing a total of 39 entities and 57 collections);
    6846 nanoseconds spent executing 1 partial-flushes (flushing a total of 0 entities and 0 collections)
}

and i am using the following code to activate the cache:
Query query = createNamedQuery("Feed.findAll").setMaxResults(limit).setFirstResult(offset);
            query.setHint("org.hibernate.cacheable", true);
            return query.getResultList();

am i missing something?