[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Tomcat 6 + Seam 2.0 + Hibernate - Cannot find datasour

billevans do-not-reply at jboss.com
Mon Mar 10 13:18:04 EDT 2008


Thank you, jaikirin...

I have fiddled with these names, adding & removing prefixes to no avail.

This is what my log tells me:

2008.03.10 10:10:25,176 DEBUG [Configuration] show_sql=true
2008.03.10 10:10:25,176 DEBUG [Configuration] dialect=org.hibernate.dialect.MySQLDialect
2008.03.10 10:10:25,176 DEBUG [Configuration] connection.datasource=java:/gaDatasource
2008.03.10 10:10:25,176 DEBUG [Configuration] cache.provider_class=org.hibernate.cache.HashtableCacheProvider
2008.03.10 10:10:25,176 DEBUG [Configuration] transaction.flush_before_completion=true
2008.03.10 10:10:25,176 DEBUG [Configuration] connection.release_mode=after_statement
2008.03.10 10:10:25,176 DEBUG [Configuration] transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
2008.03.10 10:10:25,176 DEBUG [Configuration] transaction.factory_class=org.hibernate.transaction.JTATransactionFactory

....
[Hibernate has found the datasource and appears to correctly connect it with a Session factory]


2008.03.10 10:10:25,518 INFO  [Configuration] Configured SessionFactory: java:/gadb
2008.03.10 10:10:25,518 DEBUG [Configuration] properties: {java.vendor=Sun Microsystems Inc., show_sql=true, sun.java.launcher=SUN_STANDARD, catalina.base=C:\apache-tomcat-6.0.14, sun.management.compiler=HotSpot Client Compiler, connection.datasource=java:/gaDatasource, catalina.useNaming=true, hibernate.transaction.flush_before_completion=true, os.name=Windows XP, sun.boot.class.path=c:\Program Files\Java\jdk1.5.0_12\jre\lib\rt.jar;c:\Program Files\Java\jdk1.5.0_12\jre\lib\i18n.jar;c:\Program Files\Java\jdk1.5.0_12\jre\lib\sunrsasign.jar;c:\Program Files\Java\jdk1.5.0_12\jre\lib\jsse.jar;c:\Program Files\Java\jdk1.5.0_12\jre\lib\jce.jar;c:\Program Files\Java\jdk1.5.0_12\jre\lib\charsets.jar;c:\Program Files\Java\jdk1.5.0_12\jre\classes, java.util.logging.config.file=C:\apache-tomcat-6.0.14\conf\logging.properties, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.5.0_12-b04, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, user.name=bevans, shared.loader=, tomcat.util.buf.StringCache.byte.enabled=true, hibernate.connection.release_mode=after_statement, hibernate.session_factory_name=java:/gadb, user.language=en, java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory, sun.boot.library.path=c:\Program Files\Java\jdk1.5.0_12\jre\bin, dialect=org.hibernate.dialect.MySQLDialect, java.version=1.5.0_12, java.util.logging.manager=org.apache.juli.ClassLoaderLogManager, user.timezone=America/Los_Angeles, sun.arch.data.model=32, java.endorsed.dirs=C:\apache-tomcat-6.0.14\endorsed, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=49.0, user.country=US, java.home=c:\Program Files\Java\jdk1.5.0_12\jre, java.vm.info=mixed mode, sharing, os.version=5.1, transaction.factory_class=org.hibernate.transaction.JTATransactionFactory, hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory, hibernate.connection.datasource=java:/gaDatasource, path.separator=;, java.vm.version=1.5.0_12-b04, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup, java.naming.factory.url.pkgs=org.apache.naming, user.home=C:\Documents and Settings\bevans, java.specification.vendor=Sun Microsystems Inc., java.library.path=c:\Program Files\Java\jdk1.5.0_12\bin;.;C:\WINDOWS\system32;C:\WINDOWS;c:\program files\java\jdk1.5.0_12\bin;C:\oracle\product\10.2.0\db_1\bin;C:\Eclipse\plugins\org.tigris.subversion.javahl.win32_1.2.2;C:\oracle\product\10.2.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\apache-ant-1.7.0\bin, java.vendor.url=http://java.sun.com/, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLDialect, common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, java.class.path=c:\Program Files\Java\jdk1.5.0_12\lib\tools.jar;C:\apache-tomcat-6.0.14\bin\bootstrap.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, catalina.home=C:\apache-tomcat-6.0.14, sun.cpu.endian=little, sun.os.patch.level=Service Pack 2, java.io.tmpdir=C:\apache-tomcat-6.0.14\temp, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, connection.release_mode=after_statement, server.loader=, transaction.flush_before_completion=true, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=c:\Program Files\Java\jdk1.5.0_12\jre\lib\ext, user.dir=C:\apache-tomcat-6.0.14\bin, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, cache.provider_class=org.hibernate.cache.HashtableCacheProvider, file.encoding=Cp1252, hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup, java.specification.version=1.5, hibernate.show_sql=true}
2008.03.10 10:10:25,518 DEBUG [Configuration] Preparing to build session factory with filters : {}
2008.03.10 10:10:25,518 DEBUG [Configuration] processing extends queue
2008.03.10 10:10:25,518 DEBUG [Configuration] processing collection mappings

....

[Then, when my code actually tries to get a session it barfs:]


2008.03.10 10:10:25,533 DEBUG [Configuration] resolving reference to class: com.ga.riskapp.session.UserSessionView
2008.03.10 10:10:25,563 INFO  [NamingHelper] JNDI InitialContext properties:{}
2008.03.10 10:10:25,563 FATAL [DatasourceConnectionProvider] Could not find datasource: java:/gaDatasource
javax.naming.NameNotFoundException: Name gaDatasource is not bound in this Context
	at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
	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:414)
	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
	at com.ga.riskapp.config.dbsource.AppWideSettings.(AppWideSettings.java:72)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135397#4135397

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135397




More information about the jboss-user mailing list