You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christian Bruckhoff <Ch...@gmx.de> on 2010/07/08 20:26:17 UTC

Connecting Tomcat to a database

  Hi.

I need t connect Tomcat to a database, I want to use with ODE. Therefor, 
I changed the configuration decribed in [1] to


server.xml (inside the <Host>-Element):
------------------------------------------------------
<Context path="/TestDB" docBase="TestDB" debug="5" reloadable="true" 
crossContext="true">
<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"7
          maxActive="100" maxIdle="30" maxWait="10000"
          username="test_dab" password="moep" 
driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://mysqlhost.uni-koblenz.de/TestDB"/>
</Context>


ode-axis2.properties:
-----------------------------
ode-axis2.db.mode=EXTERNAL
ode-axis2.db.ext.dataSource=java:comp/env/jdbc/TestDB

After I did this, Tomcat didn't work anymore. I even can't debug it, 
because the Tomcat window dissapears to fast.

Can you help me?

Greetz
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connecting Tomcat to a database

Posted by Pid <pi...@pidster.com>.
On 09/07/2010 14:27, Caldarale, Charles R wrote:
>> From: Pid [mailto:pid@pidster.com]
>> Subject: Re: Connecting Tomcat to a database
>>
>>> Most unfortunate that they're suggesting very, very out of date
>>> practices.  Put the MySQL JDBC driver in Tomcat's lib directory, not
>>> common/lib (that was changed quite some time ago).  Place the
>>> following<Context>  element in webapps/ode/META-INF/context.xml:
>>
>> For future ref:
>>
>>  https://issues.apache.org/jira/browse/ODE-871
> 
> Should also mention the incorrect location for the JDBC driver jar.  (Or did I miss that in my quick scan of the bug report?)

Yep, I missed it.  Now fixed.


p

>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 



RE: Connecting Tomcat to a database

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Pid [mailto:pid@pidster.com]
> Subject: Re: Connecting Tomcat to a database
> 
> > Most unfortunate that they're suggesting very, very out of date
> > practices.  Put the MySQL JDBC driver in Tomcat's lib directory, not
> > common/lib (that was changed quite some time ago).  Place the
> > following<Context>  element in webapps/ode/META-INF/context.xml:
> 
> For future ref:
> 
>  https://issues.apache.org/jira/browse/ODE-871

Should also mention the incorrect location for the JDBC driver jar.  (Or did I miss that in my quick scan of the bug report?)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connecting Tomcat to a database

Posted by Pid <pi...@pidster.com>.
On 09/07/2010 08:01, Christian Bruckhoff wrote:
> Hi.
> 
> Am 08.07.2010 23:36, schrieb Caldarale, Charles R:
>>> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
>>> Subject: Re: Connecting Tomcat to a database
>>>
>>> Sorry was in a haste, forgot much more than this. :-/
>>> - Tomcat 7.0.0
>>> - Java 1.6 Update 20
>>> - Windows XP SP3
>>> - Wanted to use DB for Apache ODE 2.0 Beta
>>
>>> That's how it was shown here: http://ode.apache.org/war-deployment.html
>>
>> Most unfortunate that they're suggesting very, very out of date
>> practices.  Put the MySQL JDBC driver in Tomcat's lib directory, not
>> common/lib (that was changed quite some time ago).  Place the
>> following<Context>  element in webapps/ode/META-INF/context.xml:

For future ref:

 https://issues.apache.org/jira/browse/ODE-871


p

