Datasource in WebSphere 5.1
Would like to know as to get one datasource with WebSphere 5,1 sp1? Currently I am using:
Code:
<!-- JNDI DataSource -->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/LINKPECAS"/>
</bean>
<!-- associa um template a um data source -->
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
But it does not function.
Quote:
[8/1/05 14:57:42:599 CDT] 79978418 DefaultListab I
org.springframework.beans.factory.support.DefaultL istableBeanFactory Destr
oying singletons in factory
{org.springframework.beans.factory.support.Default ListableBeanFactory
defining beans [propertyConf
igurer,dataSource,jdbcTemplate,pedidosDAO,usuarioD AO,trocaSenhaDAO,loginControlador,trocaSenhaContro lador,linkPecasControlador
,pedidosAutorizadosControlador,methodNameResolver, urlMapping,messageSource,viewResolver,exceptionRes olver,pedidosAutorizados,usuario,trocaSenha,pedido sAutorizadosValidacao,usuarioValidacao,trocaSenhaV alidacao];
root of BeanFactory hierarchy}
[8/1/05 14:57:42:609 CDT] 79978418 ContextLoader E
org.springframework.web.context.ContextLoader Context initialization
failed
[8/1/05 14:57:42:702 CDT] 79978418 ContextLoader E
org.springframework.web.context.ContextLoader TRAS0014I: The following exc
eption was logged org.springframework.beans.factory.BeanCreationExce ption:
Error creating bean with name 'dataSource' defined
in ServletContext resource [/WEB-INF/linkPecas-configJDBC.xml]:
Initialization of bean failed; nested exception is javax.namin
g.NameNotFoundException: Name comp/env/jdbc not found in context
"java:".javax.naming.NameNotFoundException: Name comp/env/jdbc not found in
context "java:".
at
com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInt ernal(NameSpace.java(Compiled
Code))
at
com.ibm.ws.naming.ipbase.NameSpace.lookupInternal( NameSpace.java(Compiled
Code))
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpac e.java(Inlined
Compiled Code))
at
com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(Ur lContextImpl.java(Compiled
Code))
at
com.ibm.ws.naming.java.javaURLContextRoot.lookup(j avaURLContextRoot.java(Compiled
Code))
at
com.ibm.ws.naming.java.javaURLContextRoot.lookup(j avaURLContextRoot.java(Compiled
Code))
at javax.naming.InitialContext.lookup(InitialContext. java(Compiled
Code))
at
org.springframework.jndi.JndiTemplate$1.doInContex t(JndiTemplate.java:123)
at
org.springframework.jndi.JndiTemplate.execute(Jndi Template.java:85)
at
org.springframework.jndi.JndiTemplate.lookup(JndiT emplate.java:121)
Thank's.
Carlos