org.springframework.beans.factory.BeanDefinitionStoreException:从URL解析XML文档时发生意外异常

时间:2016-05-20 15:25:49

标签: java xml spring maven

我正在尝试使用maven运行我的项目但是我得到了以下异常

  org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [file:/home/system/oscars_home1/AuthZService/conf/server-cxf-http.xml]; nested exception is java.lang.RuntimeException: Could not process configuration.

我正在使用带有JDK 1.7的maven 3,这是文件server-cxf-http.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:sec="http://cxf.apache.org/configuration/security"
        xmlns:http="http://cxf.apache.org/transports/http/configuration"
        xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
        xmlns:cxf="http://cxf.apache.org/core"
        xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
        xsi:schemaLocation="
        http://cxf.apache.org/configuration/security
        http://cxf.apache.org/schemas/configuration/security.xsd
        http://cxf.apache.org/transports/http/configuration
        http://cxf.apache.org/schemas/configuration/http-conf.xsd
        http://cxf.apache.org/transports/http-jetty/configuration
        http://cxf.apache.org/schemas/configuration/http-jetty.xsd
        http://cxf.apache.org/core
        http://cxf.apache.org/schemas/core.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

  <!--  Comment out the following to suppress printing of messages -->
  <cxf:bus>
     <cxf:features>
         <cxf:logging/>
     </cxf:features>
  </cxf:bus>

  <httpj:engine-factory>
  <httpj:engine port="9190">
   </httpj:engine>
   </httpj:engine-factory>
 </beans>

这是我的pom.xml文件

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>net.es.oscars</groupId>
    <artifactId>OSCARS</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</parent>


<artifactId>authZ</artifactId>
<name>OSCARS authorization</name>




    <!-- puts all code & libraries in one jar -->
<pluginRepositories>
    <pluginRepository>
        <id>onejar-maven-plugin.googlecode.com</id>
        <url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
    </pluginRepository>
</pluginRepositories>

   <dependencies>
           <!-- common SOAP interfaces (from local repository) -->
    <dependency>
        <groupId>net.es.oscars</groupId>
        <artifactId>common-soap</artifactId>
        <version>${oscars.version}</version>
    </dependency>

    <!-- database (from local repository) -->
    <dependency>
        <groupId>net.es.oscars</groupId>
        <artifactId>database</artifactId>
        <version>${oscars.version}</version>
    </dependency>

    <!-- OSCARS utilities (from local repository) -->
    <dependency>
        <groupId>net.es.oscars</groupId>
        <artifactId>utils</artifactId>
        <version>${oscars.version}</version>
    </dependency>

       <!-- testing -->
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>5.8</version>
        <scope>test</scope>
        <classifier>jdk15</classifier>
    </dependency>
    <!-- database for unit tests -->
    <dependency>
        <groupId>org.hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
        <version>1.8.0.10</version>
        <scope>test</scope>
    </dependency>

    <!-- command-line parsing -->
    <dependency>
        <groupId>net.sf.jopt-simple</groupId>
        <artifactId>jopt-simple</artifactId>
        <version>3.0.1</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.1</version>
    </dependency>

   <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.0.7.RELEASE</version>
   </dependency>
  <!-- <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>2.5.6</version>
   </dependency>-->

</dependencies>

<build>
    <plugins>
        <plugin>
            <!-- copies default config file if one doesn't currently exist -->
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
                <execution>
                    <id>rm-copyProps</id>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks>
                            <ant antfile="${basedir}/build.xml">
                                <target name="copyProps"/>
                            </ant>
                        </tasks>
                    </configuration>
                </execution>
            </executions>
        </plugin>
                <!-- puts all code & libraries in one jar -->
        <plugin>
            <groupId>org.dstovall</groupId>
            <artifactId>onejar-maven-plugin</artifactId>
            <version>1.4.1</version>
            <executions>
                <execution>
                    <configuration>
                        <mainClass>net.es.oscars.authZ.common.Invoker</mainClass>
                        <classifier>onejar</classifier>
                    </configuration>
                    <goals>
                        <goal>one-jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <!-- specifically use java 1.5 to compile -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>

    </plugins>
