Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring : Tomcat datasource via JNDI in my Spring configuration Problem

 
sreekanth aleddulla
Greenhorn
Posts: 27
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
sreekanth aleddulla
Greenhorn
Posts: 27
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh sorry

I am facing a problem on that please
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use code tags
 
sreekanth aleddulla
Greenhorn
Posts: 27
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code tag ?
 
sreekanth aleddulla
Greenhorn
Posts: 27
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic