Quantcast

Database connection error when migrating from Tomcat to TomEE

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Database connection error when migrating from Tomcat to TomEE

Bruno Klava
Hi folks,

I'm migrating an existing web application to run on TomEE (I'll use
JMS features of it).

Our database layer is based on hibernate and is configured via JNDI
using the org.hibernate.connection.DatasourceConnectionProvider.

In order to access the database, I mapped the resource configuration
done in <Tomcat-WTP-Config>/context.xml to
<TomEE-WTP-Config>/tomee.xml

The problem is: when I run the app in TomEE, when the server starts,
the database is accessed correctly:

17:03:52.189 [INFO ] Initializing connection provider:
org.hibernate.connection.DatasourceConnectionProvider
[o.h.c.ConnectionProviderFactory:173] [localhost-startStop-1]
17:03:52.195 [INFO ] JNDI InitialContext properties:{}
[org.hibernate.util.NamingHelper:49] [localhost-startStop-1]
17:03:52.196 [INFO ] Using datasource: java:comp/env/jdbc/dbvms
[o.h.c.DatasourceConnectionProvider:84] [localhost-startStop-1]

but after that, when I access the app via browser, the database
configuration is loaded again, but this time with error:

17:05:43.001 [INFO ] Initializing connection provider:
org.hibernate.connection.DatasourceConnectionProvider
[o.h.c.ConnectionProviderFactory:173] [ajp-bio-8009-exec-1]
17:05:43.001 [INFO ] JNDI InitialContext properties:{}
[org.hibernate.util.NamingHelper:49] [ajp-bio-8009-exec-1]
17:05:43.008 [ERROR] Could not find datasource:
java:comp/env/jdbc/dbvms [o.h.c.DatasourceConnectionProvider:78]
[ajp-bio-8009-exec-1]
javax.naming.NameNotFoundException: Name [jdbc/dbvms] is not bound in
this Context. Unable to find [jdbc].

Any idea what is going on wrong?

I found it strange that the database configuration was reloaded after
accessing the app via browser.

When running the app in Tomcat, the database configuration is not
loaded when the server starts, only after I access the app via
browser.

Another additional information that i don't know if it related to this
problem: during the TomEE initialization these exceptions are being
thrown:

01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder safeBind
SEVERE: Error in safeBind method
javax.naming.NameNotFoundException: No ORB registered with the OpenEJB system
at org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
at org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
at org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
at org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
at org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1287)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder safeBind
SEVERE: Error in safeBind method
javax.naming.NameNotFoundException: No HandleDelegate registered with
the OpenEJB system
at org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
at org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
at org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
at org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
at org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1288)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)


Thanks in advance!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database connection error when migrating from Tomcat to TomEE

Romain Manni-Bucau
Hi

Maybe try the snapshot and using tomee.xml
Le 1 mars 2013 21:48, "Bruno Klava" <[hidden email]> a écrit :

