Xerces 2.9.1とXerces-J-2.11.0の両方でこれを試しましたが、同じ結果になりました。
XML解析にXercesを使用して、Spring3Webflowアプリを作成しています。EARをデプロイすると、問題が発生します
Caused by: java.lang.IllegalAccessError: tried to access method org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Lorg/apache/xerces/jaxp/DocumentBuilderFactoryImpl;Ljava/util/Hashtable;Ljava/util/Hashtable;)V from class org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setAttribute(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:99)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
... 30 more
Java Decompilorでコードをトレースすると、呼び出しが新しいを作成しようとしているxercesImpl.jar
ことがわかります。これがの原因のようです。のコンストラクターにはデフォルト(パッケージ)アクセスがありますが、とは同じパッケージ()にあります。DocumentBuilderFactoryImpl.setAttribute()
DocumentBuilderImpl
IllegalAccessError
DocumentBuilderImpl
DocumentBuilderImpl
DocumentBuilderFactoryImpl
org.apache.xerces.jaxp
私の知る限りSecurityManager
、エラーの時点ではアクティブなものはありません(そして、SecurityManager
メソッドのアクセス許可に影響するかどうかさえわかりません。クラスの読み込みとリソースのアクセス許可のためだけだと思いました)。
私にできることは何でも(アクセス許可の制限が少ないxerces JARを再コンパイルする以外に、問題の根本を解決したいのですが、回避するのではありません!、標準のJARを使用することもできます。できる)。
私はSpring3.0.5、OC4J 10.0.3.5.0(OracleXMLパーサーの代わりにXercesXMLパーサーを使用するための回避策があります)、およびJava1.6.0-21を使用しています。
ありがとうグラハム