aspose file tools*
The moose likes Spring and the fly likes Spring : Tomcat datasource via JNDI in my Spring configuration Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring : Tomcat datasource via JNDI in my Spring configuration Problem" Watch "Spring : Tomcat datasource via JNDI in my Spring configuration Problem" New topic
Author

Spring : Tomcat datasource via JNDI in my Spring configuration Problem

sreekanth aleddulla
Greenhorn

Joined: Feb 08, 2011
Posts: 27

Hi All,

I want to read Tomcat datasource via JNDI in my Spring configuration i am using oracle toplink
in spring applicationContext.xml i am using like below

<bean id="UserDatabase" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/ISM_rep_user"></property>
<property name="lookupOnStartup" value="true"></property>
<property name="cache" value="true"></property>
<property name="proxyInterface" value="javax.sql.DataSource"></property>
</bean>

and in tomcat/conf/context.xml i am using below

<Resource name="jdbc/ISM_rep_user"
auth="Container"
type="javax.sql.DataSource"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
maxActive="10"
maxIdle="5"
maxWait="15000"
username="ism_cust2"
password="iamse2_"
driverClassName="oracle.jdbc.OracleDriver" url="jdbcracle:thin:@xxx.gggg/>

and in web.xml i am using

<resource-ref>
<description>Connection Pool</description>
<res-ref-name>jdbc/ISM_rep_user</res-ref-name>
<res-type>javax.sql.Datasource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

I am still getting problem please give me some example

I am getting below Problem

[INFO] [talledLocalContainer] SEVERE: Exception sending context initialized even
t to listener instance of class org.springframework.web.context.ContextLoaderLis
tener
[INFO] [talledLocalContainer] org.springframework.beans.factory.BeanCreationExce
ption: Error creating bean with name 'org.springframework.context.weaving.Aspect
JWeavingEnabler#0': Initialization of bean failed; nested exception is org.sprin
gframework.beans.factory.BeanCreationException: Error creating bean with name 'l
oadTimeWeaver': Initialization of bean failed; nested exception is java.lang.Ill
egalStateException: ClassLoader [org.apache.catalina.loader.WebappClassLoader] d
oes NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a cust
om LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaa
gent:spring-agent.jar
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.Abs
tractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Please don't duplicate post the same question to three different threads. I deleted the ones in someone else's thread that you were hijacking. And I locked the one that was moved here from the wrong forum, and I am leaving just this one open.

I don't know what your resolution is, but based on the exception, it looks unrelated to your lookup of a datasource in a JNDI tree.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
sreekanth aleddulla
Greenhorn

Joined: Feb 08, 2011
Posts: 27

oh sorry

I am facing a problem on that please
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Please use code tags


Learning and Learning!-- Java all the way!
sreekanth aleddulla
Greenhorn

Joined: Feb 08, 2011
Posts: 27

code tag ?
sreekanth aleddulla
Greenhorn

Joined: Feb 08, 2011
Posts: 27

Hi ALL

Can anybody please let me know why i am getting the below error in (Tomcat datasource via JNDI in my Spring configuration Problem)


[INFO] [talledLocalContainer] org.springframework.beans.factory.BeanCreationExce
ption: Error creating bean with name 'org.springframework.context.weaving.Aspect
JWeavingEnabler#0': Initialization of bean failed; nested exception is org.sprin
gframework.beans.factory.BeanCreationException: Error creating bean with name 'l
oadTimeWeaver': Initialization of bean failed; nested exception is java.lang.Ill
egalStateException: ClassLoader [org.apache.catalina.loader.WebappClassLoader] d
oes NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a cust
om LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaa
gent:spring-agent.jar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring : Tomcat datasource via JNDI in my Spring configuration Problem
 
Similar Threads
struts 1.3 Data base connection pool
Problem with look up JNDI on JBOSS
Name jdbc is not bound in this Context :Error TomCat 6
help with Jboss datasource lookup with springs
Spring - How to read persistence.xml