You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dave Kennedy <va...@hotmail.com> on 2006/11/01 04:34:17 UTC

stdout trace from eclipse

More info:

This is the stdout trace from eclipse when the datasource is found

19:11:21,484  INFO NamingHelper:26 - JNDI InitialContext properties:{}
19:11:21,484  INFO DatasourceConnectionProvider:61 - Using datasource: 
java:comp/env/jdbc/hfydb
19:11:22,093  INFO SettingsFactory:81 - RDBMS: MySQL, version: 
5.0.24-community-nt
19:11:22,093  INFO SettingsFactory:82 - JDBC driver: MySQL-AB JDBC Driver, 
version: mysql-connector-java-3.1.13 ( $Date: 2005-11-17 15:53:48 +0100 
(Thu, 17 Nov 2005) $, $Revision$ )


>From: "Dave Kennedy" <va...@hotmail.com>
>Reply-To: "Tomcat Users List" <us...@tomcat.apache.org>
>To: users@tomcat.apache.org
>Subject: RE: JNDI Could not find datasource
>Date: Tue, 31 Oct 2006 16:29:56 -0800
>
>
>FYI
>I implemented this article
>Hibernate 3.1 Used with Tomcat 5.5.x
>http://www.theserverside.com/tt/articles/article.tss?l=HibernateTomcat
>
>Any help in identifying the difference between Tomcat/Eclipse and 
>"Standalone" would be appreciated
>
>>From: "Dave Kennedy" <va...@hotmail.com>
>>Reply-To: "Tomcat Users List" <us...@tomcat.apache.org>
>>To: users@tomcat.apache.org
>>Subject: JNDI Could not find datasource
>>Date: Tue, 31 Oct 2006 13:24:43 -0800
>>
>>ENV: Tomcat 5.5.17, Eclipse 3.2, Hibernate 3.2
>>
>>The application runs in Eclipse, but not "standalone" in Tomcat
>>What does Tomcat need to find the datasource?
>>Error:
>>13:09:03,936  INFO NamingHelper:26 - JNDI InitialContext properties:{}
>>13:09:03,936 FATAL DatasourceConnectionProvider:55 - Could not find 
>>datasource: java:comp/env/jdbc/hfydb
>>javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>>
>><?xml version='1.0' encoding='utf-8'?>
>><!DOCTYPE hibernate-configuration PUBLIC
>>"-//Hibernate/Hibernate Configuration DTD//EN"
>>"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
>>
>><hibernate-configuration>
>><session-factory>
>>	<!-- Use a Tomcat 5.5 JNDI datasource - see Context.xml -->
>>	<property name="connection.datasource">
>>		java:comp/env/jdbc/hfydb
>>	</property>
>>
>>	<!-- Echo all executed SQL to stdout -->
>>	<property name="show_sql">true</property>
>>	<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
>>	<property name="current_session_context_class">thread</property>
>>	<property 
>>name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
>>
>>	<!-- Drop and re-create the database schema on startup -->
>>	<property name="hibernate.hbm2ddl.auto">update</property>
>>
>>	<!-- Mapping files -->
>>	<mapping resource="mapping/tutorial.hbm.xml"/>
>>	<mapping resource="mapping/office.hbm.xml"/>
>>	<mapping resource="mapping/property.hbm.xml"/>
>>	<mapping resource="mapping/address.hbm.xml"/>
>>	<mapping resource="mapping/room.hbm.xml"/>
>>	<mapping resource="mapping/type.hbm.xml"/>
>></session-factory>
>></hibernate-configuration>
>>
>>
>>13:09:03,936  INFO NamingHelper:26 - JNDI InitialContext properties:{}
>>13:09:03,936 FATAL DatasourceConnectionProvider:55 - Could not find 
>>datasource: java:comp/env/jdbc/hfydb
>>javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>>	at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
>>	at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
>>	at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
>>	at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
>>	at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
>>	at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
>>	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
>>	at javax.naming.InitialContext.lookup(InitialContext.java:351)
>>	at 
>>org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
>>	at 
>>org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
>>	at 
>>org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
>>	at 
>>org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:397)
>>	at 
>>org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
>>	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933)
>>	at 
>>org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216)
>>	at tomcatJndi.HibernateUtil.<clinit>(HibernateUtil.java:27)
>>	at action.SearchPropertyAction.execute(SearchPropertyAction.java:35)
>>	at 
>>org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
>>	at 
>>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
>>	at 
>>org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>>	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
>>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>	at 
>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>>	at 
>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>	at 
>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>>	at 
>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>>	at 
>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>>	at 
>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>>	at 
>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>>	at 
>>org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>>	at 
>>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>>	at 
>>org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>>	at 
>>org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>>	at 
>>org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>>	at 
>>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>>	at java.lang.Thread.run(Thread.java:595)
>>
>>_________________________________________________________________
>>Say hello to the next generation of Search. Live Search – try it now. 
>>http://www.live.com/?mkt=en-ca
>>
>>
>>---------------------------------------------------------------------
>>To start a new topic, e-mail: users@tomcat.apache.org
>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>_________________________________________________________________
>Ready for the world's first international mobile film festival celebrating 
>the creative potential of today's youth? Check out Mobile Jam Fest for your 
>a chance to WIN $10,000! www.mobilejamfest.com
>
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>

_________________________________________________________________
Not only does Windows Live™ OneCare™ provide all-in-one PC care to keep your 
computer protected and well-maintained, but it also makes creating backup 
files a breeze. Try it today! 
http://ideas.live.com/programpage.aspx?versionid=b2456790-90e6-4d28-9219-5d7207d94d45&mkt=en-ca


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


RE: stdout trace from eclipse

Posted by Dave Kennedy <va...@hotmail.com>.
Hi Chuck,
Problem solved
The file must be named, context.xml, (lower case) in Windows as well.

Thanks

>From: "Caldarale, Charles R" <Ch...@unisys.com>
>Reply-To: "Tomcat Users List" <us...@tomcat.apache.org>
>To: "Tomcat Users List" <us...@tomcat.apache.org>
>Subject: RE: stdout trace from eclipse
>Date: Tue, 31 Oct 2006 23:06:07 -0600
>
> > From: Dave Kennedy [mailto:vancouverhg@hotmail.com]
> > Subject: RE: stdout trace from eclipse
> >
> > In Tomcat 5.5, you no longer use this server-wide file to
> > configure JNDI.
>
>I believe you can, in the situation where you want the data source to be
>visible to multiple webapps.  Take a look at this:
>http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html
>
> > Instead, you place a per-application file named (exactly)
> > Context.xml in your META-INF directory
>
>Actually, it must be named context.xml (lower case).  Upper case may
>work on Windows, but it won't on other platforms.
>
> > You may find references on the web indicating this file
> > should be named after your application
>
>This is true when you use the alternative location for your webapp's
><Context> element: conf/[engine]/[host]/[appname].xml; if you examine
>conf/Catalina/localhost in the standard 5.5 Tomcat installation, you'll
>see the .xml files for the manager and host-manager <Context> elements.
>Look here for more info:
>http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>
>  - 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 start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>

_________________________________________________________________
Say hello to the next generation of Search. Live Search – try it now. 
http://www.live.com/?mkt=en-ca


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


RE: stdout trace from eclipse

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Kennedy [mailto:vancouverhg@hotmail.com] 
> Subject: RE: stdout trace from eclipse
> 
> In Tomcat 5.5, you no longer use this server-wide file to 
> configure JNDI. 

I believe you can, in the situation where you want the data source to be
visible to multiple webapps.  Take a look at this:
http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html

> Instead, you place a per-application file named (exactly) 
> Context.xml in your META-INF directory

Actually, it must be named context.xml (lower case).  Upper case may
work on Windows, but it won't on other platforms.

> You may find references on the web indicating this file
> should be named after your application

This is true when you use the alternative location for your webapp's
<Context> element: conf/[engine]/[host]/[appname].xml; if you examine
conf/Catalina/localhost in the standard 5.5 Tomcat installation, you'll
see the .xml files for the manager and host-manager <Context> elements.
Look here for more info:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: stdout trace from eclipse

Posted by Dave Kennedy <va...@hotmail.com>.
Hi Chuck,
I followed the instructions in your links and the datasource is now found in 
Standalone Tomcat.
It seems that it is necessary to configure Tomcat JNDI via server.xml

I was following the instructions in this article, which do work for 
Eclipse/Tomcat
http://www.theserverside.com/tt/articles/article.tss?l=HibernateTomcat

In earlier versons of Tomcat, you configured Tomcat JNDI via the server-wide 
configuration file, server.xml. You included multiple <ResourceParams> 
elements within this file, one <ResourceParams> element per DataSource. In 
Tomcat 5.5, you no longer use this server-wide file to configure JNDI. 
Instead, you place a per-application file named (exactly) Context.xml into 
your META-INF directory, for instance C:\Tomcat 
5.5\webapps\BasicWeb\META-INF\ Context.xml. (You may find references on the 
web indicating this file should be named after your application, for 
instance YourApp.xml. That is not correct - you should use the unvarying 
filename Context.xml.)


>From: "Caldarale, Charles R" <Ch...@unisys.com>
>Reply-To: "Tomcat Users List" <us...@tomcat.apache.org>
>To: "Tomcat Users List" <us...@tomcat.apache.org>
>Subject: RE: stdout trace from eclipse
>Date: Tue, 31 Oct 2006 22:09:59 -0600
>
> > From: Dave Kennedy [mailto:vancouverhg@hotmail.com]
> > Subject: stdout trace from eclipse
> >
> > Any help in identifying the difference between Tomcat/Eclipse and
> > "Standalone" would be appreciated
>
>Have to tell you up front that I don't use Eclipse, am not fluent in
>JNDI, and don't know Hibernate - so take this with a large chunk of
>salt.  Nevertheless, it's looking like your datasource is not defined
>properly in your standalone version of Tomcat.  You should have entries
>for the datasource in the <Context> element of your webapp, and possibly
>also in conf/server.xml, if the datasource is shared across webapps.
>
>Try looking here and see if any of this makes sense:
>http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
>http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h
>tml
>
>  - 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 start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>

_________________________________________________________________
Buy, Load, Play. The new Sympatico / MSN Music Store works seamlessly with 
Windows Media Player. Just Click PLAY. 
http://musicstore.sympatico.msn.ca/content/viewer.aspx?cid=SMS_Sept192006


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


RE: stdout trace from eclipse

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Kennedy [mailto:vancouverhg@hotmail.com] 
> Subject: stdout trace from eclipse
> 
> Any help in identifying the difference between Tomcat/Eclipse and 
> "Standalone" would be appreciated

Have to tell you up front that I don't use Eclipse, am not fluent in
JNDI, and don't know Hibernate - so take this with a large chunk of
salt.  Nevertheless, it's looking like your datasource is not defined
properly in your standalone version of Tomcat.  You should have entries
for the datasource in the <Context> element of your webapp, and possibly
also in conf/server.xml, if the datasource is shared across webapps.

Try looking here and see if any of this makes sense:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h
tml

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org