> Hi folks,
>
> I'm migrating an existing web application to run on TomEE (I'll use
> JMS features of it).
>
> Our database layer is based on hibernate and is configured via JNDI
> using the org.hibernate.connection.DatasourceConnectionProvider.
>
> In order to access the database, I mapped the resource configuration
> done in <Tomcat-WTP-Config>/context.xml to
> <TomEE-WTP-Config>/tomee.xml
>
> The problem is: when I run the app in TomEE, when the server starts,
> the database is accessed correctly:
>
> 17:03:52.189 [INFO ] Initializing connection provider:
> org.hibernate.connection.DatasourceConnectionProvider
> [o.h.c.ConnectionProviderFactory:173] [localhost-startStop-1]
> 17:03:52.195 [INFO ] JNDI InitialContext properties:{}
> [org.hibernate.util.NamingHelper:49] [localhost-startStop-1]
> 17:03:52.196 [INFO ] Using datasource: java:comp/env/jdbc/dbvms
> [o.h.c.DatasourceConnectionProvider:84] [localhost-startStop-1]
>
> but after that, when I access the app via browser, the database
> configuration is loaded again, but this time with error:
>
> 17:05:43.001 [INFO ] Initializing connection provider:
> org.hibernate.connection.DatasourceConnectionProvider
> [o.h.c.ConnectionProviderFactory:173] [ajp-bio-8009-exec-1]
> 17:05:43.001 [INFO ] JNDI InitialContext properties:{}
> [org.hibernate.util.NamingHelper:49] [ajp-bio-8009-exec-1]
> 17:05:43.008 [ERROR] Could not find datasource:
> java:comp/env/jdbc/dbvms [o.h.c.DatasourceConnectionProvider:78]
> [ajp-bio-8009-exec-1]
> javax.naming.NameNotFoundException: Name [jdbc/dbvms] is not bound in
> this Context. Unable to find [jdbc].
>
> Any idea what is going on wrong?
>
> I found it strange that the database configuration was reloaded after
> accessing the app via browser.
>
> When running the app in Tomcat, the database configuration is not
> loaded when the server starts, only after I access the app via
> browser.
>
> Another additional information that i don't know if it related to this
> problem: during the TomEE initialization these exceptions are being
> thrown:
>
> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder safeBind
> SEVERE: Error in safeBind method
> javax.naming.NameNotFoundException: No ORB registered with the OpenEJB
> system
> at
> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
> at
> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
> at
> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
> at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
> at
> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
> at
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1287)
> at
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> at
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:679)
> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder safeBind
> SEVERE: Error in safeBind method
> javax.naming.NameNotFoundException: No HandleDelegate registered with
> the OpenEJB system
> at
> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
> at
> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
> at
> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
> at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
> at
> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
> at
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1288)
> at
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> at
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:679)
>
>
> Thanks in advance!
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database connection error when migrating from Tomcat to TomEE

Bruno Klava
Hi,

I'm already configuring the database via tomee.xml.
I've tried to use the snapshots below:

1. Using the snapshot
apache-tomee-1.5.2-20130306.041201-74-plus.tar.gz, the server fails to
start:

http://pastebin.com/NSXcxSX4

2. Using the snapshot
apache-tomee-1.6.0-20130306.041135-21-plus.tar.gz, the server starts
(with some errors):

http://pastebin.com/tJzQPMMA

but fails to connect to the database:

http://pastebin.com/z9QSUV5C


Any other idea?
Tnx!

On Fri, Mar 1, 2013 at 5:51 PM, Romain Manni-Bucau
<[hidden email]> wrote:

