【发布时间】:2015-06-20 18:25:03
【问题描述】:
在将连接到 mongodb 的 war 文件部署到 jboss 时,出现以下错误:
Request
{
"address" => [("deployment" => "moc-public-api-1.0_SNAPSHOT.war")],
"operation" => "deploy"
}
Response
Internal Server Error
{
"outcome" => "failed",
"failure-description" => {
"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./public-api/v1" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./public-api/v1: Failed to start service
Caused by: java.lang.NoClassDefFoundError: org/jboss/resteasy/core/ResourceMethod
Caused by: java.lang.ClassNotFoundException: org.jboss.resteasy.core.ResourceMethod from [Module \"deployment.moc-public-api-1.0_SNAPSHOT.war:main\" from Service Module Loader]"},
"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => ["jboss.deployment.unit.\"moc-public-api-1.0_SNAPSHOT.war\".deploymentCompleteService"],
"Services that may be the cause:" => ["jboss.jdbc-driver.mongoDriver"]
}
},
"rolled-back" => true
}
我的standalone.xml中的数据源是这样的:
<datasource jndi-name="java:/mongoDS" pool-name="mongoDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mongodb://localhost:27017/test</connection-url>
<driver>mongoDriver</driver>
<security>
<user-name></user-name>
<password></password>
</security>
</datasource>
而我的standalone.xml中的驱动是这样的:
<driver name="mongoDriver" module="com.mongodb">
<xa-datasource-class>com.mongodb.jdbc.Driver</xa-datasource-class>
</driver>
错误显示"Services that may be the cause:" => ["jboss.jdbc-driver.mongoDriver"],我的mongodb jdbc驱动配置正确吗?
【问题讨论】:
-
你试过最新的驱动吗?