Eclipse は、Spring のapplicationContext.xmlに次のエラーを表示しています。
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dwr:configuration'. myappservlet-servlet.xml MyApp/src/main/webapp/WEB-INF line 23 XML Problem
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dwr:controller'. myappservlet-servlet.xml MyApp/src/main/webapp/WEB-INF line 21 XML Problem
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dwr:remote'. myappservlet-servlet.xml MyApp/src/main/webapp/WEB-INF line 41 XML Problem
ラインアイテムエラーの上にマウスを置くと、次のようにも表示されます。
- schema_reference.4: Failed to read schema document 'http://www.directwebremoting.org/
schema/spring-dwr-3.0.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>.
ルート要素が実際に<xsd:schema>であることを確認しました。<dwr:と入力してオートコンプリートを使用すると、Eclipse は<dwr:configuration>、<dwr:controller>などのさまざまなオプションを正しく表示します。Eclipseはスキーマを読み取らずにこれをどのように認識できますか?
問題なくさまざまな名前空間を使用しています。解決されていないのは DWR スキーマだけです。宣言は次のとおりです。
<?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"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd"
default-autowire="byName">
クラスパスに最新の DWR 3.0.0.116.rc1 があります。DWR jar をクラックして開くと、以下を含むMETA-INF/spring.handlersが見つかります。
http\://www.directwebremoting.org/schema/spring-dwr=org.directwebremoting.spring.DwrAnnotationNamespaceHandler
および以下を含むMETA-INF/spring.schemas :
http\://www.directwebremoting.org/schema/spring-dwr-2.0.xsd=org/directwebremoting/spring/spring-dwr-2.0.xsd
http\://www.directwebremoting.org/schema/spring-dwr-3.0.xsd=org/directwebremoting/spring/spring-dwr-3.0.xsd
コロンのエスケープには少し気を失いましたが、すべて正しいと思います。そうしないと、全員の DWR が壊れてしまいます。
以前は、この特定のスキーマを DWR Web サイトからリアルタイムで取得していましたが、DWR サイトがダウンしたために実稼働システムがクラッシュしたときに、これに悩まされました。