Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Can';无法从WildFly 10模块中找到spring上下文模式_Java_Spring_Jboss_Wildfly - Fatal编程技术网

Java Can';无法从WildFly 10模块中找到spring上下文模式

Java Can';无法从WildFly 10模块中找到spring上下文模式,java,spring,jboss,wildfly,Java,Spring,Jboss,Wildfly,我已经搜索和战斗了一整天,没有发现任何东西能够解决这个问题。我正在尝试将基于spring的应用程序迁移到WildFly 10(从遗留的JBoss应用服务器),但在部署时遇到了问题 对于这个应用程序,我有我的应用程序(MyApplication.war)和两个模块,Spring3.1.2和MyCustomJar.jar。自定义JAR包含springxml配置文件(这似乎是WildFly上出现的问题) WAR文件部署,spring容器初始化。但是,一旦它开始尝试从mycustomjar.jar处理b

我已经搜索和战斗了一整天,没有发现任何东西能够解决这个问题。我正在尝试将基于spring的应用程序迁移到WildFly 10(从遗留的JBoss应用服务器),但在部署时遇到了问题

对于这个应用程序,我有我的应用程序(MyApplication.war)和两个模块,Spring3.1.2和MyCustomJar.jar。自定义JAR包含springxml配置文件(这似乎是WildFly上出现的问题)

WAR文件部署,spring容器初始化。但是,一旦它开始尝试从mycustomjar.jar处理bean定义!myspring-app.xml它出错,因为它找不到spring上下文模式。包括wildfly的堆栈跟踪和my module+jboss部署结构。任何尝试的想法都将不胜感激。我已经完成了从spring模块导入/导出的每一个变体,我今天可以在网上找到这些变体,但完全没有效果

2017-03-02 14:58:08,282 INFO  [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 62) Refreshing Root WebApplicationContext: startup date [Thu Mar 02 14:58:08 EST 2017]; root of context hierarchy
2017-03-02 14:58:08,317 INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 62) Loading XML bean definitions from URL [jar:file:/c:/data/apps/wildfly-10.1.0.Final/modules/mycustomjar/mycustomjar.jar!/myspring-context.xml]
2017-03-02 14:58:08,518 INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 62) Loading XML bean definitions from class path resource [myspring-app.xml]
2017-03-02 14:58:08,575 INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 62) Loading XML bean definitions from class path resource [myspring-services.xml]
2017-03-02 14:58:08,676 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 62) Context initialization failed: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:myspring-services.xml]
Offending resource: URL [jar:file:/c:/data/apps/wildfly-10.1.0.Final/modules/mycustomjar/mycustomjar.jar!/myspring-context.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]
Offending resource: class path resource [myspring-services.xml]
org.springframework.spring

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.springframework.spring" slot="3.1.2">
    <resources>
        <resource-root path="org.springframework.aop-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.asm-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.aspects-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.beans-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.context-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.context.support-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.core-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.expression-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.instrument-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.instrument.tomcat-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.jdbc-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.jms-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.orm-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.oxm-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.test-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.transaction-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.web-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.web.portlet-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.web.servlet-3.1.2.RELEASE.jar" />
        <resource-root path="org.springframework.web.struts-3.1.2.RELEASE.jar" />
    </resources>
    <dependencies>
        <module name="javax.api" export="true" />
        <module name="javax.servlet.api" />
        <module name="org.apache.commons.logging" />
        <module name="org.jboss.vfs" />
        <module name="org.jboss.msc" />
    </dependencies>
</module>

MyCustomJar.jar

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="mycustomjar">
    <resources>
        <resource-root path="mycustomjar.jar" />
    </resources>
    <dependencies>
    </dependencies>
</module>

MyApplication.war jboss部署结构.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <deployment>
        <dependencies>
            <module name="javax.servlet.api" />
            <module name="org.springframework.spring" meta-inf="export" export="true" />
            <module name="mycustomjar" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>

编辑 我开始使用不同的spring版本进行测试,升级到3.2.14后,使用上面的配置,我能够让它运行起来,没有任何问题。架构文件是否位于3.1.2中的不同位置?它必须与那些特定的版本有关,因为一个简单的升级就可以修复一切