> Hi
>
> Maybe try the snapshot and using tomee.xml
> Le 1 mars 2013 21:48, "Bruno Klava" <[hidden email]> a écrit :
>
>> Hi folks,
>>
>> I'm migrating an existing web application to run on TomEE (I'll use
>> JMS features of it).
>>
>> Our database layer is based on hibernate and is configured via JNDI
>> using the org.hibernate.connection.DatasourceConnectionProvider.
>>
>> In order to access the database, I mapped the resource configuration
>> done in <Tomcat-WTP-Config>/context.xml to
>> <TomEE-WTP-Config>/tomee.xml
>>
>> The problem is: when I run the app in TomEE, when the server starts,
>> the database is accessed correctly:
>>
>> 17:03:52.189 [INFO ] Initializing connection provider:
>> org.hibernate.connection.DatasourceConnectionProvider
>> [o.h.c.ConnectionProviderFactory:173] [localhost-startStop-1]
>> 17:03:52.195 [INFO ] JNDI InitialContext properties:{}
>> [org.hibernate.util.NamingHelper:49] [localhost-startStop-1]
>> 17:03:52.196 [INFO ] Using datasource: java:comp/env/jdbc/dbvms
>> [o.h.c.DatasourceConnectionProvider:84] [localhost-startStop-1]
>>
>> but after that, when I access the app via browser, the database
>> configuration is loaded again, but this time with error:
>>
>> 17:05:43.001 [INFO ] Initializing connection provider:
>> org.hibernate.connection.DatasourceConnectionProvider
>> [o.h.c.ConnectionProviderFactory:173] [ajp-bio-8009-exec-1]
>> 17:05:43.001 [INFO ] JNDI InitialContext properties:{}
>> [org.hibernate.util.NamingHelper:49] [ajp-bio-8009-exec-1]
>> 17:05:43.008 [ERROR] Could not find datasource:
>> java:comp/env/jdbc/dbvms [o.h.c.DatasourceConnectionProvider:78]
>> [ajp-bio-8009-exec-1]
>> javax.naming.NameNotFoundException: Name [jdbc/dbvms] is not bound in
>> this Context. Unable to find [jdbc].
>>
>> Any idea what is going on wrong?
>>
>> I found it strange that the database configuration was reloaded after
>> accessing the app via browser.
>>
>> When running the app in Tomcat, the database configuration is not
>> loaded when the server starts, only after I access the app via
>> browser.
>>
>> Another additional information that i don't know if it related to this
>> problem: during the TomEE initialization these exceptions are being
>> thrown:
>>
>> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder safeBind
>> SEVERE: Error in safeBind method
>> javax.naming.NameNotFoundException: No ORB registered with the OpenEJB
>> system
>> at
>> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
>> at
>> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
>> at
>> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
>> at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
>> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
>> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
>> at
>> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
>> at
>> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1287)
>> at
>> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
>> at
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>> at
>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>> at
>> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
>> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
>> at
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>> at
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> at java.lang.Thread.run(Thread.java:679)
>> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder safeBind
>> SEVERE: Error in safeBind method
>> javax.naming.NameNotFoundException: No HandleDelegate registered with
>> the OpenEJB system
>> at
>> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
>> at
>> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
>> at
>> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
>> at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
>> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
>> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
>> at
>> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
>> at
>> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1288)
>> at
>> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
>> at
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>> at
>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>> at
>> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
>> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
>> at
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>> at
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> at java.lang.Thread.run(Thread.java:679)
>>
>>
>> Thanks in advance!
>>



--
Bruno Klava
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database connection error when migrating from Tomcat to TomEE

Romain Manni-Bucau
do you provide a jaxb version?

if no can you share a sample reproducing the issue?

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/6 Bruno Klava <[hidden email]>