>> <Context reloadable="true" crossContext="true">
>>    <Resource name="jdbc/ODEDB" auth="Container"
>> type="javax.sql.DataSource"
>>              maxActive="100" maxIdle="30" maxWait="10000"
>>              username="root" password=""
>> driverClassName="com.mysql.jdbc.Driver"
>>              url="jdbc:mysql://localhost:3306/ode?autoReconnect=true"/>
>> </Context>
> 
> I did and modified it to my database:
> 
> ----------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <Context reloadable="true" crossContext="true">
>   <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
>             maxActive="100" maxIdle="30" maxWait="10000"
>             username="test_dab" password="moep"
> driverClassName="com.mysql.jdbc.Driver"
> 
> url="jdbc:mysql://mysqlhost.uni-koblenz.de:3306/TestDB?autoReconnect=true"/>
> 
> </Context>
> ----------------------------------------
> 
> I also edited ode-axis2.properties to
> 
> ----------------------------------------
> ode-axis2.db.mode=EXTERNAL
> ode-axis2.db.ext.dataSource=java:comp/env/jdbc/TestDB
> ----------------------------------------
> 
> after this, I get the this error log:
> 
> ----------------------------------------
> 09.07.2010 08:59:04 org.apache.catalina.core.AprLifecycleListener init
> INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
> 09.07.2010 08:59:04 org.apache.catalina.core.AprLifecycleListener init
> INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
> [false], ra
> ndom [true].
> 09.07.2010 08:59:05 org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 1235 ms
> 09.07.2010 08:59:05 org.apache.catalina.core.StandardService startInternal
> INFO: Starting service Catalina
> 09.07.2010 08:59:05 org.apache.catalina.core.StandardEngine startInternal
> INFO: Starting Servlet Engine: Apache Tomcat/7.0.0
> 09.07.2010 08:59:05 org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive ode.war
> DEBUG - GeronimoLog.debug(66) | Loading properties
> DEBUG - GeronimoLog.debug(66) | Initializing transaction manager
> DEBUG - GeronimoLog.debug(66) | Initializing transaction manager using
> org.apach
> e.ode.il.EmbeddedGeronimoFactory
> DEBUG - GeronimoLog.debug(66) | Creating data source.
> ERROR - GeronimoLog.error(108) | Failed to resolved external DataSource
> at "java
> :comp/env/jdbc/TestDB".
> javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:774)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:157)
>         at
> org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
>         at javax.naming.InitialContext.lookup(InitialContext.java:392)
>         at
> org.apache.ode.il.dbutil.Database.lookupInJndi(Database.java:244)
>         at
> org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:159)
>         at
> org.apache.ode.il.dbutil.Database.initDataSource(Database.java:144)
>         at org.apache.ode.il.dbutil.Database.start(Database.java:99)
>         at
> org.apache.ode.axis2.ODEServer.initDataSource(ODEServer.java:218)
>         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:157)
>         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:116)
>         at
> org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:53
> )
>         at
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.
> java:1164)
>         at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
> java:1118)
>         at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
> 05)
>         at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
> t.java:4529)
>         at
> org.apache.catalina.core.StandardContext.startInternal(StandardContex
> t.java:4800)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
> .java:785)
>         at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:76
> 3)
>         at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)
> 
>         at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987)
> 
>         at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778
> )
>         at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:540
> )
>         at
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390)
>         at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
> :355)
>         at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
> eSupport.java:119)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
> se.java:89)
>         at
> org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:31
> 2)
>         at
> org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:29
> 2)
>         at
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
> va:998)
>         at
> org.apache.catalina.core.StandardHost.startInternal(StandardHost.java
> :772)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
> va:990)
>         at
> org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.
> java:275)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at
> org.apache.catalina.core.StandardService.startInternal(StandardServic
> e.java:424)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at
> org.apache.catalina.core.StandardServer.startInternal(StandardServer.
> java:648)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
> ERROR - GeronimoLog.error(108) | Error starting database connections,
> check the
> database configuration!
> org.apache.ode.il.dbutil.DatabaseConfigException: Failed to resolved
> external Da
> taSource at "java:comp/env/jdbc/TestDB".
>         at
> org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:164)
>         at
> org.apache.ode.il.dbutil.Database.initDataSource(Database.java:144)
>         at org.apache.ode.il.dbutil.Database.start(Database.java:99)
>         at
> org.apache.ode.axis2.ODEServer.initDataSource(ODEServer.java:218)
>         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:157)
>         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:116)
>         at
> org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:53
> )
>         at
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.
> java:1164)
>         at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
> java:1118)
>         at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
> 05)
>         at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
> t.java:4529)
>         at
> org.apache.catalina.core.StandardContext.startInternal(StandardContex
> t.java:4800)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
> .java:785)
>         at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:76
> 3)
>         at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)
> 
>         at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987)
> 
>         at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778
> )
>         at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:540
> )
>         at
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390)
>         at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
> :355)
>         at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
> eSupport.java:119)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
> se.java:89)
>         at
> org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:31
> 2)
>         at
> org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:29
> 2)
>         at
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
> va:998)
>         at
> org.apache.catalina.core.StandardHost.startInternal(StandardHost.java
> :772)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
> va:990)
>         at
> org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.
> java:275)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at
> org.apache.catalina.core.StandardService.startInternal(StandardServic
> e.java:424)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at
> org.apache.catalina.core.StandardServer.startInternal(StandardServer.
> java:648)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
> Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in
> this Co
> ntext
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:774)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:157)
>         at
> org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
>         at javax.naming.InitialContext.lookup(InitialContext.java:392)
>         at
> org.apache.ode.il.dbutil.Database.lookupInJndi(Database.java:244)
>         at
> org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:159)
>         ... 41 more
> 09.07.2010 08:59:11 org.apache.catalina.startup.HostConfig deployDirectory
> INFO: Deploying web application directory docs
> 09.07.2010 08:59:11 org.apache.catalina.startup.HostConfig deployDirectory
> INFO: Deploying web application directory examples
> 09.07.2010 08:59:12 org.apache.catalina.startup.HostConfig deployDirectory
> INFO: Deploying web application directory host-manager
> 09.07.2010 08:59:12 org.apache.catalina.startup.HostConfig deployDirectory
> INFO: Deploying web application directory manager
> 09.07.2010 08:59:12 org.apache.catalina.startup.HostConfig deployDirectory
> INFO: Deploying web application directory ROOT
> 09.07.2010 08:59:12 org.apache.coyote.http11.Http11AprProtocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> 09.07.2010 08:59:12 org.apache.coyote.http11.Http11AprProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> 09.07.2010 08:59:12 org.apache.coyote.ajp.AjpAprProtocol init
> INFO: Initializing Coyote AJP/1.3 on ajp-8009
> 09.07.2010 08:59:12 org.apache.coyote.ajp.AjpAprProtocol start
> INFO: Starting Coyote AJP/1.3 on ajp-8009
> 09.07.2010 08:59:12 org.apache.catalina.startup.Catalina start
> INFO: Server startup in 7072 ms
> ----------------------------------------
> 
> Any idea, what's wrong?
> 
> Greetings
> Christian
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 



