Deploy multi-tenancy application using Dynamic Datasource Routing

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

Deploy multi-tenancy application using Dynamic Datasource Routing

v.ciaralli
This post was updated on .
Hello,

we have developed a multi-tenancy application using MyFaces + Shiro + JPA + PostgreSQL link: tenant.
We are using Eclipse Neon 1 as IDE and TomEE-plus-7.0.2 as server.
We are placing postgresql.jar into WebContent/WEB-INF/lib folder.
If we "Run on Server" in Eclipse our application, we have some errors ( posted as log on the bottom ).
If we execute server from command prompt and deploy the application as WAR file in tomEE webapps folder we have no error.
If we move both openjpa and postgresql JARs in WebContent/WEB-INF/lib and execute back in Eclipse we have no errors.
If we add: <property name="tomee.jpa.factory.lazy" value="true" /> property in persistence.xml and we execute back in Eclipse we have no errors.
Is there any way to solve this problem without changing standard tomEE environment or without adding lazy load option?

Regards,

Vincenzo

PS:

persistence.xml

<?xml version="1.0" encoding="UTF-8"?>

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
        version="2.0">
        <persistence-unit name="router" transaction-type="JTA">
                <jta-data-source>TENANT_ROUTER/Routed_Datasource</jta-data-source>
                <class>entities.Users</class>
                <class>entities.User_roles</class>
                <properties>
                        <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />

                </properties>
        </persistence-unit>
</persistence>


log:

GRAVE: ContainerBase.removeChild: destroy:
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/TENANT_ROUTER_SHIRO]] in state [STARTING_PREP]
        at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:402)
        at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
        at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:826)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1627)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1607)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(TomcatWebAppBuilder.java:763)
        at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2226)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1037)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:717)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1298)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1124)
        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

mag 16, 2017 10:06:49 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
AVVERTENZA: The web application [TENANT_ROUTER_SHIRO] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
mag 16, 2017 10:06:50 AM org.apache.tomee.catalina.TomcatWebAppBuilder startInternal
GRAVE: Unable to deploy collapsed ear in war StandardEngine[Catalina].StandardHost[localhost].StandardContext[/TENANT_ROUTER_SHIRO]
org.apache.openejb.OpenEJBException: Creating application failed: C:\Sorgenti\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\TENANT_ROUTER_SHIRO: org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1041)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:717)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1298)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1124)
        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.openejb.OpenEJBException: org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:872)
        ... 13 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:136)
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:105)
        at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:157)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:866)
        ... 13 more
Caused by: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.
        at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:73)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(PersistenceProviderImpl.java:149)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:191)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
        at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:122)
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:134)
        ... 16 more
Caused by: java.lang.IllegalStateException: On a thread without an initialized context nor a classloader mapping a deployed app
        at org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:287)
        at org.apache.openejb.cdi.ThreadSingletonServiceImpl.getContext(ThreadSingletonServiceImpl.java:263)
        at org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:298)
        at org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:60)
        at org.apache.webbeans.config.WebBeansFinder.getSingletonInstance(WebBeansFinder.java:51)
        at org.apache.webbeans.config.WebBeansContext.getInstance(WebBeansContext.java:185)
        at org.apache.webbeans.config.WebBeansContext.currentInstance(WebBeansContext.java:203)
        at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$1.findBm(EntityManagerFactoryCallable.java:105)
        at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$1.invoke(EntityManagerFactoryCallable.java:96)
        at com.sun.proxy.$Proxy59.toString(Unknown Source)
        at java.lang.String.valueOf(Unknown Source)
        at java.lang.StringBuilder.append(Unknown Source)
        at java.util.AbstractMap.toString(Unknown Source)
        at java.text.MessageFormat.subformat(Unknown Source)
        at java.text.MessageFormat.format(Unknown Source)
        at java.text.Format.format(Unknown Source)
        at java.text.MessageFormat.format(Unknown Source)
        at org.apache.openjpa.lib.util.Localizer$Message.getMessage(Localizer.java:282)
        at org.apache.openjpa.lib.util.Localizer$Message.toString(Localizer.java:309)
        at org.apache.openejb.openjpa.JULOpenJPALog.record(JULOpenJPALog.java:130)
        at org.apache.openejb.openjpa.JULOpenJPALog.trace(JULOpenJPALog.java:72)
        at org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationProviderImpl.setInto(PersistenceProductDerivation.java:763)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(JDBCBrokerFactory.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:131)
        at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:65)
        ... 21 more

