ibatis数据源问题

verfication 2010-10-28 09:37:03
今天装ibatis版jpetstore,在公司部署没问题,正常运行,myeclipse+mysql5。回来后,用eclipse javaee + mysql5,却出现问题.异常信息如下:
Could not find datasource: java:/SampleDS
javax.naming.NameNotFoundException: Name SampleDS is not bound in this Context
------------------------分割线--------------------------------------------------
配置信息database.properies(sql-map-config中数据源引用该信息)
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/jpetstore
username=root
password=root
----------------------
web.xml中(以前也没配置过下面这几种参数,请教)
<resource-ref>
<description>
JPetStore DataSource
</description>
<res-ref-name>
jdbc/jpetstore1 //异常中是SampleDS,不懂
</res-ref-name>
<res-type>
javax.sql.DataSource
</res-type>
<res-auth>
Container
</res-auth>
</resource-ref>
...全文
43 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weinianjie1 2010-10-31
  • 打赏
  • 举报
回复
与web.xml无关,
将sql-map-config.xml数据库连接信息更换成你现在用的,确认数据源的名字是SampleDS

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