RE: Connecting Tomcat to a database

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
> Subject: Re: Connecting Tomcat to a database
> 
> But now, I get another error (see end of message). Do I have
> to import the ODE schema even if I want to use the database
> for ODE external data?

I presume so - how else are the tables going to be created?  This doesn't seem to have anything to do with Tomcat, so you'll need to inquire with ODE support.

> > 2) The ODE instructions specify the wrong name for the SQL
> > script to initialize the database; it should be sql/mysql.sql,
> > not ode_openjpa_mysql-1.3.2.sql
> 
> Can't find this location. :-( Do I have to change something there?

It's not in the .war file, it's in the apache-ode-war-2.0-beta2 download.  Again, nothing to do with Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connecting Tomcat to a database

Posted by Christian Bruckhoff <Ch...@gmx.de>.
Hi.

Am 10.07.2010 06:15, schrieb Caldarale, Charles R:
>> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
>> Subject: Re: Connecting Tomcat to a database
>>
>> ERROR - GeronimoLog.error(108) | Failed to resolved external
>> DataSource at "java:comp/env/jdbc/TestDB".
>> javax.naming.NameNotFoundException: Name jdbc is not bound
>> in this Context
>>
>> Any idea, what's wrong?
>
> I downloaded and installed ODE on Tomcat 7, configured it for MySQL, and was able to reproduce the above error.  (Contrary to popular belief, there is no space in the error message - that was just a figment of whatever transposition mechanism the OP used.  The grammar in the message is flawed, though.)
>
> Luckily, there's an easy fix (or at least a workaround): get rid of the original .war file.  Once Tomcat has expanded ode.war into the ode directory, the .war file is no longer needed, and in fact is somehow interfering with the use of the directory.  Deleting the .war (or changing the extension) lets the META-INF/context.xml file get processed, thus defining the JNDI data source.  The same effect can be achieved by placing the<Context>  element in conf/Catalina/[host]/ode.xml, which will override any in META-INF/context.xml (in either the .war file or the directory).
>
> I have no idea if things are supposed to work this way, or if this is a bug in Tomcat 7 (haven't tried ODE on any other version).  Perhaps the lack of a context.xml file inside META-INF of the .war causes Tomcat to ignore the one in the expanded directory.

I tried it that way and at least it seems, as if tomcat recognizes the 
database. But now, I get another error (see end of message). Do I have 
to import the ODE schema even if I want to use the database for ODE 
external data?

> As a side note, I found two problems with the ODE 2.0 beta:
>
> 1) It doesn't shut down properly.  You can't use Tomcat's shutdown.bat (or .sh) script to stop Tomcat, since ODE starts extra threads and fails to terminate them when the webapp is being stopped.  You can use a signal (CTRL-c on Windows) to get the JVM to shutdown cleanly.

Better then the bugs, happening with 1.x :-D

> 2) The ODE instructions specify the wrong name for the SQL script to initialize the database; it should be sql/mysql.sql, not ode_openjpa_mysql-1.3.2.sql (the latter appears to be some ancient name).

Can't find this location. :-( Do I have to change something there?


Greetings
Christian

-----------

C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. neue 
Entwicklungsumgebung\apache-
tomcat-7.0.0-ode2DB\bin>catalina run
Using CATALINA_BASE:   "C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw
icklungsumgebung\apache-tomcat-7.0.0-ode2DB"
Using CATALINA_HOME:   "C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw
icklungsumgebung\apache-tomcat-7.0.0-ode2DB"
Using CATALINA_TMPDIR: "C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw
icklungsumgebung\apache-tomcat-7.0.0-ode2DB\temp"
Using JRE_HOME:        "C:\Programme\Java\jdk1.6.0_20"
Using CLASSPATH:       "C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw
icklungsumgebung\apache-tomcat-7.0.0-ode2DB\bin\bootstrap.jar;C:\Eigene 
Dateien\
Downloads\Diplomarbeit\Evtl. neue 
Entwicklungsumgebung\apache-tomcat-7.0.0-ode2D
B\bin\tomcat-juli.jar"
12.07.2010 10:55:50 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
12.07.2010 10:55:50 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters 
[false], ra
ndom [true].
12.07.2010 10:55:54 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 5583 ms
12.07.2010 10:55:54 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
12.07.2010 10:55:54 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.0
12.07.2010 10:55:55 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
12.07.2010 10:55:55 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
12.07.2010 10:55:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
12.07.2010 10:55:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
12.07.2010 10:55:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ode
DEBUG - GeronimoLog.debug(66) | Loading properties
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager using 
org.apach
e.ode.il.EmbeddedGeronimoFactory
DEBUG - GeronimoLog.debug(66) | Creating data source.
DEBUG - GeronimoLog.debug(66) | Starting DAO.
INFO - GeronimoLog.info(79) | Using DAO Connection Factory class 
org.apache.ode.
dao.jpa.BPELDAOConnectionFactoryImpl.
DEBUG - GeronimoLog.debug(66) | Initializing BPEL process store.
DEBUG - GeronimoLog.debug(66) | Initializing BPEL server.
DEBUG - GeronimoLog.debug(66) | ODE initializing
DEBUG - GeronimoLog.debug(66) | BPEL SERVER initializing
DEBUG - GeronimoLog.debug(66) | BPEL SERVER starting.
ERROR - GeronimoLog.error(108) | Error retrieving node list.
org.apache.ode.scheduler.simple.DatabaseException: 
com.mysql.jdbc.exceptions.jdb
c4.MySQLSyntaxErrorException: Table 'TestDB.ODE_JOB' doesn't exist
         at 
