今天装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>
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>
解决方案 »
- servlet下载完成之后的文件名怎么是类名呢
- 大家帮我看看,关于web脚本的问题???
- 怎么用JAVA创建一个酒店管理系统登录界面。。。。。。急需!!!!
- jsp页面在条件语句中 转到其它页面
- 自动处理表格、纠正非法输入的问题
- 伪指令buffer中指定的默认缓冲区指的是什么?【疑问!】
- SQL语句问题
- 请问怎样在点击“超链接”之后,打开的窗口没有菜单、没有状态栏、没有常用工具、地址栏?
- 如何实现这种方式的打印?
- JSP里能引用SERVLET里的类吗?
- XML的DOCTYPE 标签问题
- java.io.IOException: CreateProcess error=3, ???????有高手知道怎么解决吗
将sql-map-config.xml数据库连接信息更换成你现在用的,确认数据源的名字是SampleDS