2009-05-23 36 views
12

Eclipseは私の春のapplicationContext.xmlをに次のエラーを示している。Eclipseがspring-dwrスキーマを解決できないのはなぜですか?

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:のEclipse正しく私に< DWRのような様々なオプションを示しますか?

多くの異なる名前空間を問題なく使用しています。解決されていないのは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があります。

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の瓶を開く割れた場合、私は含んMETA-INF/spring.handlersを見つけますコロンが少し私を捨てましたが、私はそれがすべて正しいと仮定します。そうしないと、誰のDWRも壊れてしまいます。

DWRのWebサイトからこの特定のスキーマをリアルタイムで取得する前に、DWRサイトがダウンしていたために私のプロダクションシステムがクラッシュしたときにこれで少し気が紛れました。

答えて

11

Eclipseにユーザー指定のカタログ投稿を追加できます。 ウィンドウ - >環境設定 - > XML-> XMLカタログ選択ユーザ指定のエントリ、次にボタンを追加します。

スキーマの詳細を追加できます(接続が切断された場合にファイルをローカルにコピーできます)。 Eclipseは検証中にスキーマにアクセスできます。

+1

.xsdが.jarファイル内にあるときにこれを行う方法はありますか? '/ META-INF/spring.schemas'の設定はこれをすでに処理していますか? – Stewart

2

あなたの質問はここにありますか。 DWRサイトがダウンし、Eclipseのスキーマの検証が失敗するという最後の段落で自分自身に答えているようです。 Eclipse(Spring IDEプラグインを使用していても)は、META-INF/spring.schemasを使用して名前空間を解決していないことに注意してください。これはEclipseプラットフォームによって行われます。スキーマがスキーマの場所で見つからない場合、これらのエラーが発生します。

オートコンプリートについては、スキーマが見つからない場合は、ドキュメント内の既存の構造から推論することで、Eclipseはこれを提供します。

SpringはMETA-INF/spring.schemasファイルを使用してJARからスキーマを解決するため、これはアプリケーション自体には問題ありません。

2

これは、Eclipseをオフラインで使用する場合の一般的な問題です。それはネットからスキーマを取得しようとしています。見つからない場合は、検証エラーを示します。

これらのエラーは無視されました。あなたがオンラインに戻ったら、プロジェクトをきれいにして、彼らは遠ざかります。

関連する問題