org.apache.ode.scheduler.simple.JdbcDelegate.getNodeIds(JdbcDelegate.
java:118)
         at 
org.apache.ode.scheduler.simple.SimpleScheduler$1.call(SimpleSchedule
r.java:248)
         at 
org.apache.ode.scheduler.simple.SimpleScheduler$1.call(SimpleSchedule
r.java:247)
         at 
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(Simpl
eScheduler.java:154)
         at 
org.apache.ode.scheduler.simple.SimpleScheduler.start(SimpleScheduler
.java:245)
         at 
org.apache.ode.bpel.engine.BpelServerImpl.start(BpelServerImpl.java:2
24)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:175)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:116)
         at 
org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:53
)
         at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.
java:1164)
         at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1118)
         at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
05)
         at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4529)
         at 
org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:4800)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:785)
         at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:76
3)
         at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)

         at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
a:1124)
         at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j
ava:1047)
         at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:542
)
         at 
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390)
         at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:355)
         at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
         at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
se.java:89)
         at 
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:31
2)
         at 
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:29
2)
         at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:998)
         at 
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java
:772)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:990)
         at 
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.
java:275)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.StandardService.startInternal(StandardServic
e.java:424)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.StandardServer.startInternal(StandardServer.
java:648)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 
Table 'Tes
tDB.ODE_JOB' doesn't exist
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
         at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
         at com.mysql.jdbc.Util.getInstance(Util.java:384)
         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
         at 
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:2113)
         at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:
2275)
         at 
org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(
DelegatingPreparedStatement.java:96)
         at 
org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(
DelegatingPreparedStatement.java:96)
         at 
org.apache.ode.scheduler.simple.JdbcDelegate.getNodeIds(JdbcDelegate.
java:107)
         ... 43 more
ERROR - GeronimoLog.error(108) | ODE BPEL Server failed to start.
org.apache.ode.bpel.iapi.ContextException: Error retrieving node list.
         at 
org.apache.ode.scheduler.simple.SimpleScheduler.start(SimpleScheduler
.java:255)
         at 
org.apache.ode.bpel.engine.BpelServerImpl.start(BpelServerImpl.java:2
24)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:175)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:116)
         at 
org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:53
)
         at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.
java:1164)
         at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1118)
         at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
05)
         at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4529)
         at 
org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:4800)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:785)
         at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:76
3)
         at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)

         at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
a:1124)
         at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j
ava:1047)
         at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:542
)
         at 
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390)
         at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:355)
         at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
         at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
se.java:89)
         at 
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:31
2)
         at 
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:29
2)
         at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:998)
         at 
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java
:772)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:990)
         at 
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.
java:275)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.StandardService.startInternal(StandardServic
e.java:424)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.StandardServer.startInternal(StandardServer.
java:648)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
Caused by: org.apache.ode.scheduler.simple.DatabaseException: 
com.mysql.jdbc.exc
eptions.jdbc4.MySQLSyntaxErrorException: Table 'TestDB.ODE_JOB' doesn't 
exist
         at 
org.apache.ode.scheduler.simple.JdbcDelegate.getNodeIds(JdbcDelegate.
java:118)
         at 
org.apache.ode.scheduler.simple.SimpleScheduler$1.call(SimpleSchedule
r.java:248)
         at 
org.apache.ode.scheduler.simple.SimpleScheduler$1.call(SimpleSchedule
r.java:247)
         at 
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(Simpl
eScheduler.java:154)
         at 
org.apache.ode.scheduler.simple.SimpleScheduler.start(SimpleScheduler
.java:245)
         ... 39 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 
Table 'Tes
tDB.ODE_JOB' doesn't exist
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
         at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
         at com.mysql.jdbc.Util.getInstance(Util.java:384)
         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
         at 
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:2113)
         at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:
2275)
         at 
org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(
DelegatingPreparedStatement.java:96)
         at 
org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(
DelegatingPreparedStatement.java:96)
         at 
org.apache.ode.scheduler.simple.JdbcDelegate.getNodeIds(JdbcDelegate.
java:107)
         ... 43 more
12.07.2010 10:56:13 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
12.07.2010 10:56:13 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
12.07.2010 10:56:13 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
12.07.2010 10:56:13 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
12.07.2010 10:56:13 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
12.07.2010 10:56:13 org.apache.catalina.startup.Catalina start
INFO: Server startup in 18749 ms

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connecting Tomcat to a database

Posted by Mark Thomas <ma...@apache.org>.
On 10/07/2010 05:15, Caldarale, Charles R wrote:
>> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
>> Subject: Re: Connecting Tomcat to a database
>>
>> ERROR - GeronimoLog.error(108) | Failed to resolved external 
>> DataSource at "java:comp/env/jdbc/TestDB".
>> javax.naming.NameNotFoundException: Name jdbc is not bound
>> in this Context
>>
>> Any idea, what's wrong?
> 
> I downloaded and installed ODE on Tomcat 7, configured it for MySQL, and was able to reproduce the above error.  (Contrary to popular belief, there is no space in the error message - that was just a figment of whatever transposition mechanism the OP used.  The grammar in the message is flawed, though.)
> 
> Luckily, there's an easy fix (or at least a workaround): get rid of the original .war file.  Once Tomcat has expanded ode.war into the ode directory, the .war file is no longer needed, and in fact is somehow interfering with the use of the directory.  Deleting the .war (or changing the extension) lets the META-INF/context.xml file get processed, thus defining the JNDI data source.  The same effect can be achieved by placing the <Context> element in conf/Catalina/[host]/ode.xml, which will override any in META-INF/context.xml (in either the .war file or the directory).
> 
> I have no idea if things are supposed to work this way, or if this is a bug in Tomcat 7 (haven't tried ODE on any other version).  Perhaps the lack of a context.xml file inside META-INF of the .war causes Tomcat to ignore the one in the expanded directory.

Yep. If there is a WAR file, Tomcat will deploy from that. If there is
no META-INF/context.xml in the WAR then Tomcat uses the defaults. It
will not go looking in the expanded directory. However, if the
context.xml file was placed in CATALINA_BASE/conf/<engine name>/<host
name> then it should take effect.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Connecting Tomcat to a database

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
> Subject: Re: Connecting Tomcat to a database
> 
> ERROR - GeronimoLog.error(108) | Failed to resolved external 
> DataSource at "java:comp/env/jdbc/TestDB".
> javax.naming.NameNotFoundException: Name jdbc is not bound
> in this Context
>
> Any idea, what's wrong?

I downloaded and installed ODE on Tomcat 7, configured it for MySQL, and was able to reproduce the above error.  (Contrary to popular belief, there is no space in the error message - that was just a figment of whatever transposition mechanism the OP used.  The grammar in the message is flawed, though.)

Luckily, there's an easy fix (or at least a workaround): get rid of the original .war file.  Once Tomcat has expanded ode.war into the ode directory, the .war file is no longer needed, and in fact is somehow interfering with the use of the directory.  Deleting the .war (or changing the extension) lets the META-INF/context.xml file get processed, thus defining the JNDI data source.  The same effect can be achieved by placing the <Context> element in conf/Catalina/[host]/ode.xml, which will override any in META-INF/context.xml (in either the .war file or the directory).

I have no idea if things are supposed to work this way, or if this is a bug in Tomcat 7 (haven't tried ODE on any other version).  Perhaps the lack of a context.xml file inside META-INF of the .war causes Tomcat to ignore the one in the expanded directory.

As a side note, I found two problems with the ODE 2.0 beta:

1) It doesn't shut down properly.  You can't use Tomcat's shutdown.bat (or .sh) script to stop Tomcat, since ODE starts extra threads and fails to terminate them when the webapp is being stopped.  You can use a signal (CTRL-c on Windows) to get the JVM to shutdown cleanly.

2) The ODE instructions specify the wrong name for the SQL script to initialize the database; it should be sql/mysql.sql, not ode_openjpa_mysql-1.3.2.sql (the latter appears to be some ancient name).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connecting Tomcat to a database

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry,

On 7/9/2010 12:47 PM, Propes, Barry L wrote:
> Not totally sure if this matters, maybe it doesn't, but I notice
> this line on the error:
> 
> Failed to resolved external DataSource at "java
> :comp/env/jdbc/TestDB".
> 
> I have a similar reference, while using Oracle, but reference as
>
> Context envCtx = (Context) initCtx.lookup("java:comp/env");    <------------   no space.....yours has a space.
> 
> Maybe the space would cause an error?

I would imagine that would definitely cause an error. The OP should
re-check the code

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw3dKIACgkQ9CaO5/Lv0PCLpgCgoSZy3PtiVXHjpOwk4+4RX0aI
/EAAnRYagtnZDZ4VDPvyZRkDGycuYMR1
=pSRH
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Connecting Tomcat to a database

Posted by "Propes, Barry L " <ba...@citi.com>.
 Not totally sure if this matters, maybe it doesn't, but I notice this line on the error:

Failed to resolved external DataSource at "java :comp/env/jdbc/TestDB".

I have a similar reference, while using Oracle, but reference as

Context envCtx = (Context) initCtx.lookup("java:comp/env");    <------------   no space.....yours has a space.

Maybe the space would cause an error?



-----Original Message-----
From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
Sent: Friday, July 09, 2010 2:02 AM
To: Tomcat Users List
Subject: Re: Connecting Tomcat to a database

