2017-06-05 5 views
-1

Fehler:Fehler beim Lesen des Schemadokuments "http://www.springframework.org/schema/beans/spring-beans.xsd", weil 1) das Dokument nicht finden konnte;

Failed to read schema document ' http://www.springframework.org/schema/beans/spring-beans.xsd ', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .

ganze Fehler, als ich versuchte Versionsnummer in meiner launch.xml Datei

org.xml.sax.SAXParseException; lineNumber: 11; columnNumber: 116; schema_reference.4: Failed to read schema document 
     'http://www.springframework.org/schema/beans/spring-beans-4.2.xsd', because 1) could not find the document; 
     2) the document could not be read; 3) the root element of the document is not <xsd:schema>. 
     at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) 
     at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:99) 
     at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:392) 
     at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:306) 
     at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4164) 
     at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaWarning(XSDHandler.java:4155) 
     at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument1(XSDHandler.java:2488) 
     at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2185) 
     at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:569) 
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:613) 
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2446) 
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1766) 
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:740) 
     at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374) 
     at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:608) 
     at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3128) 
     at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:880) 
     at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) 
     at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) 
     at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:503) 
     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) 
     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) 
     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) 
     at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243) 
     at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:338) 
     at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75) 
     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388) 
     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) 
     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) 
     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) 
     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) 
     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) 
     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243) 
     at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127) 
     at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93) 
     at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) 
     at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451) 
     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) 
     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) 
     at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:290) 
     at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:592) 
Caused by: java.net.UnknownHostException: www.springframework.org 

Ich betreibe ein Projekt auf Eclipse angeben, auf Eclipse wird es keine Fehler geben. dann erstelle ich seinen Build und erzeuge ein jar mit Abhängigkeiten. Nachdem ich dieses jar auf den Unix-Server gestellt habe, erhalte ich einen Fehler nach der Ausführung.

Ich habe die gleichen Probleme auf Stapel, aber nicht in der Lage, es zu lösen.

Es folgt mein pom

<properties> 
     <jdk.version>1.8</jdk.version> 
     <spring.batch.version>3.0.6.RELEASE</spring.batch.version> 
     <spring.version>4.2.4.RELEASE</spring.version> 
     <junit.version>4.12</junit.version> 
</properties> 

meine launch.xml unter

<?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:batch="http://www.springframework.org/schema/batch" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:jdbc="http://www.springframework.org/schema/jdbc" 
    xsi:schemaLocation=" 
     http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd 
     http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> 

I Nummer versucht zu geben speciific Version ist bis zum Frühjahr-beans.xsd aber das Problem besteht nach wie vor Ich habe versucht, Ändern Sie die Version der Feder zu 3.2.2, dann tritt auch ein Fehler auf.

Ich überprüft in der Schemadatei in METAINF unten ist der Inhalt, aber ich konnte das genaue Problem nicht verstehen.

http\://www.springframework.org/schema/batch/spring-batch.xsd=/org/springframework/batch/core/configuration/xml/spring-batch-2.2.xsd 
http\://www.springframework.org/schema/batch/spring-batch-3.0.xsd=/org/springframework/batch/core/configuration/xml/spring-batch-3.0.xsd 
http\://www.springframework.org/schema/batch/spring-batch-2.2.xsd=/org/springframework/batch/core/configuration/xml/spring-batch-2.2.xsd 
http\://www.springframework.org/schema/batch/spring-batch-2.1.xsd=/org/springframework/batch/core/configuration/xml/spring-batch-2.1.xsd 
http\://www.springframework.org/schema/batch/spring-batch-2.0.xsd=/org/springframework/batch/core/configuration/xml/spring-batch-2.0.xsd 
http\://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd=/org/springframework/batch/core/jsr/configuration/xml/jobXML_1_0.xsd 
http\://xmlns.jcp.org/xml/ns/javaee/batchXML_1_0.xsd=/org/springframework/batch/core/jsr/configuration/xml/batchXML_1_0.xsd 

Wenn jemand eine Idee hat mich bitte

Antwort

0

Need schattierten Plugin hinzufügen, wie unten in Ihrem pom.xml

<plugin> 
    <!-- create an all-in-one executable jar with maven-shade-plugin 
     bound to phase:package 
     special handling for spring.handlers/spring.schemas files 
     to prevent overwriting (maven-shade-plugin joins them to 
     one file) 

     usage: 
     cd to <project>/target 
     java -jar hello-world-java-1.0-SNAPSHOT-executable.jar spring/batch/job/hello-world-job.xml helloWorldJob 
     -->      
       <artifactId>maven-shade-plugin</artifactId> 
       <version>1.7</version> 
       <executions> 
        <execution> 
         <phase>package</phase> 
         <goals> 
          <goal>shade</goal> 
         </goals> 
         <configuration> 
           <archive> 
            <manifest> 
             <mainClass>org.springframework.batch.core.launch.support.CommandLineJobRunner</mainClass> 
            </manifest> 
           </archive> 
           <descriptorRefs> 
            <descriptorRef>jar-with-dependencies</descriptorRef> 
           </descriptorRefs> 
          <transformers> 
           <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> 
            <mainClass>org.springframework.batch.core.launch.support.CommandLineJobRunner</mainClass> 
           </transformer> 
           <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> 
            <resource>META-INF/spring.handlers</resource> 
           </transformer> 
           <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> 
            <resource>META-INF/spring.schemas</resource> 
           </transformer> 
          </transformers> 
          <shadedArtifactAttached>true</shadedArtifactAttached> 
          <!-- configures the suffix name for the executable jar 
           here it will be '<project.artifact>-<project.version>-executable.jar'--> 
          <shadedClassifierName>jar-with-dependencies</shadedClassifierName> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
Verwandte Themen