错误:ERROR com.xlands.ilove.dao.CohabitationJdbcDAO - javax.naming.NameNotFoundException: Name iloveDB is not bound in this Context
[JdonFramework] the method 'findModelByKey' of your handler or 'getMethod' of service happened error: java.lang.NullPointerException
ERROR com.jdon.strutsutil.util.EditeViewPageUtil - [JdonFramework]please check your service 、 model or form, error is: java.lang.Exception: java.lang.NullPointerException
这个数据源其实我是已经配好,
因为使用一下代码测试成功了:
test.jsp
Context initCtx=new InitialContext();
DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/iloveDB");
Connection conn=ds.getConnection();
不知道jdon里查找数据源的方式是怎样,那我应该还要作怎么样的工作。
注: 我在server.xml配的数据源,在web工程里的web.xml有引用:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/iloveDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>”