Hi.

Am 08.07.2010 23:36, schrieb Caldarale, Charles R:
>> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
>> Subject: Re: Connecting Tomcat to a database
>>
>> Sorry was in a haste, forgot much more than this. :-/
>> - Tomcat 7.0.0
>> - Java 1.6 Update 20
>> - Windows XP SP3
>> - Wanted to use DB for Apache ODE 2.0 Beta
>
>> That's how it was shown here:
>> http://ode.apache.org/war-deployment.html
>
> Most unfortunate that they're suggesting very, very out of date practices.  Put the MySQL JDBC driver in Tomcat's lib directory, not common/lib (that was changed quite some time ago).  Place the following<Context>  element in webapps/ode/META-INF/context.xml:
>
> <Context reloadable="true" crossContext="true">
>    <Resource name="jdbc/ODEDB" auth="Container" type="javax.sql.DataSource"
>              maxActive="100" maxIdle="30" maxWait="10000"
>              username="root" password="" driverClassName="com.mysql.jdbc.Driver"
>
> url="jdbc:mysql://localhost:3306/ode?autoReconnect=true"/>
> </Context>

I did and modified it to my database:

----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Context reloadable="true" crossContext="true">
   <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
             maxActive="100" maxIdle="30" maxWait="10000"
             username="test_dab" password="moep"
driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://mysqlhost.uni-koblenz.de:3306/TestDB?autoReconnect=true"/>
</Context>
----------------------------------------

I also edited ode-axis2.properties to

----------------------------------------
ode-axis2.db.mode=EXTERNAL
ode-axis2.db.ext.dataSource=java:comp/env/jdbc/TestDB
----------------------------------------

after this, I get the this error log:

----------------------------------------
09.07.2010 08:59:04 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
09.07.2010 08:59:04 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], ra ndom [true].
09.07.2010 08:59:05 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1235 ms 09.07.2010 08:59:05 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
09.07.2010 08:59:05 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.0 09.07.2010 08:59:05 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive ode.war DEBUG - GeronimoLog.debug(66) | Loading properties DEBUG - GeronimoLog.debug(66) | Initializing transaction manager DEBUG - GeronimoLog.debug(66) | Initializing transaction manager using org.apach e.ode.il.EmbeddedGeronimoFactory DEBUG - GeronimoLog.debug(66) | Creating data source.
ERROR - GeronimoLog.error(108) | Failed to resolved external DataSource at "java :comp/env/jdbc/TestDB".
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
         at org.apache.naming.NamingContext.lookup(NamingContext.java:774)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:157)
         at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at
org.apache.ode.il.dbutil.Database.lookupInJndi(Database.java:244)
         at
org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:159)
         at
org.apache.ode.il.dbutil.Database.initDataSource(Database.java:144)
         at org.apache.ode.il.dbutil.Database.start(Database.java:99)
         at
org.apache.ode.axis2.ODEServer.initDataSource(ODEServer.java:218)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:157)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:116)
         at
org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:53
)
         at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.
java:1164)
         at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1118)
         at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
05)
         at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4529)
         at
org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:4800)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:785)
         at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:76
3)
         at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)

         at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987)

         at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778
)
         at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:540
)
         at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390)
         at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:355)
         at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
         at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
se.java:89)
         at
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:31
2)
         at
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:29
2)
         at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:998)
         at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java
:772)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:990)
         at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.
java:275)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at
org.apache.catalina.core.StandardService.startInternal(StandardServic
e.java:424)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.
java:648)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
ERROR - GeronimoLog.error(108) | Error starting database connections, check the database configuration!
org.apache.ode.il.dbutil.DatabaseConfigException: Failed to resolved external Da taSource at "java:comp/env/jdbc/TestDB".
         at
org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:164)
         at
org.apache.ode.il.dbutil.Database.initDataSource(Database.java:144)
         at org.apache.ode.il.dbutil.Database.start(Database.java:99)
         at
org.apache.ode.axis2.ODEServer.initDataSource(ODEServer.java:218)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:157)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:116)
         at
org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:53
)
         at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.
java:1164)
         at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1118)
         at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
05)
         at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4529)
         at
org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:4800)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:785)
         at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:76
3)
         at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)

         at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987)

         at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778
)
         at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:540
)
         at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390)
         at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:355)
         at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
         at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
se.java:89)
         at
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:31
2)
         at
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:29
2)
         at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:998)
         at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java
:772)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:990)
         at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.
java:275)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at
org.apache.catalina.core.StandardService.startInternal(StandardServic
e.java:424)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.
java:648)
         at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Co ntext
         at org.apache.naming.NamingContext.lookup(NamingContext.java:774)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:157)
         at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at
org.apache.ode.il.dbutil.Database.lookupInJndi(Database.java:244)
         at
org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:159)
         ... 41 more
