Can you try?:

 

<property name="connection.datasource">jdbc/RO_DS1</property>

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Guru
Sent: Monday, December 03, 2007 10:39 AM
To: General Discussion for the Resin application server
Subject: Re: [Resin-interest] Could not find datasource

 

Hi,

Thanks for you immediate response. My hibernate config is as follows.

        <property
name="connection.datasource">java:comp/env/jdbc/RO_DS1</property>
        <property name="dialect">
org.hibernate.dialect.Oracle9Dialect</property>
        <property
name="myeclipse.connection.profile">dev-local</property>
        <property name="show_sql">true</property> 
        <property name="format_sql">true</property>
        <property
name="cache.provider_class">org.hibernate.cache.EhCacheProvider</propert
y>
        <property name="generate_statistics">true</property> 

Which is referring to the datasource created in resin.conf. Please let
me know is there any other reason for the class cast exception.

Thanks,
KG




On Dec 3, 2007 11:31 AM, Mattias Jiderhamn < [EMAIL PROTECTED]>
wrote:

You should probably check your Hibernate configuration. It seems you are
not providing the JDNI reference to the actual DataSource.

 /Mattias

Guru wrote (2007-12-03 17:18): 

        Hi,
        
        I am trying to connect to Oracle 10g using Resin 3.0.14. My jdk
version is 1.5.0.13. I am getting the following error while trying to
lookup the datasource configured in resin.conf. 
        
        Caused by: org.hibernate.HibernateException: Could not find
datasource at
org.hibernate.connection.DatasourceConnectionProvider.configure(Datasour
ceConnectionProvider.java:56) at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider
(ConnectionProviderFactory.java:124) at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider
(ConnectionProviderFactory.java:56) at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFacto
ry.java:385) at
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:61)
at
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1
211) at
com.thc.common.util.HibernateFactory.currentSession(HibernateFactory.jav
a:38) ... 18 more 
        
        Caused by: java.lang.ClassCastException:
com.caucho.naming.ContextImpl at
org.hibernate.connection.DatasourceConnectionProvider.configure(Datasour
ceConnectionProvider.java:52) ... 25 more 
        
        My database configuration in resin.conf is,
        
            <database>
                <jndi-name>jdbc/RO_DS1</jndi-name>
                <driver>
        
<type>oracle.jdbc.pool.OracleConnectionPoolDataSource </type>
        
<url>jdbc:oracle:thin:@localhost:1521:xxxxx</url>
                        <user>username</user>
                        <password>password</password>
                </driver> 
                        <max-connections>20</max-connections>
                        <max-idle-time>30</max-idle-time>
                        <max-active-time>6</max-active-time>
                        <max-pool-time>24</max-pool-time> 
                        <connection-wait-time>30</connection-wait-time>
                        <ping-table>dual</ping-table>
                        <spy>false</spy>
            </database>
        
        Any help in this regard is greatly appreciated.
        
        
        Thanks,
        KG

 


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

 

_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to