现在的位置: 首页 > 综合 > 正文

Not supported by BasicDataSource Exception

2013年10月12日 ⁄ 综合 ⁄ 共 760字 ⁄ 字号 评论关闭

The problem seems to be that hibernate is calling the getConnection(id,
pw) method rather than the getConnection() method.

The first (id, pw) method is not valid for a pooled datasource.

It appears from the trace that hibernate is trying to manage it's own
connections.

When running in a web container hibernate should use the container
datasource pooling. The hibernate.properties file in WEB-INF/classes
should contain the property

hibernate.connection.datasource=java:comp/env/jdbc/calDB

and any jdbc properties should be absent (or commented out).

The hibernate.cfg.xml file should not contain any jdbc/datasource properties

Can you take a look at those files in the deployed application. You also
should have a context.xml file copied into conf/Catalina/localhost for
each deployed app. Is that there and does it look correct.

 

在hibernate.cfg.xml文件中不要再配置数据源链接信息,直接在tomcat中配置!

抱歉!评论已关闭.