JBoss AS7部署错误与缺少依赖项的数据源有关

时间:2012-12-18 08:45:43

标签: java jboss

我在JBoss AS7中部署了一个war文件,当我启用它时,它会给我以下错误,

14:00:05,700 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "JSPServletPoc.war"
14:00:29,749 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
14:00:30,156 INFO  [org.jboss.as.server] (HttpManagementService-threads - 7) JBAS015870: Deploy of deployment "JSPServletPoc.war" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.JSPServletPoc.JSPServletPoc.env.jdbc.MySQLDSJndijboss.naming.context.java.jboss.resources.jdbc.MySQLDSJndiMissing[jboss.naming.context.java.module.JSPServletPoc.JSPServletPoc.env.jdbc.MySQLDSJndijboss.naming.context.java.jboss.resources.jdbc.MySQLDSJndi]"]}
14:00:30,437 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment JSPServletPoc.war in 236ms
14:00:30,437 INFO  [org.jboss.as.controller] (HttpManagementService-threads - 7) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.naming.context.java.jboss.resources.jdbc.MySQLDSJndi (missing) dependents: [service jboss.naming.context.java.module.JSPServletPoc.JSPServletPoc.env.jdbc.MySQLDSJndi] 

我已将数据源配置为 MySQLDSJndi 并启用它。

我没有发现设置数据源的任何问题,我将数据源名称设为 MySQLDSJndi ,JNDI名称为 java:/ MySQLDSJndi 。此外,我已将用户名和密码以及连接URL指定为 jdbc:mysql:// localhost:3306 / testdb

我也怀疑为什么会出现错误消息,

JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

我在jar中检查了名为“META-INF / services / java.sql.Driver”的文件,因为该文件使jar成为符合JDBC的jar文件,并且它也存在。

2 个答案:

答案 0 :(得分:1)

驱动程序版本不兼容,您需要先将驱动程序注册为模块。

通读 安装JDBC驱动程序作为模块 @ How to configure datasource in Jboss As7

答案 1 :(得分:0)

MySQL驱动程序不兼容,因为它doesn't support SQL-92。 AFAIK复制到$JBOSS_HOME/standalone/deployments only works for compliant drivers, non-compliant drivers need to be deployed as a module