これが STS/Eclipse の問題なのか、プロジェクトのセットアップの問題なのかはわかりませんが、STS は私の Spring スキーマについて不平を言っています。
Multiple annotations found at this line:
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'.
- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/jee/spring-jee.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>.
Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tx/spring-tx.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>.
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:advice'.
Multiple annotations found at this line:
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aop:config'.
- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/aop/spring-aop.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>.
これが私のアプリケーション構成です:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
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/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<jee:jndi-lookup expected-type="java.lang.String" id="myId" jndi-name="myJndiName"/>
<!-- Other stuff with no problems ommitted -->
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- all methods starting with 'get' are read-only -->
<tx:method name="get*" read-only="true"/>
<!-- other methods use the default transaction settings (see below) -->
<tx:method name="*"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut expression="execution(* com.example.service.*.*(..) )" id="servicesPointcut"/>
<aop:advisor advice-ref="transactionAdvice" pointcut-ref="servicesPointcut"/>
</aop:config>
</beans>
私のクラスパス上の春のJARは次のとおりです。
spring-aop-3.1.4.RELEASE.jar
spring-asm-3.1.4.RELEASE.jar
spring-batch-core-2.1.9.RELEASE.jar
spring-batch-infrastructure-2.1.9.RELEASE.jar
spring-batch-test-2.1.9.RELEASE.jar
spring-beans-3.1.4.RELEASE.jar
spring-context-3.1.4.RELEASE.jar
spring-context-support-3.1.4.RELEASE.jar
spring-core-3.1.4.RELEASE.jar
spring-data-commons-1.5.1.RELEASE.jar
spring-data-jpa-1.3.1.RELEASE.jar
spring-expression-3.1.4.RELEASE.jar
spring-jdbc-3.1.4.RELEASE.jar
spring-orm-3.1.4.RELEASE.jar
spring-oxm-3.1.4.RELEASE.jar
spring-test-3.1.4.RELEASE.jar
spring-tx-3.1.4.RELEASE.jar
プロジェクトのクラスパスを見るとspring-context-3.1.4.RELEASE.jar/META-INF/spring.schemas
、行が含まれているものを見つけることができますhttp\://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-3.1.xsd
。同様のファイルがspring-aop-3.1.4.RELEASE.jar
AOP タグのクラスパスにあります。
このエラーを取り除く方法について何か提案はありますか?