2011-08-19 12 views
9

क्लास पथ संसाधन [ApplicationContextAOP.xml] से एक्सएमएल दस्तावेज़ में लाइन 13 के लिए कोई घोषणा नहीं की जा सकती है; नेस्टेड अपवाद है org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: मेलिंग वाइल्डकार्ड सख्त है, लेकिन तत्व 'aop: config' तत्व के लिए कोई घोषणा नहीं मिल सकती है।वसंत एओपी मिलान वाइल्डकार्ड सख्त है, लेकिन तत्व 'एओपी: कॉन्फ़िगरेशन'

<?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:aop="http://www.springframework.org/schema/aop" 
xmlns:context="http://www.springframework.org/schema/context" 
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 
<bean id="audience" class="com.idol.Audience" /> 

<aop:config> 
<aop:aspect ref="audience"> 

    <!-- Before performance -->  

    <aop:before pointcut="execution(*com.idol.performers.Performer.perform(..))" 
    method="takeSeats"/> 

    <aop:before pointcut="execution(*com.idol.performers.Performer.perform(..))" 
    method="turnOffCellPhones" /> 

    <!-- After performance --> 

    <aop:after-returning pointcut="execution(*com.idol.performers.Performer.perform(..))" 
    method="applaud" /> 

    <!-- After bad performance(exception thrown) -->  

    <aop:after-throwing pointcut="execution(*com.idol.performers.Performer.perform(..))" 
    method="demandRefund" /> 

</aop:aspect> 
</aop:config> 
<bean id="poeticDuke" class="com.idol.performers.PoeticJuggler"> 
<constructor-arg value = "15" /> 
<constructor-arg ref = "sonnet29" /> 
</bean> 

</beans> 

मैं इसी तरह की त्रुटि को देखा है और मैं बहुत यकीन है कि मेरे classpath org.springframework.aop-3.1.0.M2.jar क्या बजे है

आप मुझे बता सकते हैं तो कृपया कर रहा हूँ में याद कर रहा हूँ?

+0

आपके प्रश्न के लिए बहुत बहुत धन्यवाद। मुझे एक ही समस्या का सामना करना पड़ रहा था, लेकिन मेरे मामले में समस्या यह थी कि मैं कक्षा में 'spring-aop.jar' खो रहा था; यही वह था जो मैं याद कर रहा था। मेरे ध्यान में लाने के लिए धन्यवाद। – manuelvigarcia

उत्तर

22

आप अपने schemaLocation को जोड़ने की जरूरत है:

xsi:schemaLocation=" 
... 
http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
... 
" 
+0

अब मुझे यह मिल गया है :-(थ्रेड "मुख्य" org.springframework.beans.factory.beanDefinitionStoreException में अपवाद: क्लास पथ संसाधन [ApplicationContextAOP.xml] से एक्सएमएल दस्तावेज़ को अनपेक्षित अपवाद पार्सिंग; नेस्टेड अपवाद java.lang.NoClassDefFoundError: org है/औपचारिकता/एओपी/सलाह – Aubergine

+3

आप [औपचारिक जार] (http://search.maven.org/#artifactdetails|aopalliance|aopalliance|1.0|jar) गायब हैं। –

+1

@ ऑबर्जिन: आपको यह जवाब स्वीकार करना चाहिए सही उत्तर और एक नया प्रश्न पूछें। –

0

हम तत्व tx:advice के लिए इसी तरह की त्रुटि संदेश प्राप्त हुआ है और यह org.springframework.*-3.1.2.RELEASE.jar रों जहां * जार मॉड्यूल का प्रतिनिधित्व करता है के साथ org.springframework.*-3.0.0.M3.jar रों की जगह द्वारा हल कर ली। इसलिए, समान मुद्दों को ठीक करने के लिए स्थिर रिलीज प्राप्त करने का प्रयास करें।

0
 
Adding one more possibility to the earlier provided answers : 

Wrong version of schemaLocation: 
http://www.springframework.org/schema/aop/ 
    http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 

Correct Version: 
http://www.springframework.org/schema/aop 
    http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 

REASON: The extra "/" after "schema/aop" 
संबंधित मुद्दे