如何去除WAS数据源中类似的警告信息

在基于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>
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值