今天装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>