1

Javaをdllに変換するためにikvm .46を使用しています。

Spring Bean をロードする Java で記述された (DLL に変換された) 関数を呼び出そうとしています。すべての依存関係を dll に変換しました。しかし、最も単純なアプリケーション コンテキストが読み込まれていません。

アプリのコンテキスト : / * ** * ** * ** * **** /

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

/ * ** * ** * ** * ** * /

Bean をロードするためのコード スニペット: / * ** * ** * ** * ** * **** /

String[] configFiles = new String[] { "D:/config/spring/*.xml", "D:/config/spring/" + type + "/*.xml" }; 
FileSystemXmlApplicationContext ctx = null; 
try{ 
     ctx = new FileSystemXmlApplicationContext(configFiles); 
    }catch(Exception e){ 
      log.info("context NOT created successfully"); 
    } 

'type' が関数に渡され、すべての xml がパス上に存在します。/** * ** * ** * ** * ** * *** /

私が得る例外は次のとおりです。

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from file [D:\config\spring\applicationContext-jdbc.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 6; cvc-elt.1: Cannot find the declaration of element 'beans'. 

私が使用しているSpringバージョンは: org.springframework.beans-3.0.0.RC1.dll

コードは JVM で正常に動作します。ここで私が間違っていることを指摘してもらえますか?

ありがとう、よろしくアンクル

4

1 に答える 1

0

これをxmlファイルで使用してみてください。同じ問題がありました

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
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-2.0.xsd
           http://www.springframework.org/schema/security
           http://www.springframework.org/schema/security/spring-security-3.1.xsd" >
于 2011-09-08T16:14:42.413 に答える