Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/365.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 与CXF 2.4.10相关的Spring初始化故障_Java_Web Services_Spring_Apache_Cxf - Fatal编程技术网

Java 与CXF 2.4.10相关的Spring初始化故障

Java 与CXF 2.4.10相关的Spring初始化故障,java,web-services,spring,apache,cxf,Java,Web Services,Spring,Apache,Cxf,我们有一个采用以下技术的工作系统 <spring-version>3.0.1.RELEASE</spring-version> <quartz-version>1.5.2</quartz-version> <axi2-version>1.5.4</axi2-version> <cxf.version>2.2.12</cxf.version> 我已经阅读了迁移文档,但是找不到任何关于我问题的答案 这就

我们有一个采用以下技术的工作系统

<spring-version>3.0.1.RELEASE</spring-version>
<quartz-version>1.5.2</quartz-version>
<axi2-version>1.5.4</axi2-version>
<cxf.version>2.2.12</cxf.version>
我已经阅读了迁移文档,但是找不到任何关于我问题的答案

这就是我的shortnened pom.xml的样子

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring-version>3.2.0.RELEASE</spring-version>
        <cxf.version>2.6.0</cxf.version>
        <aspectjrt-version>1.6.2</aspectjrt-version>
        <aspectjweaver-version>1.5.0</aspectjweaver-version>
        <log4j-version>1.2.17</log4j-version>
    </properties>

    <dependencies>

        <!-- CXF Dependencies -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-api</artifactId>
            <version>${cxf.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-security</artifactId>
            <version>${cxf.version}</version>
        </dependency>

        <!-- Spring Dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring-version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring-version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring-version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.ws.xmlschema</groupId>
            <artifactId>xmlschema-core</artifactId>
            <version>2.0.3</version>
        </dependency>
    </dependencies>
这是我的webservice实现

    @WebService(endpointInterface = "tr.com.fourplay.ws.services.user.UserWSIF")
    public class UserWSImpl implements UserWSIF
这是我的配置xml

    <bean id="userDBImpl" class="tr.com.fourplay.db.services.user.UserDBImpl" />
    <bean id="userSrv" class="tr.com.fourplay.ws.services.user.UserWSImpl" >
        <property name="dbImpl" ref="userDBImpl" />
    </bean>

    <jaxws:endpoint id="userService" implementor="#userSrv" address="/userService" >
    </jaxws:endpoint>

这是我的web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

        <display-name>Mobile Service Platform</display-name>

        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                classpath:application-context.xml
            </param-value>
        </context-param>

        <servlet>
            <servlet-name>CXFServlet</servlet-name>
            <display-name>CXF Servlet</display-name>
            <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>

        <servlet-mapping>
            <servlet-name>CXFServlet</servlet-name>
            <url-pattern>/*</url-pattern>
        </servlet-mapping>

    </web-app>

移动服务平台
org.springframework.web.context.ContextLoaderListener
上下文配置位置
类路径:application-context.xml
CXF服务器
cxfservlet
org.apache.cxf.transport.servlet.CXFServlet
1.
CXF服务器
/*
我们将非常感谢您的帮助。

问题与配置有关

Hi,

Cxf bus refactor a lot since cxf 2.4.0.
In your spring configuration
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
is unnecessary
and you need change
<bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl" />
to something like
<cxf:bus/>

Freeman
你好,
自Cxf 2.4.0以来,Cxf总线进行了大量重构。
在spring配置中
没有必要
你需要改变
差不多
弗里曼

在您的配置xml中,您是否导入了资源cxf.xml、cxf-servlet.xml和cxf-extension-soap.xml?是的,Manuel,它们在这里我没有导入cxf-extension-soap.xml这里是来自cxf官方网站的一个小信息。CXF 2.4.x中的更改上述内容适用于CXF 2.3.x及更高版本。从CXF 2.4.0开始,扩展名由CXF自动在内部加载,您不需要导入所有的CXF扩展名-*.xml文件。您只需要导入类路径:META-INF/cxf/cxf.xml。您能提供完整的WEB.xml和/或cxf-servlet.xml吗?我面临类似的问题,您能提供帮助吗
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

        <display-name>Mobile Service Platform</display-name>

        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                classpath:application-context.xml
            </param-value>
        </context-param>

        <servlet>
            <servlet-name>CXFServlet</servlet-name>
            <display-name>CXF Servlet</display-name>
            <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>

        <servlet-mapping>
            <servlet-name>CXFServlet</servlet-name>
            <url-pattern>/*</url-pattern>
        </servlet-mapping>

    </web-app>
Hi,

Cxf bus refactor a lot since cxf 2.4.0.
In your spring configuration
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
is unnecessary
and you need change
<bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl" />
to something like
<cxf:bus/>

Freeman