mag 16, 2017 10:06:50 AM sun.reflect.NativeMethodAccessorImpl invoke
GRAVE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/TENANT_ROUTER_SHIRO]]
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/TENANT_ROUTER_SHIRO]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
        ... 6 more
Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Creating application failed: C:\Sorgenti\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\TENANT_ROUTER_SHIRO: org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1310)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1124)
        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 6 more
Caused by: org.apache.openejb.OpenEJBException: Creating application failed: C:\Sorgenti\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\TENANT_ROUTER_SHIRO: org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1041)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:717)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1298)
        ... 11 more
Caused by: org.apache.openejb.OpenEJBException: org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:872)
        ... 13 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:136)
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:105)
        at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:157)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:866)
        ... 13 more
Caused by: <openjpa-2.4.1-r422266:1730418 fatal general error> org.apache.openjpa.persistence.PersistenceException: There was an error when invoking the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested exception for details.
        at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:73)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(PersistenceProviderImpl.java:149)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:191)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
        at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:122)
        at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:134)
        ... 16 more
Caused by: java.lang.IllegalStateException: On a thread without an initialized context nor a classloader mapping a deployed app
        at org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:287)
        at org.apache.openejb.cdi.ThreadSingletonServiceImpl.getContext(ThreadSingletonServiceImpl.java:263)
        at org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:298)
        at org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:60)
        at org.apache.webbeans.config.WebBeansFinder.getSingletonInstance(WebBeansFinder.java:51)
        at org.apache.webbeans.config.WebBeansContext.getInstance(WebBeansContext.java:185)
        at org.apache.webbeans.config.WebBeansContext.currentInstance(WebBeansContext.java:203)
        at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$1.findBm(EntityManagerFactoryCallable.java:105)
        at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$1.invoke(EntityManagerFactoryCallable.java:96)
        at com.sun.proxy.$Proxy59.toString(Unknown Source)
        at java.lang.String.valueOf(Unknown Source)
        at java.lang.StringBuilder.append(Unknown Source)
        at java.util.AbstractMap.toString(Unknown Source)
        at java.text.MessageFormat.subformat(Unknown Source)
        at java.text.MessageFormat.format(Unknown Source)
        at java.text.Format.format(Unknown Source)
        at java.text.MessageFormat.format(Unknown Source)
        at org.apache.openjpa.lib.util.Localizer$Message.getMessage(Localizer.java:282)
        at org.apache.openjpa.lib.util.Localizer$Message.toString(Localizer.java:309)
        at org.apache.openejb.openjpa.JULOpenJPALog.record(JULOpenJPALog.java:130)
        at org.apache.openejb.openjpa.JULOpenJPALog.trace(JULOpenJPALog.java:72)
        at org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationProviderImpl.setInto(PersistenceProductDerivation.java:763)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(JDBCBrokerFactory.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:131)
        at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:65)
        ... 21 more

mag 16, 2017 10:06:50 AM sun.reflect.NativeMethodAccessorImpl invoke
GRAVE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:791)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 6 more

mag 16, 2017 10:06:50 AM sun.reflect.NativeMethodAccessorImpl invoke
GRAVE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:791)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 11 more

Reply | Threaded
Open this post in threaded view
|

Re: Deploy multi-tenancy application using Dynamic Datasource Routing

Romain Manni-Bucau
Hi

if i get it right it is an eclipse issue due to the way wtp hacks tomcat.
You should report it to them cause they are also known to break tomcat
itself - without tomee even if a bit less obvious with a lighter stack.

Le 16 mai 2017 04:57, "v.ciaralli" <[hidden email]> a écrit :

