2013-05-21 3 views
16

मैं त्रुटित्रुटि: "स्कीमा स्थान मूल्य *** में यूआरआई की संख्या भी होनी चाहिए।" वसंत डिस्पैचर में नामस्थान पर

<Ignored XML validation warning> org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 55; 
SchemaLocation: schemaLocation value = 'http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
http://www.springframework.org/schema/tx' must have even number of URI's. 

हो रही थी निम्नलिखित और मेरे डिस्पैचर सर्वलेट निम्नलिखित नामस्थान

<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:aop="http://www.springframework.org/schema/aop" 
     xmlns:tx="http://www.springframework.org/schema/tx" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
     http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> 

हो रही थी और मैं

<beans xmlns="http://www.springframework.org/schema/beans" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> 

और पालन करते हुए सब से ऊपर की जगह मेरी त्रुटि गायब हो गई।
यह कैसे हुआ कोई भी बता सकता है ??

उत्तर

56

schemaLocation विशेषता नामस्थान के लिए एक XML स्कीमा दस्तावेज़ संदर्भित करती है।

मूल रूप से जब आप लिखते हैं:

xmlns:expns="http://www.example.com" 
xsi:schemaLocation="http://www.example.com 
        http://www.example.com/schema/example.xsd" 

आप कह रहे हैं:। "मैं नाम स्थान के तत्वोंhttp://www.example.comइसके अलावा के लिए उपसर्गexpnsउपयोग करने के लिए जा रहा हूँ, ताकि आप मान्य कर सकते हैं उन तत्वों, मेंhttp://www.example.comके लिए XSD स्कीमा फ़ाइल प्राप्तhttp://www.example.com/schema/example.xsd "

तो, दूसरे शब्दों में, प्रारूप है:

xsi:schemaLocation="namespace-a where_to_get_the_xsd_for_namespace-a 
        namespace-b where_to_get_the_xsd_for_namespace-b 
        namespace-c where_to_get_the_xsd_for_namespace-c" 

और इतने पर।

यही कारण है कि मुझे भी नंबर होना चाहिए।


अधिक जानकारी और उदाहरण here मिल सकते हैं।

+0

तो आप इस समस्या को कैसे ठीक करते हैं? क्या आप केवल 'xsi: schemaLocation' को हटाते हैं जिसे सही रूप से स्वरूपित नहीं किया गया है क्योंकि वास्तव में यह वास्तव में कुछ भी नहीं कर रहा है? क्या आप पता लगाते हैं कि नेमस्पेस क्या होना चाहिए? यदि हां, तो कैसे? –

+0

@StephenOstermiller आप या तो 'xsi: schemaLocation' में प्रविष्टि को ठीक करने के लिए (समकक्ष जोड़ें) जो असमान बना रहा है, या, यदि आप conterpart के लिए सही मान नहीं जानते हैं, तो प्रविष्टि को हटाएं (इसलिए कोई आवश्यकता नहीं है पूरे 'xsi: schemaLocation' को हटाने के लिए, हालांकि यह भी काम करेगा, मुझे लगता है)। – acdcjunior

संबंधित मुद्दे

 संबंधित मुद्दे