|
From: <jue...@we...> - 2003-07-02 12:05:31
|
Hi JP,
Such a configuration should work. Basically, JndiObjectFactoryBean does =
nothing else than look the given JNDI name and provide the object as =
bean reference, using "inContainer=3Dtrue" by default (prefixing =
"java:comp/env/" to the given name).
Have you tried accessing the DataSource manually via a JNDI =
InitialContext? Can you look it up under =
"java:comp/env/jdbc/sireneMYSQL" within your web application? If not, =
the fault is in JBoss' setup.
Juergen
-----Original Message-----
From: jp....@ti... [mailto:jp....@ti...]
Sent: Wednesday, July 02, 2003 1:53 PM
To: spr...@li...
Subject: [Springframework-developer] HELP jdbc with Jboss
Hi Juergen,
I have a big trouble. How to bound to a JDBC datasource on JBoss with =
the new framework?
I have already made this:
In applicationContext.xml:
<bean id=3D"dataSource" =
class=3D"com.interface21.jndi.JndiObjectFactoryBean">
<property =
name=3D"jndiName"><value>jdbc/sireneMYSQL</value></property>
</bean>
In jboss-web.xml:
<resource-ref>
<res-ref-name>jdbc/sireneMYSQL</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/MySqlSirDS</jndi-name>
</resource-ref>
In jboss(3.2.0) deploy dir, a file named mysql-ds.xml:
<datasources>
<local-tx-datasource>
<jndi-name>MySqlSirDS</jndi-name>
=
<connection-url>jdbc:mysql://localhost:3306/sirenedev</connection-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<user-name>sirene</user-name>
<password>xxxx</password>
</local-tx-datasource>
</datasources>
This worked well with the old framework with =
DataSourceUtils.getDataSourceFromJNDI("jdbc/sireneMYSQL").
But now Jboss is no more able to bound and provides this error:
14:19:35,125 WARN [jbossweb] =
com.interface21.context.ApplicationContextException: Cannot load =
configuration: problem in
stantiating or initializing beans; nested exception is:
com.interface21.beans.FatalBeanException: afterPropertiesSet on =
with name 'dataSource' threw an exception; neste
d exception is:
javax.naming.NameNotFoundException: jdbc not bound
javax.naming.NameNotFoundException: jdbc not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
at org.jnp.server.NamingServer.lookup(NamingServer.java:256)
at =
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
at =
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:606)
at =
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at =
com.interface21.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:78)
at =
com.interface21.jndi.JndiTemplate.execute(JndiTemplate.java:128)
at =
com.interface21.jndi.JndiTemplate.lookup(JndiTemplate.java:75)
at =
com.interface21.jndi.AbstractJndiLocator.lookup(AbstractJndiLocator.java:=
126)
at =
com.interface21.jndi.AbstractJndiLocator.afterPropertiesSet(AbstractJndiL=
ocator.java:121)
at =
com.interface21.beans.factory.support.AbstractBeanFactory.callLifecycleMe=
thodsIfNecessary(AbstractBeanFactory
.java:457)
at =
com.interface21.beans.factory.support.AbstractBeanFactory.createBean(Abst=
ractBeanFactory.java:125)
at =
com.interface21.beans.factory.support.AbstractBeanFactory.getSharedInstan=
ce(AbstractBeanFactory.java:171)
at =
com.interface21.beans.factory.support.AbstractBeanFactory.getBeanInternal=
(AbstractBeanFactory.java:238)
at =
com.interface21.beans.factory.support.AbstractBeanFactory.getBean(Abstrac=
tBeanFactory.java:219)
at =
com.interface21.beans.factory.support.ListableBeanFactoryImpl.preInstanti=
ateSingletons(ListableBeanFactoryImp
l.java:198)
at =
com.interface21.beans.factory.xml.XmlBeanFactory.loadBeanDefinitions(XmlB=
eanFactory.java:237)
at =
com.interface21.beans.factory.xml.XmlBeanFactory.loadBeanDefinitions(XmlB=
eanFactory.java:200)
at =
com.interface21.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.ja=
va:148)
at =
com.interface21.context.support.AbstractXmlApplicationContext.refreshBean=
Factory(AbstractXmlApplicationContex
t.java:40)
at =
com.interface21.context.support.AbstractApplicationContext.refresh(Abstra=
ctApplicationContext.java:207)
at =
com.interface21.web.context.support.XmlWebApplicationContext.setServletCo=
ntext(XmlWebApplicationContext.java:
120)
at =
com.interface21.web.context.ContextLoader.initContext(ContextLoader.java:=
56)
at =
com.interface21.web.context.ContextLoaderListener.contextInitialized(Cont=
extLoaderListener.java:20)
What is wrong?
Regards,
Jean-Pierre
********** SPECIAL ADSL **********
L'ADSL =E0 partir de 15,95 EUR/mois et le modem ADSL offert ? C'est en =
exclusivit=E9 chez Tiscali !
Pour profiter de cette offre, cliquez ici: =
http://register.tiscali.fr/adsl/
Offre soumise =E0 conditions.
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|