These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Datasource connection with JNDI in JBOSS
PostPosted: Fri Sep 26, 2008 1:19 am 
Newbie

Joined: Fri Sep 26, 2008 12:56 am
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:Hibernate3.0

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs: ERROR [STDERR] org.hibernate.HibernateException: Could not find datasource
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:48)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:362)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)


Name and version of the database you are using:Oracle 9i

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

Hi,
I m trying to run one application in Jboss with jndi datasource connection. For that i did the following..
1) In jboss server\default\deploy folder we have oracle-ds.xml file which have the following entry.
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>XXXX</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>XXXX</user-name>
<password>XXXX</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</local-tx-datasource>

2) in the hibernate.cfg.xml file we have the following.....
<session-factory>
<property name="connection.driver_class">
sun.jdbc.odbc.JdbcOdbcDriver
</property>
<property name="dialect">
org.hibernate.dialect.Oracle9Dialect
</property>
<property name="connection.datasource">OracleDS</property>
<property name="show_sql">false</property>
<property name="cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</property>
<property name="query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</property>

While running my application i m getting the exception.
ERROR [STDERR] org.hibernate.HibernateException: Could not find datasource


Please share any ideas..



Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.