> Hi,
>
> I'm already configuring the database via tomee.xml.
> I've tried to use the snapshots below:
>
> 1. Using the snapshot
> apache-tomee-1.5.2-20130306.041201-74-plus.tar.gz, the server fails to
> start:
>
> http://pastebin.com/NSXcxSX4
>
> 2. Using the snapshot
> apache-tomee-1.6.0-20130306.041135-21-plus.tar.gz, the server starts
> (with some errors):
>
> http://pastebin.com/tJzQPMMA
>
> but fails to connect to the database:
>
> http://pastebin.com/z9QSUV5C
>
>
> Any other idea?
> Tnx!
>
> On Fri, Mar 1, 2013 at 5:51 PM, Romain Manni-Bucau
> <[hidden email]> wrote:
> > Hi
> >
> > Maybe try the snapshot and using tomee.xml
> > Le 1 mars 2013 21:48, "Bruno Klava" <[hidden email]> a écrit :
> >
> >> Hi folks,
> >>
> >> I'm migrating an existing web application to run on TomEE (I'll use
> >> JMS features of it).
> >>
> >> Our database layer is based on hibernate and is configured via JNDI
> >> using the org.hibernate.connection.DatasourceConnectionProvider.
> >>
> >> In order to access the database, I mapped the resource configuration
> >> done in <Tomcat-WTP-Config>/context.xml to
> >> <TomEE-WTP-Config>/tomee.xml
> >>
> >> The problem is: when I run the app in TomEE, when the server starts,
> >> the database is accessed correctly:
> >>
> >> 17:03:52.189 [INFO ] Initializing connection provider:
> >> org.hibernate.connection.DatasourceConnectionProvider
> >> [o.h.c.ConnectionProviderFactory:173] [localhost-startStop-1]
> >> 17:03:52.195 [INFO ] JNDI InitialContext properties:{}
> >> [org.hibernate.util.NamingHelper:49] [localhost-startStop-1]
> >> 17:03:52.196 [INFO ] Using datasource: java:comp/env/jdbc/dbvms
> >> [o.h.c.DatasourceConnectionProvider:84] [localhost-startStop-1]
> >>
> >> but after that, when I access the app via browser, the database
> >> configuration is loaded again, but this time with error:
> >>
> >> 17:05:43.001 [INFO ] Initializing connection provider:
> >> org.hibernate.connection.DatasourceConnectionProvider
> >> [o.h.c.ConnectionProviderFactory:173] [ajp-bio-8009-exec-1]
> >> 17:05:43.001 [INFO ] JNDI InitialContext properties:{}
> >> [org.hibernate.util.NamingHelper:49] [ajp-bio-8009-exec-1]
> >> 17:05:43.008 [ERROR] Could not find datasource:
> >> java:comp/env/jdbc/dbvms [o.h.c.DatasourceConnectionProvider:78]
> >> [ajp-bio-8009-exec-1]
> >> javax.naming.NameNotFoundException: Name [jdbc/dbvms] is not bound in
> >> this Context. Unable to find [jdbc].
> >>
> >> Any idea what is going on wrong?
> >>
> >> I found it strange that the database configuration was reloaded after
> >> accessing the app via browser.
> >>
> >> When running the app in Tomcat, the database configuration is not
> >> loaded when the server starts, only after I access the app via
> >> browser.
> >>
> >> Another additional information that i don't know if it related to this
> >> problem: during the TomEE initialization these exceptions are being
> >> thrown:
> >>
> >> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder
> safeBind
> >> SEVERE: Error in safeBind method
> >> javax.naming.NameNotFoundException: No ORB registered with the OpenEJB
> >> system
> >> at
> >>
> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
> >> at
> >>
> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
> >> at
> >>
> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
> >> at
> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
> >> at
> >>
> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
> >> at
> >>
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1287)
> >> at
> >>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
> >> at
> >>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> >> at
> >>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> >> at
> >>
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
> >> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
> >> at
> >>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
> >> at
> >>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
> >> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> >> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> >> at
> >>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
> >> at
> >>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> >> at java.lang.Thread.run(Thread.java:679)
> >> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder
> safeBind
> >> SEVERE: Error in safeBind method
> >> javax.naming.NameNotFoundException: No HandleDelegate registered with
> >> the OpenEJB system
> >> at
> >>
> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
> >> at
> >>
> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
> >> at
> >>
> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
> >> at
> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
> >> at
> >>
> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
> >> at
> >>
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1288)
> >> at
> >>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
> >> at
> >>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> >> at
> >>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> >> at
> >>
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
> >> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
> >> at
> >>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
> >> at
> >>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
> >> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> >> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> >> at
> >>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
> >> at
> >>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> >> at java.lang.Thread.run(Thread.java:679)
> >>
> >>
> >> Thanks in advance!
> >>
>
>
>
> --
> Bruno Klava
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database connection error when migrating from Tomcat to TomEE

Bruno Klava
Tnx Romain!
In fact I was having a version conflict with JAXB.
Now that this problem is solved, I'm back at the initial situation:
the server starts without errors (accessing successfully the
database):

http://pastebin.com/3SxJWxUQ

but when i access the webapp via browser, the error occurs when
accessing the database:

http://pastebin.com/R2hAKFmY

(the behaviour is the same in TomEE+1.5.1, TomEE+1.5.2-SNAPSHOT and
TomEE+1.6.0-SNAPSHOT)

On Wed, Mar 6, 2013 at 5:56 PM, Romain Manni-Bucau
<[hidden email]> wrote:

> do you provide a jaxb version?
>
> if no can you share a sample reproducing the issue?
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/3/6 Bruno Klava <[hidden email]>
>
>> Hi,
>>
>> I'm already configuring the database via tomee.xml.
>> I've tried to use the snapshots below:
>>
>> 1. Using the snapshot
>> apache-tomee-1.5.2-20130306.041201-74-plus.tar.gz, the server fails to
>> start:
>>
>> http://pastebin.com/NSXcxSX4
>>
>> 2. Using the snapshot
>> apache-tomee-1.6.0-20130306.041135-21-plus.tar.gz, the server starts
>> (with some errors):
>>
>> http://pastebin.com/tJzQPMMA
>>
>> but fails to connect to the database:
>>
>> http://pastebin.com/z9QSUV5C
>>
>>
>> Any other idea?
>> Tnx!
>>
>> On Fri, Mar 1, 2013 at 5:51 PM, Romain Manni-Bucau
>> <[hidden email]> wrote:
>> > Hi
>> >
>> > Maybe try the snapshot and using tomee.xml
>> > Le 1 mars 2013 21:48, "Bruno Klava" <[hidden email]> a écrit :
>> >
>> >> Hi folks,
>> >>
>> >> I'm migrating an existing web application to run on TomEE (I'll use
>> >> JMS features of it).
>> >>
>> >> Our database layer is based on hibernate and is configured via JNDI
>> >> using the org.hibernate.connection.DatasourceConnectionProvider.
>> >>
>> >> In order to access the database, I mapped the resource configuration
>> >> done in <Tomcat-WTP-Config>/context.xml to
>> >> <TomEE-WTP-Config>/tomee.xml
>> >>
>> >> The problem is: when I run the app in TomEE, when the server starts,
>> >> the database is accessed correctly:
>> >>
>> >> 17:03:52.189 [INFO ] Initializing connection provider:
>> >> org.hibernate.connection.DatasourceConnectionProvider
>> >> [o.h.c.ConnectionProviderFactory:173] [localhost-startStop-1]
>> >> 17:03:52.195 [INFO ] JNDI InitialContext properties:{}
>> >> [org.hibernate.util.NamingHelper:49] [localhost-startStop-1]
>> >> 17:03:52.196 [INFO ] Using datasource: java:comp/env/jdbc/dbvms
>> >> [o.h.c.DatasourceConnectionProvider:84] [localhost-startStop-1]
>> >>
>> >> but after that, when I access the app via browser, the database
>> >> configuration is loaded again, but this time with error:
>> >>
>> >> 17:05:43.001 [INFO ] Initializing connection provider:
>> >> org.hibernate.connection.DatasourceConnectionProvider
>> >> [o.h.c.ConnectionProviderFactory:173] [ajp-bio-8009-exec-1]
>> >> 17:05:43.001 [INFO ] JNDI InitialContext properties:{}
>> >> [org.hibernate.util.NamingHelper:49] [ajp-bio-8009-exec-1]
>> >> 17:05:43.008 [ERROR] Could not find datasource:
>> >> java:comp/env/jdbc/dbvms [o.h.c.DatasourceConnectionProvider:78]
>> >> [ajp-bio-8009-exec-1]
>> >> javax.naming.NameNotFoundException: Name [jdbc/dbvms] is not bound in
>> >> this Context. Unable to find [jdbc].
>> >>
>> >> Any idea what is going on wrong?
>> >>
>> >> I found it strange that the database configuration was reloaded after
>> >> accessing the app via browser.
>> >>
>> >> When running the app in Tomcat, the database configuration is not
>> >> loaded when the server starts, only after I access the app via
>> >> browser.
>> >>
>> >> Another additional information that i don't know if it related to this
>> >> problem: during the TomEE initialization these exceptions are being
>> >> thrown:
>> >>
>> >> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder
>> safeBind
>> >> SEVERE: Error in safeBind method
>> >> javax.naming.NameNotFoundException: No ORB registered with the OpenEJB
>> >> system
>> >> at
>> >>
>> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
>> >> at
>> >>
>> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
>> >> at
>> >>
>> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
>> >> at
>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
>> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
>> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
>> >> at
>> >>
>> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
>> >> at
>> >>
>> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1287)
>> >> at
>> >>
>> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
>> >> at
>> >>
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>> >> at
>> >>
>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>> >> at
>> >>
>> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
>> >> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
>> >> at
>> >>
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>> >> at
>> >>
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>> >> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>> >> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>> >> at
>> >>
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
>> >> at
>> >>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> >> at java.lang.Thread.run(Thread.java:679)
>> >> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder
>> safeBind
>> >> SEVERE: Error in safeBind method
>> >> javax.naming.NameNotFoundException: No HandleDelegate registered with
>> >> the OpenEJB system
>> >> at
>> >>
>> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
>> >> at
>> >>
>> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
>> >> at
>> >>
>> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
>> >> at
>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
>> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
>> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
>> >> at
>> >>
>> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
>> >> at
>> >>
>> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1288)
>> >> at
>> >>
>> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
>> >> at
>> >>
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>> >> at
>> >>
>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>> >> at
>> >>
>> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
>> >> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
>> >> at
>> >>
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>> >> at
>> >>
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>> >> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>> >> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>> >> at
>> >>
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
>> >> at
>> >>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> >> at java.lang.Thread.run(Thread.java:679)
>> >>
>> >>
>> >> Thanks in advance!
>> >>
>>
>>
>>
>> --
>> Bruno Klava
>>



