Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.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
Spring 我面临检测到的循环加载异常_Spring_Cxf - Fatal编程技术网

Spring 我面临检测到的循环加载异常

Spring 我面临检测到的循环加载异常,spring,cxf,Spring,Cxf,我得到以下异常 线程“main”org.springframework.beans.factory.parsing异常:配置问题:无法从相对位置[cxf.xml]导入bean定义 有问题的资源:文件[C:\Documents and Settings\ashriv5\odin\cxfrestfulturial\cxf.xml];嵌套异常为org.springframework.beans.factory.BeanDefinitionStoreException:检测到文件的循环加载 下面是cxf

我得到以下异常

线程“main”org.springframework.beans.factory.parsing异常:配置问题:无法从相对位置[cxf.xml]导入bean定义 有问题的资源:文件[C:\Documents and Settings\ashriv5\odin\cxfrestfulturial\cxf.xml];嵌套异常为org.springframework.beans.factory.BeanDefinitionStoreException:检测到文件的循环加载

下面是cxf.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:jaxrs="http://cxf.apache.org/jaxrs"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd">

    <import resource="cxf.xml" />
    <jaxrs:server id="base" address="/rest">
        <jaxrs:serviceBeans>
            <ref bean="StudentService" />
        </jaxrs:serviceBeans>
    </jaxrs:server>
    <bean id="StudentService" class="com.student.ChangeStudentDetailsImpl" />
</beans>

下面是我的web.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="WebApp_ID" version="3.0">
    <display-name>CXFRestfulTutorial</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>WEB-INF/cxf.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>CXFServlet</servlet-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>
    <servlet>
        <display-name>Apache-Axis Servlet</display-name>
        <servlet-name>AxisServlet</servlet-name>
        <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/servlet/AxisServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>*.jws</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>
    <servlet>
        <display-name>Axis Admin Servlet</display-name>
        <servlet-name>AdminServlet</servlet-name>
        <servlet-class>org.apache.axis.transport.http.AdminServlet</servlet-class>
        <load-on-startup>100</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>AdminServlet</servlet-name>
        <url-pattern>/servlet/AdminServlet</url-pattern>
    </servlet-mapping>
</web-app>

CXF结果
index.html
index.htm
index.jsp
上下文配置位置
WEB-INF/cxf.xml
org.springframework.web.context.ContextLoaderListener
CXF服务器
org.apache.cxf.transport.servlet.CXFServlet
1.
CXF服务器
/*
ApacheAxisServlet
AxisServlet
org.apache.axis.transport.http.AxisServlet
AxisServlet
/servlet/AxisServlet
AxisServlet
*jws先生
AxisServlet
/服务/*
Axis管理Servlet
AdminServlet
org.apache.axis.transport.http.AdminServlet
100
AdminServlet
/servlet/AdminServlet

cxf.xml正在导入cxf.xml。感谢您指出,我将名称改为beans.xml仍然面临这个问题。您的beans.xml是什么?名称无关紧要。。。如果您正在加载[whatevername].xml,而该文件正在导入[whatevername].xml,那么您仍然会遇到相同的问题。。。删除导入。谢谢。。它解决了问题。