</build>
 <profiles>
        <!--  run the test client -->
    <profile>
        <id>client</id>
        <build>
            <defaultGoal>test</defaultGoal>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>test</phase>
                            <goals>
                                <goal>java</goal>
                            </goals>
                            <configuration>
                                <classpathScope>test</classpathScope>
                                <mainClass>net.es.oscars.authZ.test.AuthZTest</mainClass>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
       </profile>
       <profile>
        <id>stubserver</id>
        <build>
            <defaultGoal>test</defaultGoal>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>test</phase>
                            <goals>
                                <goal>java</goal>
                            </goals>
                            <configuration>
                                <classpathScope>test</classpathScope>
                                <mainClass>net.es.oscars.authZ.test.stubserver.AuthZStubSoapServer</mainClass>
                                <arguments>
                                </arguments>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
 </profiles>

</project>

我已经添加了spring.beans作为依赖,但我仍然有同样的问题我对maven非常新,spring可以帮助我找到问题

mvn依赖的结果:树如下:

     maven-dependency-plugin:2.8:tree (default-cli) @ authZ ---
    [INFO] net.es.oscars:authZ:jar:0.0.1-SNAPSHOT
    [INFO] +- net.es.oscars:common-soap:jar:0.0.1-SNAPSHOT:compile
     [INFO] |  \- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.0.4:compile
    [INFO] |     +- xml-resolver:xml-resolver:jar:1.2:compile
    [INFO] |     +- asm:asm:jar:3.3.1:compile
    [INFO] |     +- org.apache.cxf:cxf-core:jar:3.0.4:compile
    [INFO] |     |  +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
    [INFO] |     |  |  \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
    [INFO] |     |  \- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.1:compile
    [INFO] |     +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.0.4:compile
    [INFO] |     +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.0.4:compile
    [INFO] |     |  \- org.apache.cxf:cxf-rt-wsdl:jar:3.0.4:compile
    [INFO] |     \- org.apache.cxf:cxf-rt-ws-addr:jar:3.0.4:compile
    [INFO] |        \- org.apache.cxf:cxf-rt-ws-policy:jar:3.0.4:compile
    [INFO] +- net.es.oscars:database:jar:0.0.1-SNAPSHOT:compile
    [INFO] |  +- org.hibernate:hibernate-core:jar:3.3.1.GA:compile
    [INFO] |  |  +- antlr:antlr:jar:2.7.6:compile
    [INFO] |  |  +- commons-collections:commons-collections:jar:3.1:compile
    [INFO] |  |  +- dom4j:dom4j:jar:1.6.1:compile
    [INFO] |  |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
    [INFO] |  |  \- org.slf4j:slf4j-api:jar:1.5.2:compile
    [INFO] |  +- javax.transaction:jta:jar:1.1:compile
    [INFO] |  +- org.hibernate:hibernate-jmx:jar:3.3.1.GA:compile
    [INFO] |  |  \- org.slf4j:slf4j-log4j12:jar:1.4.2:compile
    [INFO] |  +- commons-lang:commons-lang:jar:2.6:compile
    [INFO] |  +- javassist:javassist:jar:3.4.GA:compile
    [INFO] |  +- org.hibernate:hibernate-c3p0:jar:3.3.1.GA:compile
    [INFO] |  +- c3p0:c3p0:jar:0.9.1.2:compile
    [INFO] |  +- mysql:mysql-connector-java:jar:3.1.13:compile
    [INFO] |  +- org.jyaml:jyaml:jar:1.3:compile
    [INFO] |  \- log4j:log4j:jar:1.2.17:compile
    [INFO] +- net.es.oscars:utils:jar:0.0.1-SNAPSHOT:compile
    [INFO] |  +- net.perfsonar:ps-api:jar:0.5:compile
    [INFO] |  |  +- commons-httpclient:commons-httpclient:jar:3.0.1:compile
    [INFO] |  |  |  \- commons-codec:commons-codec:jar:1.2:compile
    [INFO] |  |  +- org.jdom:jdom:jar:1.1:compile
    [INFO] |  |  +- org.jdom:jaxen-jdom:jar:1.0-FCS:compile
    [INFO] |  |  +- org.jdom:jaxen-core:jar:1.0-FCS:compile
    [INFO] |  |  \- org.jdom:saxpath:jar:1.0-FCS:compile
    [INFO] |  +- net.es.oscars:common-logging:jar:0.0.1-SNAPSHOT:compile
    [INFO] |  |  \- gov.lbl:netlogger:jar:4.1.2:compile
    [INFO] |  +- org.mortbay.jetty:jetty:jar:6.1.16:compile
    [INFO] |  |  +- org.mortbay.jetty:jetty-util:jar:6.1.16:compile
    [INFO] |  |  \- org.mortbay.jetty:servlet-api:jar:2.5-20081211:compile
    [INFO] |  +- org.opensymphony.quartz:quartz:jar:1.6.1:compile
    [INFO] |  +- org.apache.ws.security:wss4j:jar:1.5.8:compile
    [INFO] |  |  +- commons-logging:commons-logging:jar:1.1:compile
    [INFO] |  |  |  +- logkit:logkit:jar:1.0.1:compile
    [INFO] |  |  |  +- avalon-framework:avalon-framework:jar:4.1.3:compile
    [INFO] |  |  |  \- javax.servlet:servlet-api:jar:2.3:compile
    [INFO] |  |  +- org.apache.santuario:xmlsec:jar:1.4.3:compile
    [INFO] |  |  \- xalan:xalan:jar:2.7.1:compile
    [INFO] |  |     \- xalan:serializer:jar:2.7.1:compile
    [INFO] |  +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.2.5:compile
    [INFO] |  |  +- org.apache.cxf:cxf-api:jar:2.2.5:compile
    [INFO] |  |  |  +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.2:compile
    [INFO] |  |  |  +- org.apache.ws.commons.schema:XmlSchema:jar:1.4.5:compile
    [INFO] |  |  |  +- org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1.1:compile
    [INFO] |  |  |  +- org.codehaus.woodstox:wstx-asl:jar:3.2.9:compile
    [INFO] |  |  |  +- org.apache.neethi:neethi:jar:2.0.4:compile
    [INFO] |  |  |  \- org.apache.cxf:cxf-common-schemas:jar:2.2.5:compile
    [INFO] |  |  +- org.apache.cxf:cxf-tools-common:jar:2.2.5:compile
    [INFO] |  |  |  +- wsdl4j:wsdl4j:jar:1.6.2:compile
    [INFO] |  |  |  \- com.sun.xml.bind:jaxb-impl:jar:2.1.12:compile
    [INFO] |  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.2.5:compile
    [INFO] |  |     \- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.6:compile
    [INFO] |  +- org.apache.cxf:cxf-rt-ws-security:jar:2.2.5:compile
    [INFO] |  |  +- org.apache.cxf:cxf-rt-core:jar:2.2.5:compile
    [INFO] |  |  +- org.apache.cxf:cxf-common-utilities:jar:2.2.5:compile
    [INFO] |  |  |  +- org.springframework:spring-context:jar:2.5.5:compile
    [INFO] |  |  |  |  \- aopalliance:aopalliance:jar:1.0:compile
    [INFO] |  |  |  \- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
   [INFO] |  |  +- javax.xml.soap:saaj-api:jar:1.3:compile
   [INFO] |  |  \- org.bouncycastle:bcprov-jdk15:jar:1.43:runtime
   [INFO] |  +- org.apache.cxf:cxf-rt-transports-http:jar:2.2.5:compile
   [INFO] |  |  \- org.springframework:spring-web:jar:2.5.5:compile
   [INFO] |  \- org.apache.cxf:cxf-rt-transports-http-jetty:jar:2.2.5:compile
   [INFO] |     \- org.apache.geronimo.specs:geronimo-servlet_2.5_spec:jar:1.2:compile
    [INFO] +- org.testng:testng:jar:jdk15:5.8:test
   [INFO] |  \- junit:junit:jar:3.8.1:compile
   [INFO] +- org.hsqldb:hsqldb:jar:1.8.0.10:test
    [INFO] +- net.sf.jopt-simple:jopt-simple:jar:3.0.1:compile
   [INFO] +- javax.xml.bind:jaxb-api:jar:2.1:compile
   [INFO] |  +- javax.xml.stream:stax-api:jar:1.0-2:compile
   [INFO] |  \- javax.activation:activation:jar:1.1:compile
    [INFO] \- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile
   [INFO]    \- org.springframework:spring-core:jar:3.0.7.RELEASE:compile
   [INFO]       \- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS

0 个答案:

没有答案