--
Bruno Klava
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database connection error when migrating from Tomcat to TomEE

Romain Manni-Bucau
The jndi name of your dataspurce is wrong IMO.

What's your persistence.xml?
Le 7 mars 2013 00:46, "Bruno Klava" <[hidden email]> a écrit :

> Tnx Romain!
> In fact I was having a version conflict with JAXB.
> Now that this problem is solved, I'm back at the initial situation:
> the server starts without errors (accessing successfully the
> database):
>
> http://pastebin.com/3SxJWxUQ
>
> but when i access the webapp via browser, the error occurs when
> accessing the database:
>
> http://pastebin.com/R2hAKFmY
>
> (the behaviour is the same in TomEE+1.5.1, TomEE+1.5.2-SNAPSHOT and
> TomEE+1.6.0-SNAPSHOT)
>
> On Wed, Mar 6, 2013 at 5:56 PM, Romain Manni-Bucau
> <[hidden email]> wrote:
> > do you provide a jaxb version?
> >
> > if no can you share a sample reproducing the issue?
> >
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > *Github: https://github.com/rmannibucau*
> >
> >
> >
> > 2013/3/6 Bruno Klava <[hidden email]>
> >
> >> Hi,
> >>
> >> I'm already configuring the database via tomee.xml.
> >> I've tried to use the snapshots below:
> >>
> >> 1. Using the snapshot
> >> apache-tomee-1.5.2-20130306.041201-74-plus.tar.gz, the server fails to
> >> start:
> >>
> >> http://pastebin.com/NSXcxSX4
> >>
> >> 2. Using the snapshot
> >> apache-tomee-1.6.0-20130306.041135-21-plus.tar.gz, the server starts
> >> (with some errors):
> >>
> >> http://pastebin.com/tJzQPMMA
> >>
> >> but fails to connect to the database:
> >>
> >> http://pastebin.com/z9QSUV5C
> >>
> >>
> >> Any other idea?
> >> Tnx!
> >>
> >> On Fri, Mar 1, 2013 at 5:51 PM, Romain Manni-Bucau
> >> <[hidden email]> wrote:
> >> > Hi
> >> >
> >> > Maybe try the snapshot and using tomee.xml
> >> > Le 1 mars 2013 21:48, "Bruno Klava" <[hidden email]> a écrit :
> >> >
> >> >> Hi folks,
> >> >>
> >> >> I'm migrating an existing web application to run on TomEE (I'll use
> >> >> JMS features of it).
> >> >>
> >> >> Our database layer is based on hibernate and is configured via JNDI
> >> >> using the org.hibernate.connection.DatasourceConnectionProvider.
> >> >>
> >> >> In order to access the database, I mapped the resource configuration
> >> >> done in <Tomcat-WTP-Config>/context.xml to
> >> >> <TomEE-WTP-Config>/tomee.xml
> >> >>
> >> >> The problem is: when I run the app in TomEE, when the server starts,
> >> >> the database is accessed correctly:
> >> >>
> >> >> 17:03:52.189 [INFO ] Initializing connection provider:
> >> >> org.hibernate.connection.DatasourceConnectionProvider
> >> >> [o.h.c.ConnectionProviderFactory:173] [localhost-startStop-1]
> >> >> 17:03:52.195 [INFO ] JNDI InitialContext properties:{}
> >> >> [org.hibernate.util.NamingHelper:49] [localhost-startStop-1]
> >> >> 17:03:52.196 [INFO ] Using datasource: java:comp/env/jdbc/dbvms
> >> >> [o.h.c.DatasourceConnectionProvider:84] [localhost-startStop-1]
> >> >>
> >> >> but after that, when I access the app via browser, the database
> >> >> configuration is loaded again, but this time with error:
> >> >>
> >> >> 17:05:43.001 [INFO ] Initializing connection provider:
> >> >> org.hibernate.connection.DatasourceConnectionProvider
> >> >> [o.h.c.ConnectionProviderFactory:173] [ajp-bio-8009-exec-1]
> >> >> 17:05:43.001 [INFO ] JNDI InitialContext properties:{}
> >> >> [org.hibernate.util.NamingHelper:49] [ajp-bio-8009-exec-1]
> >> >> 17:05:43.008 [ERROR] Could not find datasource:
> >> >> java:comp/env/jdbc/dbvms [o.h.c.DatasourceConnectionProvider:78]
> >> >> [ajp-bio-8009-exec-1]
> >> >> javax.naming.NameNotFoundException: Name [jdbc/dbvms] is not bound in
> >> >> this Context. Unable to find [jdbc].
> >> >>
> >> >> Any idea what is going on wrong?
> >> >>
> >> >> I found it strange that the database configuration was reloaded after
> >> >> accessing the app via browser.
> >> >>
> >> >> When running the app in Tomcat, the database configuration is not
> >> >> loaded when the server starts, only after I access the app via
> >> >> browser.
> >> >>
> >> >> Another additional information that i don't know if it related to
> this
> >> >> problem: during the TomEE initialization these exceptions are being
> >> >> thrown:
> >> >>
> >> >> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder
> >> safeBind
> >> >> SEVERE: Error in safeBind method
> >> >> javax.naming.NameNotFoundException: No ORB registered with the
> OpenEJB
> >> >> system
> >> >> at
> >> >>
> >>
> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
> >> >> at
> >> >>
> >>
> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
> >> >> at
> >> >>
> >>
> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
> >> >> at
> >> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
> >> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
> >> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
> >> >> at
> >> >>
> >>
> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
> >> >> at
> >> >>
> >>
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1287)
> >> >> at
> >> >>
> >>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
> >> >> at
> >> >>
> >>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> >> >> at
> >> >>
> >>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> >> >> at
> >> >>
> >>
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
> >> >> at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
> >> >> at
> >> >>
> >>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
> >> >> at
> >> >>
> >>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
> >> >> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> >> >> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> >> >> at
> >> >>
> >>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
> >> >> at
> >> >>
> >>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> >> >> at java.lang.Thread.run(Thread.java:679)
> >> >> 01/03/2013 17:04:48 org.apache.tomee.catalina.TomcatWebAppBuilder
> >> safeBind
> >> >> SEVERE: Error in safeBind method
> >> >> javax.naming.NameNotFoundException: No HandleDelegate registered with
> >> >> the OpenEJB system
> >> >> at
> >> >>
> >>
> org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
> >> >> at
> >> >>
> >>
> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
> >> >> at
> >> >>
> >>
> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
> >> >> at
> >> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
> >> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
> >> >> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
> >> >> at
> >> >>
> >>
> org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1755)
> >> >> at
> >> >>
> >>
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1288)
> >> >> at
> >> >>
> >>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:104)
> >> >> at
> >> >>
> >>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> >> >> at
> >> >>
> >>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> >> >> at
> >> >>
> >>
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
> >> >> at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
> >> >> at
> >> >>
> >>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
> >> >> at
> >> >>
> >>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
> >> >> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> >> >> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> >> >> at
> >> >>
> >>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
> >> >> at
> >> >>
> >>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> >> >> at java.lang.Thread.run(Thread.java:679)
> >> >>
> >> >>
> >> >> Thanks in advance!
> >> >>
> >>
> >>
> >>
> >> --
> >> Bruno Klava
> >>
>
>
>
> --
> Bruno Klava
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database connection error when migrating from Tomcat to TomEE