09.07.2010 08:59:11 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs 09.07.2010 08:59:11 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples 09.07.2010 08:59:12 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager 09.07.2010 08:59:12 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager 09.07.2010 08:59:12 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT 09.07.2010 08:59:12 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080 09.07.2010 08:59:12 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080 09.07.2010 08:59:12 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009 09.07.2010 08:59:12 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009 09.07.2010 08:59:12 org.apache.catalina.startup.Catalina start
INFO: Server startup in 7072 ms
----------------------------------------

Any idea, what's wrong?

Greetings
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connecting Tomcat to a database

Posted by Christian Bruckhoff <Ch...@gmx.de>.
Hi.

Am 08.07.2010 23:36, schrieb Caldarale, Charles R:
>> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
>> Subject: Re: Connecting Tomcat to a database
>>
>> Sorry was in a haste, forgot much more than this. :-/
>> - Tomcat 7.0.0
>> - Java 1.6 Update 20
>> - Windows XP SP3
>> - Wanted to use DB for Apache ODE 2.0 Beta
>
>> That's how it was shown here: http://ode.apache.org/war-deployment.html
>
> Most unfortunate that they're suggesting very, very out of date practices.  Put the MySQL JDBC driver in Tomcat's lib directory, not common/lib (that was changed quite some time ago).  Place the following<Context>  element in webapps/ode/META-INF/context.xml:
>
> <Context reloadable="true" crossContext="true">
>    <Resource name="jdbc/ODEDB" auth="Container" type="javax.sql.DataSource"
>              maxActive="100" maxIdle="30" maxWait="10000"
>              username="root" password="" driverClassName="com.mysql.jdbc.Driver"
>              url="jdbc:mysql://localhost:3306/ode?autoReconnect=true"/>
> </Context>

I did and modified it to my database:

----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Context reloadable="true" crossContext="true">
   <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
             maxActive="100" maxIdle="30" maxWait="10000"
             username="test_dab" password="moep" 
driverClassName="com.mysql.jdbc.Driver"
 
url="jdbc:mysql://mysqlhost.uni-koblenz.de:3306/TestDB?autoReconnect=true"/>
</Context>
----------------------------------------

I also edited ode-axis2.properties to

----------------------------------------
ode-axis2.db.mode=EXTERNAL
ode-axis2.db.ext.dataSource=java:comp/env/jdbc/TestDB
----------------------------------------

after this, I get the this error log:

----------------------------------------
09.07.2010 08:59:04 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
09.07.2010 08:59:04 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters 
[false], ra
ndom [true].
09.07.2010 08:59:05 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1235 ms
09.07.2010 08:59:05 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
09.07.2010 08:59:05 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.0
09.07.2010 08:59:05 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive ode.war
DEBUG - GeronimoLog.debug(66) | Loading properties
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager using 
org.apach
e.ode.il.EmbeddedGeronimoFactory
DEBUG - GeronimoLog.debug(66) | Creating data source.
ERROR - GeronimoLog.error(108) | Failed to resolved external DataSource 
at "java
:comp/env/jdbc/TestDB".
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
         at org.apache.naming.NamingContext.lookup(NamingContext.java:774)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:157)
         at 
org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at 
org.apache.ode.il.dbutil.Database.lookupInJndi(Database.java:244)
         at 
org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:159)
         at 
org.apache.ode.il.dbutil.Database.initDataSource(Database.java:144)
         at org.apache.ode.il.dbutil.Database.start(Database.java:99)
         at 
org.apache.ode.axis2.ODEServer.initDataSource(ODEServer.java:218)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:157)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:116)
         at 
org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:53
)
         at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.
java:1164)
         at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1118)
         at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
05)
         at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4529)
         at 
org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:4800)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:785)
         at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:76
3)
         at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)

         at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987)

         at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778
)
         at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:540
)
         at 
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390)
         at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:355)
         at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
         at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
se.java:89)
         at 
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:31
2)
         at 
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:29
2)
         at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:998)
         at 
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java
:772)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:990)
         at 
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.
java:275)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.StandardService.startInternal(StandardServic
e.java:424)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.StandardServer.startInternal(StandardServer.
java:648)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
ERROR - GeronimoLog.error(108) | Error starting database connections, 
check the
database configuration!
org.apache.ode.il.dbutil.DatabaseConfigException: Failed to resolved 
external Da
taSource at "java:comp/env/jdbc/TestDB".
         at 
org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:164)
         at 
org.apache.ode.il.dbutil.Database.initDataSource(Database.java:144)
         at org.apache.ode.il.dbutil.Database.start(Database.java:99)
         at 
org.apache.ode.axis2.ODEServer.initDataSource(ODEServer.java:218)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:157)
         at org.apache.ode.axis2.ODEServer.init(ODEServer.java:116)
         at 
org.apache.ode.axis2.hooks.ODEAxisServlet.init(ODEAxisServlet.java:53
)
         at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.
java:1164)
         at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1118)
         at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
05)
         at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4529)
         at 
org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:4800)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:785)
         at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:76
3)
         at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)

         at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987)

         at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778
)
         at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:540
)
         at 
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390)
         at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:355)
         at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
         at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
se.java:89)
         at 
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:31
2)
         at 
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:29
2)
         at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:998)
         at 
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java
:772)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:990)
         at 
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.
java:275)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.StandardService.startInternal(StandardServic
e.java:424)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at 
org.apache.catalina.core.StandardServer.startInternal(StandardServer.
java:648)
         at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in 
