EJB3+JBOSS6+MySQL JBossResourceException: Could not create connection
开发EJB3是,JBoss连接MySQL数据库出现
09:40:30,890 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: com.mysql.jdbc.Driver, url: jdbc:mysql://localhost:3306/XXX) at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:261) [:6.0.0.Final] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:215) [:6.0.0.Final] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:648) [:6.0.0.Final]
这是因为mysql-connector-java-bin.jar的位置不对,我将这个jar文件放在项目的/WEB-INFO/lib底下,正确的位置应该放在jboss_server_home/lib下,默认即 JBOSS安装目录/server/default/lib,这个异常就会消失,虽然我也不知道为什么。
相关推荐
凯哥Java 2020-03-28
forliberty 2015-05-04
Strongding 2011-09-04
Congpanpan 2011-04-30
linuxisperfect 2008-10-27
tianshijianbing 2008-09-05
stoneechogx 2019-10-23
xieronghua 2019-10-11
姚强 2016-01-05
llystar 2017-08-10
lvzhiliang 2018-11-29
宁静致远 2017-08-10
菜鸟上路CCLinux 2014-11-06
85530194 2017-12-27
hunningtu 2011-07-15
farwang 2011-07-10
enen0 2011-05-12
mahy 2011-05-10