在基于WAS开发的系统中,SystemOut.log中经常出现如下信息:
如何解决这个警告:
[3/29/06 14:10:12:015 CST] 00000025 ConnectionFac W J2CA0294W: Deprecated usage of direct JNDI lookup of resource jdbc/whaty. The following default values are used: [Resource-ref settings]
res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
loginConfigurationName: null
loginConfigProperties: null
[Other attributes]
res-resolution-control: 999 (undefined)
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)
这是怎么回事呢?
其实这个警告信息并不影响应用的运行,主要是开发人员没有严格遵守J2EE规范引起的。通过如下方法来解决:
1,在程序中这样改lookup的参数:
javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/ecommDB");
2,web.xml中包含类似信息:
<resource-ref id="ResourceRef_1089625098453">
<res-ref-name>jdbc/ecommDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
3,ibm-web-bnd.xmi文件增加类似语句:
<resRefBindings xmi:id="ResourceRefBinding_1089625098453" jndiName="jdbc/ecommDB">
<bindingResourceRef href="WEB-INF/web.xml#ResourceRef_1089625098453"/>
</resRefBindings>
本文介绍了解决WebSphere应用服务器(WAS)中因直接使用JNDI查找资源而导致的警告信息的方法。该警告源于未遵循J2EE规范进行资源引用。文章提供了具体的修改步骤,包括更改程序中的lookup参数、更新web.xml配置以及修改ibm-web-bnd.xmi文件。
3076

被折叠的 条评论
为什么被折叠?



