I've actually tried it that way also ( as I believe I stated in my post,
though it may not have been clear )

In effect, that's the same as specifying resourceRef=true ( without the
leading "java:com/env" )

The net result is still the same error.




askxuefeng wrote:
> 
>  May be you should change the property value to:
> 
> <property name="jndiName" value="java:comp/env/jdbc/ds" />
> 
> 
>     Yours,
> sincerely,
> 
> Liao Xuefeng
> 
> Website: http://www.javaeedev.com
> Blog: http://askxuefeng.spaces.live.com
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of cilquirm
> Sent: Tuesday, February 06, 2007 3:19 AM
> To: resin-interest@caucho.com
> Subject: [Resin-interest] Problem using DBPool and Spring
> 
> 
> On Resin 3.022 ( running on a Java 1.5 install on a Solaris 10 Sparc
> environment ), I'm encountering a strange error when attempting to look up
> a
> datasource in JNDI via Spring's JNDIObjectFactoryBean.
> 
> My database is set up like so :
> 
>         <database>
>           <jndi-name>jdbc/ds</jndi-name>
>           <driver type="oracle.jdbc.pool.OracleConnectionPoolDataSource">
>             <url>jdbc:oracle:thin:@devdb01.myco.com:1521:DEV</url>
>             <user>scott</user>
>             <password>tiger</password>
>            </driver>
>           
> <prepared-statement-cache-size>8</prepared-statement-cache-size>
>            <max-connections>20</max-connections>
>            <max-idle-time>30s</max-idle-time>
>          </database>
> 
> In my application context, i have :
> 
>        <bean id="dataSource"
>                 class="org.springframework.jndi.JndiObjectFactoryBean">^
>                <property name="resourceRef" value="true"/>
>                 <property name="jndiName" value="jdbc/ds" />
>         </bean>
> 
> When starting up my application, I get a NameNotFoundException, thrown by
> ContextImpl :
> 
> [13:49:56.316] WebApp[http://localhost:9000/app] initializing
> [13:49:56.345]
> creating JNDI java: model for
> EnvironmentClassLoader$13599389[web-app:http://localhost:9000/app]
> parent:EnvironmentClassLoader$32380043[host:
> http://localhost:9000]
> [13:49:56.346] JNDI lookup `java:comp/env/caucho/auth' exception
> javax.naming.NameNotFoundException: java:comp/env/caucho/auth
> [13:49:56.346]
> javax.naming.NameNotFoundException: java:comp/env/caucho/auth
> [13:49:56.347]
> WebApp[http://localhost:9000/app] initialized [13:49:56.348]
> WebApp[http://localhost:9000/app] starting [13:49:56.426] real-path / ->
> /opt/resin/webapps/app/ [13:49:56.428] Set web app root system property:
> 'webapp.root' = [/opt/resin/webapps/app/] [13:49:56.449] Initializing
> Log4J
> from [classpath:log4j.properties] [13:49:58.599] Loading Spring root
> WebApplicationContext [13:50:00.316] real-path
> /WEB-INF/application-context.xml ->
> /opt/resin/webapps/app/WEB-INF/application-context.xml
> [13:50:03.548] JNDI lookup `java:comp/env/jdbc/ds' ->
> DBPool[java:comp/env/jdbc/ds] [13:50:05.843] JNDI lookup
> `java:/comp/env/jdbc/ds' exception
> javax.naming.NameNotFoundException: java:/comp/env/jdbc/ds
> 
> 
> Note that the 'java:comp/env/jdbc/ds' is changed to
> 'java:/comp/env/jdbc/ds'
> 
> ( leading slash before 'comp' ).
> which causes the lookup to fail.
> 
> I've checked the Spring source code and it seems to be making the lookup
> fine, generating the correct name.
> 
> Moreover, when i specify the jndi-name of the datasource to be
> "java:/comp/env/jdbc/ds" and the jndiName in my application context file
> to
> be 'java:/comp/env/jdbc/ds", then it works fine.
> 
> However, any combination of specifying "jdbc/ds" or
> "java:comp/env/jdbc/ds"
> as my jndi-name and the explicit path ( "java:comp/env/jdbc/ds" ) or the
> base path ( "jdbc/ds" ) with resourceRef=true,  it fails with the
> abovementioned error.
> 
> the normal convention of specifying "jdbc/ds" with resourceRef=true or the
> full name "java:comp/env/jdbc/ds"  in jndiName works just fine with other
> containers that I've attempted this test on, including Tomcat and Jetty.
> 
> Have I encountered a bug or am I too obtuse to be witness to my own
> stupidity?
> 
> Thanks for any help you can provide,
> 
> -a
> 
> 
> --
> View this message in context:
> http://www.nabble.com/Problem-using-DBPool-and-Spring-tf3176291.html#a881293
> 8
> Sent from the Resin mailing list archive at Nabble.com.
> 
> 
> 
> _______________________________________________
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-using-DBPool-and-Spring-tf3176291.html#a8819115
Sent from the Resin mailing list archive at Nabble.com.



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

Reply via email to