2012-12-03 19 views
12

मैं ग्रहण में एक Maven वसंत परियोजना है और मैं अपने वसंत संदर्भों में से एक में इस कष्टप्रद त्रुटि संदेश है:त्रुटि

संदर्भित फ़ाइल त्रुटियों (जार: फ़ाइल:/M2_HOME/भंडार/संगठन/springframework/वसंत-सेम/3.1.2.RELEASE/वसंत-सेम-3.1.2.RELEASE.jar!/org/springframework/सेम ​​/ फैक्टरी/एक्सएमएल/वसंत-उपकरण-3.1.xsd)। अधिक जानकारी के लिए सही समस्याएं दृश्य में संदेश पर क्लिक करें और "विवरण दिखाएं ..."

शो setails इस की ओर जाता है:

enter image description here

मैं वसंत-डेटा- का उपयोग कर जेपीए 1.2.0.RELEASE और मेरे बाकी वसंत जार 3.1.3 हैं। रिलीज। वसंत-डेटा-कॉमन्स-कोर के बारे में - मेरे पास अपने पोम में इस जार की निर्भरता भी नहीं है, लेकिन मैं इसे अपने एम 2 रिपोजिटरी में वसंत-डेटा-कॉमन्स-पैरेंट और संस्करण 1.4.0 दोनों के साथ देख सकता हूं। RELEASE , मुझे नहीं पता क्यों (शायद वे वसंत-डेटा-जेपीए का हिस्सा हैं?)।

मेरा आवेदन संदर्भ स्कीमा:

<?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:p="http://www.springframework.org/schema/p" 
    xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:jpa="http://www.springframework.org/schema/data/jpa" 
    xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd 
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd 
    http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.2.xsd"> 

मुझे समझ नहीं आता क्यों मैं इस त्रुटि प्राप्त हो रही। मूल रूप से यह कोई प्रभाव नहीं क्या तो कभी, एप्लिकेशन, संकलित तैनात और ठीक चलाता है, यह है कि मुझे पागल :)

उत्तर

11

मैं 3 चीजों को करने से इसे हल किया है ड्राइव ग्रहण में सिर्फ इस कष्टप्रद लाल त्रुटि चिह्न है:

  1. जोड़ा गया मेरी पोम को यह भंडार:

    <repository> 
        <id>spring-milestone</id> 
        <name>Spring Maven MILESTONE Repository</name> 
        <url>http://repo.springsource.org/libs-milestone</url> 
    </repository> 
    
  2. मैं वसंत-जेपीए के इस संस्करण का उपयोग कर रहा:

    <dependency> 
        <groupId>org.springframework.data</groupId> 
        <artifactId>spring-data-jpa</artifactId> 
        <version>1.2.0.RELEASE</version> 
    </dependency> 
    
  3. मैं अपने संदर्भ से XSD संस्करणों हटा दिया (हालांकि मैं यह आवश्यक है यकीन नहीं है):

    <?xml version="1.0" encoding="UTF-8"?> 
    <beans xmlns="http://www.springframework.org/schema/beans" 
        xmlns:context="http://www.springframework.org/schema/context" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc" 
        xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:tx="http://www.springframework.org/schema/tx" 
        xsi:schemaLocation=" 
        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 
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd 
        http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd 
        http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd"> 
    

मुझे आशा है कि इस मदद करता है।

+0

दोस्त एक आकर्षण की तरह काम करता है, मोंगोडब के लिए भी! (कई चाल के साथ)। मैंने इसे एक अलग उत्तर के रूप में जोड़ा, धन्यवाद! – tugcem

+0

सुनकर खुशी हुई :) – forhas

3

मैं हाल ही में जेपीए-1.3

कुछ भी नहीं काम किया जब तक मैं स्पष्ट tools.xsd लिंक

xsi:schemaLocation=" ... 
    http://www.springframework.org/schema/tool 
    http://www.springframework.org/schema/tool/spring-tool-3.2.xsd 
    ... "> 

इस तरह इस्तेमाल किया के साथ एक ही मुद्दा था:

<?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:p="http://www.springframework.org/schema/p" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:jdbc="http://www.springframework.org/schema/jdbc" 
    xmlns:jpa="http://www.springframework.org/schema/data/jpa" 
    xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.2.xsd 
     http://www.springframework.org/schema/tx 
     http://www.springframework.org/schema/tx/spring-tx-3.2.xsd 
     http://www.springframework.org/schema/jdbc 
     http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd 
     http://www.springframework.org/schema/data/jpa 
     http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd 
     http://www.springframework.org/schema/tool 
     http://www.springframework.org/schema/tool/spring-tool-3.2.xsd 
     "> 
+0

वसंत संदर्भ 4.2 के साथ एक ही समस्या। और इसे हल किया। दिलचस्प रूप से http://www.springframework.org/schema/context/spring-context-4.2.xsd 4.1 वसंत उपकरण – borjab