> Hello,
>
> we have developed a multi-tenancy application using MyFaces + Shiro + JPA +
> PostgreSQL link:  tenant <https://github.com/esalogic/tenant.git>  .
> We are using Eclipse Neon 1 as IDE and TomEE-plus-7.0.2 as server.
> We are placing postgresql.jar into WebContent/WEB-INF/lib folder.
> If we "Run on Server" from Eclipse the application we have some errors (
> posted as log on the bottom ).
> If we execute server from command prompt and deploy the application as WAR
> file in tomEE webapps folder we have no error.
> If we move both openjpa and postgresql JARs in WebContent/WEB-INF/lib we
> have no errors.
> If we add: /<property name="tomee.jpa.factory.lazy" value="true" />/
> property in persistence.xml we have no errors.
> Is there any way to solve this problem without changing standard tomEE
> environment or without adding lazy load option?
>
> Regards,
>
> Vincenzo
>
> PS:
>
> /persistence.xml/
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
> http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
>         version="2.0">
>         <persistence-unit name="router" transaction-type="JTA">
>                 <jta-data-source>TENANT_ROUTER/Routed_Datasource</jta-
> data-source>
>                 <class>entities.Users</class>
>                 <class>entities.User_roles</class>
>                 <properties>
>                         <property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(ForeignKeys=true)" />
>
>                 </properties>
>         </persistence-unit>
> </persistence>
>
>
> /log:/
>
> GRAVE: ContainerBase.removeChild: destroy:
> org.apache.catalina.LifecycleException: An invalid Lifecycle transition
> was
> attempted ([before_destroy]) for component
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/TENANT_
> ROUTER_SHIRO]]
> in state [STARTING_PREP]
>         at
> org.apache.catalina.util.LifecycleBase.invalidTransition(
> LifecycleBase.java:402)
>         at org.apache.catalina.util.LifecycleBase.destroy(
> LifecycleBase.java:292)
>         at
> org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:826)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(
> TomcatWebAppBuilder.java:1627)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(
> TomcatWebAppBuilder.java:1607)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(
> TomcatWebAppBuilder.java:763)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> destroyApplication(Assembler.java:2226)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:1037)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:717)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(
> TomcatWebAppBuilder.java:1298)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(
> TomcatWebAppBuilder.java:1124)
>         at
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(
> GlobalListenerSupport.java:133)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> LifecycleBase.java:94)
>         at
> org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5087)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(
> ContainerBase.java:1403)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(
> ContainerBase.java:1393)
>         at java.util.concurrent.FutureTask.run(Unknown Source)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
>
> mag 16, 2017 10:06:49 AM org.apache.catalina.loader.WebappClassLoaderBase
> clearReferencesJdbc
> AVVERTENZA: The web application [TENANT_ROUTER_SHIRO] registered the JDBC
> driver [org.postgresql.Driver] but failed to unregister it when the web
> application was stopped. To prevent a memory leak, the JDBC Driver has been
> forcibly unregistered.
> mag 16, 2017 10:06:50 AM org.apache.tomee.catalina.TomcatWebAppBuilder
> startInternal
> GRAVE: Unable to deploy collapsed ear in war
> StandardEngine[Catalina].StandardHost[localhost].StandardContext[/TENANT_
> ROUTER_SHIRO]
> org.apache.openejb.OpenEJBException: Creating application failed:
> C:\Sorgenti\.metadata\.plugins\org.eclipse.wst.
> server.core\tmp1\wtpwebapps\TENANT_ROUTER_SHIRO:
> org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418
> fatal general error> org.apache.openjpa.persistence.PersistenceException:
> There was an error when invoking the static newInstance method on the named
> factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the
> nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general
> error> org.apache.openjpa.persistence.PersistenceException: There was an
> error when invoking the static newInstance method on the named factory
> class
> "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
> exception for details.
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:1041)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:717)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(
> TomcatWebAppBuilder.java:1298)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(
> TomcatWebAppBuilder.java:1124)
>         at
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(
> GlobalListenerSupport.java:133)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> LifecycleBase.java:94)
>         at
> org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5087)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(
> ContainerBase.java:1403)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(
> ContainerBase.java:1393)
>         at java.util.concurrent.FutureTask.run(Unknown Source)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
> Caused by: org.apache.openejb.OpenEJBException:
> org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418
> fatal general error> org.apache.openjpa.persistence.PersistenceException:
> There was an error when invoking the static newInstance method on the named
> factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the
> nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general
> error> org.apache.openjpa.persistence.PersistenceException: There was an
> error when invoking the static newInstance method on the named factory
> class
> "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
> exception for details.
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:872)
>         ... 13 more
> Caused by: org.apache.openejb.OpenEJBRuntimeException:
> <openjpa-2.4.1-r422266:1730418 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: There was an error
> when
> invoking the static newInstance method on the named factory class
> "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
> exception for details.
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .createDelegate(ReloadableEntityManagerFactory.java:136)
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .<init>(ReloadableEntityManagerFactory.java:105)
>         at
> org.apache.openejb.assembler.classic.PersistenceBuilder.
> createEntityManagerFactory(PersistenceBuilder.java:157)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:866)
>         ... 13 more
> Caused by: <openjpa-2.4.1-r422266:1730418 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: There was an error
> when
> invoking the static newInstance method on the named factory class
> "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
> exception for details.
>         at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(
> Bootstrap.java:73)
>         at
> org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(
> PersistenceProviderImpl.java:149)
>         at
> org.apache.openjpa.persistence.PersistenceProviderImpl.
> createContainerEntityManagerFactory(PersistenceProviderImpl.java:191)
>         at
> org.apache.openjpa.persistence.PersistenceProviderImpl.
> createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
>         at
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(
> EntityManagerFactoryCallable.java:122)
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .createDelegate(ReloadableEntityManagerFactory.java:134)
>         ... 16 more
> Caused by: java.lang.IllegalStateException: On a thread without an
> initialized context nor a classloader mapping a deployed app
>         at
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(
> ThreadSingletonServiceImpl.java:287)
>         at
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.getContext(
> ThreadSingletonServiceImpl.java:263)
>         at
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(
> ThreadSingletonServiceImpl.java:298)
>         at
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(
> ThreadSingletonServiceImpl.java:60)
>         at
> org.apache.webbeans.config.WebBeansFinder.getSingletonInstance(
> WebBeansFinder.java:51)
>         at
> org.apache.webbeans.config.WebBeansContext.getInstance(
> WebBeansContext.java:185)
>         at
> org.apache.webbeans.config.WebBeansContext.currentInstance(
> WebBeansContext.java:203)
>         at
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$
> 1.findBm(EntityManagerFactoryCallable.java:105)
>         at
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$
> 1.invoke(EntityManagerFactoryCallable.java:96)
>         at com.sun.proxy.$Proxy59.toString(Unknown Source)
>         at java.lang.String.valueOf(Unknown Source)
>         at java.lang.StringBuilder.append(Unknown Source)
>         at java.util.AbstractMap.toString(Unknown Source)
>         at java.text.MessageFormat.subformat(Unknown Source)
>         at java.text.MessageFormat.format(Unknown Source)
>         at java.text.Format.format(Unknown Source)
>         at java.text.MessageFormat.format(Unknown Source)
>         at
> org.apache.openjpa.lib.util.Localizer$Message.getMessage(
> Localizer.java:282)
>         at
> org.apache.openjpa.lib.util.Localizer$Message.toString(Localizer.java:309)
>         at org.apache.openejb.openjpa.JULOpenJPALog.record(
> JULOpenJPALog.java:130)
>         at org.apache.openejb.openjpa.JULOpenJPALog.trace(
> JULOpenJPALog.java:72)
>         at
> org.apache.openjpa.persistence.PersistenceProductDerivation$
> ConfigurationProviderImpl.setInto(PersistenceProductDerivation.java:763)
>         at
> org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.
> newInstance(JDBCBrokerFactory.java:60)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.openjpa.kernel.Bootstrap.invokeFactory(
> Bootstrap.java:131)
>         at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(
> Bootstrap.java:65)
>         ... 21 more
>
> mag 16, 2017 10:06:50 AM sun.reflect.NativeMethodAccessorImpl invoke
> GRAVE: A child container failed during start
> java.util.concurrent.ExecutionException:
> org.apache.catalina.LifecycleException: Failed to start component
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/TENANT_
> ROUTER_SHIRO]]
>         at java.util.concurrent.FutureTask.report(Unknown Source)
>         at java.util.concurrent.FutureTask.get(Unknown Source)
>         at
> org.apache.catalina.core.ContainerBase.startInternal(
> ContainerBase.java:911)
>         at
> org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(
> ContainerBase.java:1403)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(
> ContainerBase.java:1393)
>         at java.util.concurrent.FutureTask.run(Unknown Source)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
> Caused by: org.apache.catalina.LifecycleException: Failed to start
> component
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/TENANT_
> ROUTER_SHIRO]]
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:167)
>         ... 6 more
> Caused by: org.apache.tomee.catalina.TomEERuntimeException:
> org.apache.openejb.OpenEJBException: Creating application failed:
> C:\Sorgenti\.metadata\.plugins\org.eclipse.wst.
> server.core\tmp1\wtpwebapps\TENANT_ROUTER_SHIRO:
> org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418
> fatal general error> org.apache.openjpa.persistence.PersistenceException:
> There was an error when invoking the static newInstance method on the named
> factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the
> nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general
> error> org.apache.openjpa.persistence.PersistenceException: There was an
> error when invoking the static newInstance method on the named factory
> class
> "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
> exception for details.
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(
> TomcatWebAppBuilder.java:1310)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(
> TomcatWebAppBuilder.java:1124)
>         at
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(
> GlobalListenerSupport.java:133)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> LifecycleBase.java:94)
>         at
> org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5087)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         ... 6 more
> Caused by: org.apache.openejb.OpenEJBException: Creating application
> failed:
> C:\Sorgenti\.metadata\.plugins\org.eclipse.wst.
> server.core\tmp1\wtpwebapps\TENANT_ROUTER_SHIRO:
> org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418
> fatal general error> org.apache.openjpa.persistence.PersistenceException:
> There was an error when invoking the static newInstance method on the named
> factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the
> nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general
> error> org.apache.openjpa.persistence.PersistenceException: There was an
> error when invoking the static newInstance method on the named factory
> class
> "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
> exception for details.
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:1041)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:717)
>         at
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(
> TomcatWebAppBuilder.java:1298)
>         ... 11 more
> Caused by: org.apache.openejb.OpenEJBException:
> org.apache.openejb.OpenEJBRuntimeException: <openjpa-2.4.1-r422266:1730418
> fatal general error> org.apache.openjpa.persistence.PersistenceException:
> There was an error when invoking the static newInstance method on the named
> factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the
> nested exception for details.: <openjpa-2.4.1-r422266:1730418 fatal general
> error> org.apache.openjpa.persistence.PersistenceException: There was an
> error when invoking the static newInstance method on the named factory
> class
> "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
> exception for details.
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:872)
>         ... 13 more
> Caused by: org.apache.openejb.OpenEJBRuntimeException:
> <openjpa-2.4.1-r422266:1730418 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: There was an error
> when
> invoking the static newInstance method on the named factory class
> "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
> exception for details.
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .createDelegate(ReloadableEntityManagerFactory.java:136)
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .<init>(ReloadableEntityManagerFactory.java:105)
>         at
> org.apache.openejb.assembler.classic.PersistenceBuilder.
> createEntityManagerFactory(PersistenceBuilder.java:157)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createApplication(Assembler.java:866)
>         ... 13 more
> Caused by: <openjpa-2.4.1-r422266:1730418 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: There was an error
> when
> invoking the static newInstance method on the named factory class
> "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
> exception for details.
>         at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(
> Bootstrap.java:73)
>         at
> org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(
> PersistenceProviderImpl.java:149)
>         at
> org.apache.openjpa.persistence.PersistenceProviderImpl.
> createContainerEntityManagerFactory(PersistenceProviderImpl.java:191)
>         at
> org.apache.openjpa.persistence.PersistenceProviderImpl.
> createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
>         at
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(
> EntityManagerFactoryCallable.java:122)
>         at
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
> .createDelegate(ReloadableEntityManagerFactory.java:134)
>         ... 16 more
> Caused by: java.lang.IllegalStateException: On a thread without an
> initialized context nor a classloader mapping a deployed app
>         at
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(
> ThreadSingletonServiceImpl.java:287)
>         at
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.getContext(
> ThreadSingletonServiceImpl.java:263)
>         at
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(
> ThreadSingletonServiceImpl.java:298)
>         at
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(
> ThreadSingletonServiceImpl.java:60)
>         at
> org.apache.webbeans.config.WebBeansFinder.getSingletonInstance(
> WebBeansFinder.java:51)
>         at
> org.apache.webbeans.config.WebBeansContext.getInstance(
> WebBeansContext.java:185)
>         at
> org.apache.webbeans.config.WebBeansContext.currentInstance(
> WebBeansContext.java:203)
>         at
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$
> 1.findBm(EntityManagerFactoryCallable.java:105)
>         at
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$
> 1.invoke(EntityManagerFactoryCallable.java:96)
>         at com.sun.proxy.$Proxy59.toString(Unknown Source)
>         at java.lang.String.valueOf(Unknown Source)
>         at java.lang.StringBuilder.append(Unknown Source)
>         at java.util.AbstractMap.toString(Unknown Source)
>         at java.text.MessageFormat.subformat(Unknown Source)
>         at java.text.MessageFormat.format(Unknown Source)
>         at java.text.Format.format(Unknown Source)
>         at java.text.MessageFormat.format(Unknown Source)
>         at
> org.apache.openjpa.lib.util.Localizer$Message.getMessage(
> Localizer.java:282)
>         at
> org.apache.openjpa.lib.util.Localizer$Message.toString(Localizer.java:309)
>         at org.apache.openejb.openjpa.JULOpenJPALog.record(
> JULOpenJPALog.java:130)
>         at org.apache.openejb.openjpa.JULOpenJPALog.trace(
> JULOpenJPALog.java:72)
>         at
> org.apache.openjpa.persistence.PersistenceProductDerivation$
> ConfigurationProviderImpl.setInto(PersistenceProductDerivation.java:763)
>         at
> org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.
> newInstance(JDBCBrokerFactory.java:60)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.openjpa.kernel.Bootstrap.invokeFactory(
> Bootstrap.java:131)
>         at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(
> Bootstrap.java:65)
>         ... 21 more
>
> mag 16, 2017 10:06:50 AM sun.reflect.NativeMethodAccessorImpl invoke
> GRAVE: A child container failed during start
> java.util.concurrent.ExecutionException:
> org.apache.catalina.LifecycleException: Failed to start component
> [StandardEngine[Catalina].StandardHost[localhost]]
>         at java.util.concurrent.FutureTask.report(Unknown Source)
>         at java.util.concurrent.FutureTask.get(Unknown Source)
>         at
> org.apache.catalina.core.ContainerBase.startInternal(
> ContainerBase.java:911)
>         at
> org.apache.catalina.core.StandardEngine.startInternal(
> StandardEngine.java:262)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         at
> org.apache.catalina.core.StandardService.startInternal(
> StandardService.java:422)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         at
> org.apache.catalina.core.StandardServer.startInternal(
> StandardServer.java:791)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
> Caused by: org.apache.catalina.LifecycleException: Failed to start
> component
> [StandardEngine[Catalina].StandardHost[localhost]]
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:167)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(
> ContainerBase.java:1403)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(
> ContainerBase.java:1393)
>         at java.util.concurrent.FutureTask.run(Unknown Source)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
> Caused by: org.apache.catalina.LifecycleException: A child container
> failed
> during start
>         at
> org.apache.catalina.core.ContainerBase.startInternal(
> ContainerBase.java:919)
>         at
> org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         ... 6 more
>
> mag 16, 2017 10:06:50 AM sun.reflect.NativeMethodAccessorImpl invoke
> GRAVE: The required Server component failed to start so Tomcat is unable to
> start.
> org.apache.catalina.LifecycleException: Failed to start component
> [StandardServer[8005]]
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:167)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
> Caused by: org.apache.catalina.LifecycleException: Failed to start
> component
> [StandardService[Catalina]]
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:167)
>         at
> org.apache.catalina.core.StandardServer.startInternal(
> StandardServer.java:791)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         ... 7 more
> Caused by: org.apache.catalina.LifecycleException: Failed to start
> component
> [StandardEngine[Catalina]]
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:167)
>         at
> org.apache.catalina.core.StandardService.startInternal(
> StandardService.java:422)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         ... 9 more
> Caused by: org.apache.catalina.LifecycleException: A child container
> failed
> during start
>         at
> org.apache.catalina.core.ContainerBase.startInternal(
> ContainerBase.java:919)
>         at
> org.apache.catalina.core.StandardEngine.startInternal(
> StandardEngine.java:262)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         ... 11 more
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Deploy-multi-tenancy-application-using-
> Dynamic-Datasource-Routing-tp4681706.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>