smithh032772
On Wed, Mar 6, 2013 at 6:53 PM, Romain Manni-Bucau <[hidden email]>wrote:

> The jndi name of your dataspurce is wrong IMO.
>
> What's your persistence.xml?
>

And, please share your tomee.xml, too. After you login webapp via browser,
is user credentials passed to datasource to connect via user credentials
(user name and password)?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database connection error when migrating from Tomcat to TomEE

smithh032772
On Wed, Mar 6, 2013 at 8:54 PM, Howard W. Smith, Jr. <[hidden email]
> wrote:

> On Wed, Mar 6, 2013 at 6:53 PM, Romain Manni-Bucau <[hidden email]>wrote:
>
>> The jndi name of your dataspurce is wrong IMO.
>>
>> What's your persistence.xml?
>>
>
> And, please share your tomee.xml, too. After you login webapp via browser,
> is user credentials passed to datasource to connect via user credentials
> (user name and password)?
>
>
>
> Also, did you delete/remove your context.xml from your project, or did you
just copy datasource definition in context.xml to tomee.xml, and both files
exist in the project and deployed to TomEE?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database connection error when migrating from Tomcat to TomEE

Romain Manni-Bucau
try to provide as jndi name:

openejb:Resource/jdbc/dbvms

if it is a resource local unit add in conf/system.properties:

openejb.autocreate.jta-datasource-from-non-jta-one = false

(will be useless with next 1.6.0)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/7 Howard W. Smith, Jr. <[hidden email]>

> On Wed, Mar 6, 2013 at 8:54 PM, Howard W. Smith, Jr. <
> [hidden email]
> > wrote:
>
> > On Wed, Mar 6, 2013 at 6:53 PM, Romain Manni-Bucau <
> [hidden email]>wrote:
> >
> >> The jndi name of your dataspurce is wrong IMO.
> >>
> >> What's your persistence.xml?
> >>
> >
> > And, please share your tomee.xml, too. After you login webapp via
> browser,
> > is user credentials passed to datasource to connect via user credentials
> > (user name and password)?
> >
> >
> >
> > Also, did you delete/remove your context.xml from your project, or did
> you
> just copy datasource definition in context.xml to tomee.xml, and both files
> exist in the project and deployed to TomEE?
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database connection error when migrating from Tomcat to TomEE

Bruno Klava
Hi Romain,

you were right about the JNDI name. Correcting it did the job!
Thanks for your support!

Bruno



On Thu, Mar 7, 2013 at 4:22 AM, Romain Manni-Bucau
<[hidden email]> wrote:

> try to provide as jndi name:
>
> openejb:Resource/jdbc/dbvms
>
> if it is a resource local unit add in conf/system.properties:
>
> openejb.autocreate.jta-datasource-from-non-jta-one = false
>
> (will be useless with next 1.6.0)
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/3/7 Howard W. Smith, Jr. <[hidden email]>
>
>> On Wed, Mar 6, 2013 at 8:54 PM, Howard W. Smith, Jr. <
>> [hidden email]
>> > wrote:
>>
>> > On Wed, Mar 6, 2013 at 6:53 PM, Romain Manni-Bucau <
>> [hidden email]>wrote:
>> >
>> >> The jndi name of your dataspurce is wrong IMO.
>> >>
>> >> What's your persistence.xml?
>> >>
>> >
>> > And, please share your tomee.xml, too. After you login webapp via
>> browser,
>> > is user credentials passed to datasource to connect via user credentials
>> > (user name and password)?
>> >
>> >
>> >
>> > Also, did you delete/remove your context.xml from your project, or did
>> you
>> just copy datasource definition in context.xml to tomee.xml, and both files
>> exist in the project and deployed to TomEE?
>>



--
Bruno Klava
Loading...