6

क्या मैं वसंत के साथ किया था -डेटा-जेपीए-1.3 एक्सएसडी में एक संस्करण जोड़ रहा था और इसे 1.2 तक घटा दिया गया था। फिर त्रुटि संदेश गायब हो जाता है। इस

<beans 
     xmlns="http://www.springframework.org/schema/beans" 
     ... 
     xmlns:jpa="http://www.springframework.org/schema/data/jpa" 
     xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd 
    ... 
    http://www.springframework.org/schema/data/jpa 
    http://www.springframework.org/schema/data/jpa/spring-jpa-1.2.xsd"> 

ऐसा लगता है कि यह 1.2 के लिए तय किया गया था लेकिन फिर 1.3 में फिर से दिखाई देता है।

+0

+1 के लिए पुराने स्कीमा का उपयोग करके मेरे लिए भी काम करता है। – elias

3

क्या @forhas और @HRgiger ने भी मेरे लिए काम किया था।मैं jpa के बजाय spring-data-mongodb का उपयोग कर रहा हूं।

हालांकि, मोंगोडब बाइंडिंग के लिए, आपको mongodb संदर्भ xsd के संस्करण को नहीं हटाया जाना चाहिए, बस इसे संस्करण के साथ रखें: http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsdcontext और beans संस्करण हटा दिए जाने चाहिए।

16

मुझे हाल ही में नवीनतम ग्रहण (केप्लर) में एक ही समस्या थी और प्राथमिकता> एक्सएमएल> एक्सएमएल फाइल> सत्यापन में "सभी एक्सएमएल स्कीमा स्थानों का सम्मान करें" विकल्प को अक्षम करके इसे ठीक किया गया। यह अलग-अलग स्कीमा स्थानों पर इंगित करने वाले समान नामस्थानों के संदर्भों के लिए सत्यापन अक्षम करता है, केवल सामान्य रूप से एक्सएमएल फ़ाइल में मान्य होने पर पहले पाया जाता है। यह विकल्प ज़ीरिस लाइब्रेरी से आता है।

डब्ल्यूटीपी डॉक्टर: http://www.eclipse.org/webtools/releases/3.1.0/newandnoteworthy/sourceediting.php

Xerces डॉक्टर: http://xerces.apache.org/xerces2-j/features.html#honour-all-schemaLocations

+0

ग्रहण 3 में भी मेरे लिए काम किया।7 – Brian

+0

वसंत गड़बड़ परियोजना –

4

मैं हाल ही में वसंत 4.0 के साथ एक ही मुद्दा था।

यह spring-beans-4.0.xsd और spring-context-4.0.xsd से नामों में टकराव के कारण हुआ था। उद्घाटन spring-context-4.0.xsd आप देख सकते हैं कि spring-beans-4.0.xsd पालन की तरह आयात किया जाता है:

<xsd:import namespace="http://www.springframework.org/schema/beans" 
schemaLocation="http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"/> 

ये नाम के टकराव से ग्रहण के बारे में शिकायत कर "... स्कीमा ही नाम के दो वैश्विक घटक शामिल नहीं कर सकते हैं ..."

एक उल्लेखनीय पहलू यह है कि मुझे एक्लिप्स केप्लर एसआर 2 के साथ यह समस्या नहीं थी, लेकिन ग्रहण लुना एसआर 1, एक्सएमएल सत्यापन के बारे में दोनों प्राथमिकताओं की तुलना में, वे वही थे। schemaLocation विशेषता:

यह xsi से वसंत-संदर्भ 4.0.xsd को हटाने के द्वारा हल किया गया था

http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-4.0.xsd 

के बाद यह सब कुछ काम किया की उम्मीद की तरह।

+1

के साथ एक्लिप्स मार्स के लिए काम करता है लेकिन यदि आप <संदर्भ: घटक-स्कैन बेस-पैकेज = "org.vimal.spring.service" का उपयोग कर रहे हैं तो यह समस्या हल नहीं करेगा मुझे अभी पता लगाना है समस्या। –

2

कभी-कभी वसंत कॉन्फ़िगर xml फ़ाइल अगले ग्रहण पर खुलती नहीं है।

यह स्कीमा परिभाषा के कारण एक्सएमएल फ़ाइल में त्रुटि दिखाता है, कोई फर्क नहीं पड़ता ग्रहण या साफ अप परियोजना दोनों काम नहीं कर रहे हैं।

लेकिन इसे आजमाएं!

वसंत कॉन्फ़िगरेशन xml फ़ाइल पर राइट क्लिक करें, और validate चुनें।

थोड़ी देर के बाद, त्रुटि गायब हो जाती है और ग्रहण आपको बताता है कि इस फ़ाइल में कोई त्रुटि नहीं है।

क्या मजाक है ...

+0

यह मेरे लिए धन्यवाद, धन्यवाद। – Bevor