|
From: =?iso-8859-1?Q?<jp....@ti...> - 2003-07-02 15:40:01
|
Sorry, I missed to declare the datasource in web.xml.=0D=0AThis was a bit=
puzzling as the application based on the old framework worked well in th=
e same container. Therefore the Jboss configuration could not be suspecte=
d.=0D=0AAll is ok now.=0D=0A=0D=0ARegards,=0D=0AJean-Pierre=0D=0A=0D=0A--=
-------- Initial Header -----------=0D=0A=0D=0AFrom : j=FCrgen h=F6l=
ler [werk3AT] <jue...@we...>=0D=0ATo : <jp.pawlak=
@tiscali.fr>,<spr...@li...>=0D=0ACc =
: =0D=0ADate : Wed, 2 Jul 2003 14:04:36 +0200=0D=0ASubject : =
RE: [Springframework-developer] HELP jdbc with Jboss=0D=0A=0D=0AHi JP,=0D=
=0A=0D=0ASuch a configuration should work. Basically, JndiObjectFactoryBe=
an does nothing else than look the given JNDI name and provide the object=
as bean reference, using "inContainer=3Dtrue" by default (prefixing "jav=
a:comp/env/" to the given name).=0D=0A=0D=0AHave 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.=0D=0A=0D=0AJuergen=0D=0A=0D=0A=0D=0A-----Origin=
al Message-----=0D=0AFrom: jp....@ti... [mailto:jp.pawlak@tiscali=
.fr]=0D=0ASent: Wednesday, July 02, 2003 1:53 PM=0D=0ATo: springframework=
-dev...@li...=0D=0ASubject: [Springframework-developer=
] HELP jdbc with Jboss=0D=0A=0D=0A=0D=0AHi Juergen,=0D=0A=0D=0AI have a b=
ig trouble. How to bound to a JDBC datasource on JBoss with the new frame=
work?=0D=0A=0D=0AI have already made this:=0D=0A=0D=0AIn applicationConte=
xt.xml:=0D=0A <bean id=3D"dataSource" class=3D"com.interface21.jndi.Jn=
diObjectFactoryBean">=0D=0A <property name=3D"jndiName"><value>jdb=
c/sireneMYSQL</value></property>=0D=0A </bean>=0D=0A=0D=0AIn jboss-web=
.xml:=0D=0A <resource-ref>=0D=0A <res-ref-name>jdbc/sireneMYSQL=
</res-ref-name>=0D=0A <res-type>javax.sql.DataSource</res-type>=0D=
=0A <jndi-name>java:/MySqlSirDS</jndi-name>=0D=0A </resource-re=
f>=0D=0A=0D=0AIn jboss(3.2.0) deploy dir, a file named mysql-ds.xml:=0D=0A=
<datasources>=0D=0A <local-tx-datasource>=0D=0A <jndi-name>MySqlSirDS=
</jndi-name>=0D=0A <connection-url>jdbc:mysql://localhost:3306/sirened=
ev</connection-url>=0D=0A <driver-class>org.gjt.mm.mysql.Driver</drive=
r-class>=0D=0A <user-name>sirene</user-name>=0D=0A <password>xxxx</=
password>=0D=0A </local-tx-datasource>=0D=0A=0D=0A</datasources>=0D=0A=0D=
=0AThis worked well with the old framework with DataSourceUtils.getDataSo=
urceFromJNDI("jdbc/sireneMYSQL").=0D=0A=0D=0ABut now Jboss is no more abl=
e to bound and provides this error:=0D=0A14:19:35,125 WARN [jbossweb] co=
m.interface21.context.ApplicationContextException: Cannot load configurat=
ion: problem in=0D=0Astantiating or initializing beans; nested exception =
is:=0D=0A com.interface21.beans.FatalBeanException: afterPropertie=
sSet on with name 'dataSource' threw an exception; neste=0D=0Ad exception=
is:=0D=0A javax.naming.NameNotFoundException: jdbc not bound=0D=0A=
javax.naming.NameNotFoundException: jdbc not bound=0D=0A at org.jn=
p.server.NamingServer.getBinding(NamingServer.java:495)=0D=0A at o=
rg.jnp.server.NamingServer.getBinding(NamingServer.java:503)=0D=0A =
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)=0D=0A =
at org.jnp.server.NamingServer.lookup(NamingServer.java:253)=0D=0A =
at org.jnp.server.NamingServer.lookup(NamingServer.java:256)=0D=0A =
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)=
=0D=0A at org.jnp.interfaces.NamingContext.lookup(NamingContext.ja=
va:606)=0D=0A at org.jnp.interfaces.NamingContext.lookup(NamingCon=
text.java:471)=0D=0A at javax.naming.InitialContext.lookup(Initial=
Context.java:347)=0D=0A at com.interface21.jndi.JndiTemplate$1.doI=
nContext(JndiTemplate.java:78)=0D=0A at com.interface21.jndi.JndiT=
emplate.execute(JndiTemplate.java:128)=0D=0A at com.interface21.jn=
di.JndiTemplate.lookup(JndiTemplate.java:75)=0D=0A at com.interfac=
e21.jndi.AbstractJndiLocator.lookup(AbstractJndiLocator.java:126)=0D=0A =
at com.interface21.jndi.AbstractJndiLocator.afterPropertiesSet(Abst=
ractJndiLocator.java:121)=0D=0A at com.interface21.beans.factory.s=
upport.AbstractBeanFactory.callLifecycleMethodsIfNecessary(AbstractBeanFa=
ctory=0D=0A.java:457)=0D=0A at com.interface21.beans.factory.suppo=
rt.AbstractBeanFactory.createBean(AbstractBeanFactory.java:125)=0D=0A =
at com.interface21.beans.factory.support.AbstractBeanFactory.getShare=
dInstance(AbstractBeanFactory.java:171)=0D=0A at com.interface21.b=
eans.factory.support.AbstractBeanFactory.getBeanInternal(AbstractBeanFact=
ory.java:238)=0D=0A at com.interface21.beans.factory.support.Abstr=
actBeanFactory.getBean(AbstractBeanFactory.java:219)=0D=0A at com.=
interface21.beans.factory.support.ListableBeanFactoryImpl.preInstantiateS=
ingletons(ListableBeanFactoryImp=0D=0Al.java:198)=0D=0A at com.int=
erface21.beans.factory.xml.XmlBeanFactory.loadBeanDefinitions(XmlBeanFact=
ory.java:237)=0D=0A at com.interface21.beans.factory.xml.XmlBeanFa=
ctory.loadBeanDefinitions(XmlBeanFactory.java:200)=0D=0A at com.in=
terface21.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:148=
)=0D=0A at com.interface21.context.support.AbstractXmlApplicationC=
ontext.refreshBeanFactory(AbstractXmlApplicationContex=0D=0At.java:40)=0D=
=0A at com.interface21.context.support.AbstractApplicationContext.=
refresh(AbstractApplicationContext.java:207)=0D=0A at com.interfac=
e21.web.context.support.XmlWebApplicationContext.setServletContext(XmlWeb=
ApplicationContext.java:=0D=0A120)=0D=0A at com.interface21.web.co=
ntext.ContextLoader.initContext(ContextLoader.java:56)=0D=0A at co=
m.interface21.web.context.ContextLoaderListener.contextInitialized(Contex=
tLoaderListener.java:20)=0D=0A=0D=0A=0D=0AWhat is wrong?=0D=0A=0D=0ARegar=
ds,=0D=0AJean-Pierre=0D=0A=0D=0A=0D=0A********** SPECIAL ADSL **********=0D=
=0AL'ADSL =E0 partir de 15,95 EUR/mois et le modem ADSL offert ? C'est e=
n exclusivit=E9 chez Tiscali !=0D=0APour profiter de cette offre, cliquez=
ici: http://register.tiscali.fr/adsl/=0D=0AOffre soumise =E0 conditions.=
=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A-------------------------------------------=
------------=0D=0AThis SF.Net email sponsored by: Free pre-built ASP.NET =
sites including=0D=0AData Reports, E-commerce, Portals, and Forums are av=
ailable now.=0D=0ADownload today and enter to win an XBOX or Visual Studi=
o .NET.=0D=0Ahttp://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_=
061203_01/01=0D=0A_______________________________________________=0D=0ASp=
ringframework-developer mailing list=0D=0ASpringframework-developer@lists=
.sourceforge.net=0D=0Ahttps://lists.sourceforge.net/lists/listinfo/spring=
framework-developer=0D=0A=0A=0A********** SPECIAL ADSL **********=0AL'ADS=
L =E0 partir de 15,95 EUR/mois et le modem ADSL offert ? C'est en exclus=
ivit=E9 chez Tiscali !=0APour profiter de cette offre, cliquez ici: http:=
//register.tiscali.fr/adsl/=0AOffre soumise =E0 conditions.=0A
|