2010-11-30 10 views
1

jettyで実行したときに私のSpring Configurationに問題がありました。私は何の問題もなくTomcatで全く同じファイルを使用しました。私が得るエラーは次のとおりです。JettyでのXMLスキーマエラー

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 6 in XML document from ServletContext resource [/WEB-INF/web-application-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'SpringSource.org | '. 
Caused by: org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'SpringSource.org | '. 

私のスキーマは次のようになります。

<?xml version="1.0" encoding="UTF-8"?> 
<beans:beans xmlns="http://www.springframework.org/schema/security" 
xmlns:beans="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.springframework.org/schema/security 
http://www.springframework.org/schema/security/spring-security-3.0.5.xsd"> 

何が間違っているかわかりません。 2つの異なる構成でテストし、両方ともこのエラーを出しました。

+0

記載されているのXSDからのチェックがhttp://www.springframework.org/schema/security/(ショート総集編はあなたがMavenを使用している場合は、あなたのクラスパスに春のセキュリティコンフィグジャーは、以下の依存関係を追加欠けています) –

答えて

0

もちろん、XML属性内に改行文字を使用することはできません。

xsi:schemaLocationをすべて1行に入れます。

+0

私はすでにそれを試して誓っています。 –

+0

私はこの答えが間違っていると思うhttp://stackoverflow.com/a/449647/90033 – Konstantin

+0

@コンスタンチン:これはXML標準の問題ではありませんが、この特定のパーサーが外部スキーマ –

2

次のURLは無効と思われる、とあなたはその1を試すことができ

http://www.springframework.org/schema/security/spring-security-3.0.5.xsd 

をspringsource.orgにリダイレクト?

http://www.springframework.org/schema/security/spring-security-3.0.4.xsd 
+0

Ah tnx。そのような単純な解決策。私は前にそのようなエラーがあったので、無効なスキーマの場所について他のエラーが予想されました。まだ同じエラーが発生していますが、より詳細になりました。 –

関連する問題