在Wildfly上部署Mongo应用程序

时间:2014-04-03 13:51:41

标签: spring mongodb wildfly wildfly-8

我有一个使用spring数据mongo的应用程序,我正在尝试在Wildfly 8上部署它。无论我做什么,我总是会遇到以下异常:

[org.jboss.msc.service.fail] (MSC service thread 1-11) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default- org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./....: Failed to start service
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: class org.springframework.data.mongodb.repository.config.MongoRepositoriesRegistrar is not assignable to interface org.springframework.context.annotation.ImportBeanDefinitionRegistrar
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:216)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
    ... 3 more
Caused by: java.lang.IllegalArgumentException: class org.springframework.data.mongodb.repository.config.MongoRepositoriesRegistrar is not assignable to interface org.springframework.context.annotation.ImportBeanDefinitionRegistrar
    at org.springframework.util.Assert.isAssignable(Assert.java:369)
    at org.springframework.util.Assert.isAssignable(Assert.java:352)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:129)
    at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:419)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:248)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:205)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:173)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:155)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:299)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:187)
    ... 7 more

我试图通过设置

来解决这个问题
bean-discovery-mode="none"
在beans.xml文件中

。我尝试的另一件事是禁用服务器的焊接(在standalone.xml配置文件中注释掉所有出现的配置文件和扩展名。)

此应用程序之前已部署在Glassfish 4上并且运行正常。

如果您有任何解决方案,请与我们联系。

谢谢!

0 个答案:

没有答案