I am trying to use Spring Schema-based AOP support in Eclipse and am getting errors when trying to load the configuration into Tomcat.
There are no errors in Eclipse, and autocomplete works correctly for the aop namespace, however, when I try to load the project in eclipse, I get this error:
09: 17: 59,515 WARN XmlBeanDefinitionReader: 47 - Ignored XML Validation Warning org.xml.sax.SAXParseException: schema_reference.4: Failed to read the schema document "http://www.springframework.org/schema/aop/ spring-aop -2.5.xsd "because 1) could not find the document; 2) the document cannot be read; 3) the root element of the document is missing.
Followed by:
SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: line 39 in the XML document from / WEB -INF / beans.xml is invalid; The nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The corresponding pattern is strict, but no declaration was found for the 'aop: config' element.
Called: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The corresponding template is strict, but no declaration was found for the 'aop: config' element.
Based on this, it seems that the schema is not readable when Tomcat parses the beans.xml file, which results in the element <aop:config>not being recognized.
My beans.xml file looks like this:
<?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:jaxws="http://cxf.apache.org/jaxws"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<jaxws:endpoint
xmlns:tns="http://iwebservices.ourdomain/"
id="iwebservices"
implementor="ourdomain.iwebservices.IWebServiceImpl"
endpointName="tns:IWebServiceImplPort"
serviceName="tns:IWebService"
address="/I"
wsdlLocation="wsdl/I.wsdl">
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature" />
</jaxws:features>
</jaxws:endpoint>
<aop:config>
<aop:aspect id="myAspect" ref="aBean">
</aop:aspect>
</aop:config>
</beans>
<aop:config> beans.xml Spring -,
- , ?