this Co
ntext
         at org.apache.naming.NamingContext.lookup(NamingContext.java:774)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:144)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:785)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:157)
         at 
org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at 
org.apache.ode.il.dbutil.Database.lookupInJndi(Database.java:244)
         at 
org.apache.ode.il.dbutil.Database.initExternalDb(Database.java:159)
         ... 41 more
09.07.2010 08:59:11 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
09.07.2010 08:59:11 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
09.07.2010 08:59:12 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
09.07.2010 08:59:12 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
09.07.2010 08:59:12 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
09.07.2010 08:59:12 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
09.07.2010 08:59:12 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
09.07.2010 08:59:12 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
09.07.2010 08:59:12 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
09.07.2010 08:59:12 org.apache.catalina.startup.Catalina start
INFO: Server startup in 7072 ms
----------------------------------------

Any idea, what's wrong?

Greetings
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Connecting Tomcat to a database

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
> Subject: Re: Connecting Tomcat to a database
> 
> Sorry was in a haste, forgot much more than this. :-/
> - Tomcat 7.0.0
> - Java 1.6 Update 20
> - Windows XP SP3
> - Wanted to use DB for Apache ODE 2.0 Beta

> That's how it was shown here: http://ode.apache.org/war-deployment.html

Most unfortunate that they're suggesting very, very out of date practices.  Put the MySQL JDBC driver in Tomcat's lib directory, not common/lib (that was changed quite some time ago).  Place the following <Context> element in webapps/ode/META-INF/context.xml:

<Context reloadable="true" crossContext="true">
  <Resource name="jdbc/ODEDB" auth="Container" type="javax.sql.DataSource"
            maxActive="100" maxIdle="30" maxWait="10000"
            username="root" password="" driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/ode?autoReconnect=true"/>
</Context>

BTW, it's unlikely you need the crossContext attribute, and reloadable is on by default.  Note that the above requires MySQL to be running without a password (poor practice), unless you fill in the attribute.

> (that was [1] btw). What's the best solution for this?

See the Tomcat doc for <Context>:
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

> Where can I find them?

The logs are in the logs directory, oddly enough.

> "startup.bat" run didn't work

Read what I posted: use catalina.bat, not the startup.bat script.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connecting Tomcat to a database

Posted by Christian Bruckhoff <Ch...@gmx.de>.
Hi.

Am 08.07.2010 20:50, schrieb Caldarale, Charles R:
>> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
>> Subject: Connecting Tomcat to a database
>>
>> I need t connect Tomcat to a database
>
> What version of Tomcat?  What JVM?  What platform are you running Tomcat on?

Sorry was in a haste, forgot much more than this. :-/
- Tomcat 7.0.0
- Java 1.6 Update 20
- Windows XP SP3
- Wanted to use DB for Apache ODE 2.0 Beta

>
>> server.xml (inside the<Host>-Element):
>> ------------------------------------------------------
>> <Context path="/TestDB" docBase="TestDB" debug="5" reloadable="true"
>
> Extremely bad practice to put<Context>  elements in server.xml.  The proper location is in the webapp's META-INF/context.xml file.  When you do so, remove the path and docBase attributes, since they're not allowed when you have<Context>  in a proper location.  Also, the debug attribute hasn't been used in years, so get rid of that as well.

That's how it was shown here: http://ode.apache.org/war-deployment.html 
(that was [1] btw). What's the best solution for this?

>> <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"7
>
> What's that 7 hanging on the end?

May I typed it while pasting it into the message, but in the code 
there's no 7.

>> After I did this, Tomcat didn't work anymore. I even can't
>> debug it, because the Tomcat window dissapears to fast.
>
> Look in the Tomcat logs.  Also start Tomcat with "catalina.bat run" (or "catalina.sh run", depending on the platform - which you didn't tell us); this will run Tomcat in the current command window.

Where can I find them? "startup.bat" run didn't work. Tomcat is still 
started in another window.

Greeting
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Connecting Tomcat to a database

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christian Bruckhoff [mailto:Christian.Bruckhoff@gmx.de]
> Subject: Connecting Tomcat to a database
> 
> I need t connect Tomcat to a database

What version of Tomcat?  What JVM?  What platform are you running Tomcat on?

> server.xml (inside the <Host>-Element):
> ------------------------------------------------------
> <Context path="/TestDB" docBase="TestDB" debug="5" reloadable="true"

Extremely bad practice to put <Context> elements in server.xml.  The proper location is in the webapp's META-INF/context.xml file.  When you do so, remove the path and docBase attributes, since they're not allowed when you have <Context> in a proper location.  Also, the debug attribute hasn't been used in years, so get rid of that as well.

> <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"7

What's that 7 hanging on the end?

> After I did this, Tomcat didn't work anymore. I even can't 
> debug it, because the Tomcat window dissapears to fast.

Look in the Tomcat logs.  Also start Tomcat with "catalina.bat run" (or "catalina.sh run", depending on the platform - which you didn't tell us); this will run Tomcat in the current command window.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org