1

我正在使用 ikvm .46 将 java 转换为 dll。

我正在尝试调用一个用 java 编写的函数(转换为 DLL )来加载 spring beans。我已将所有依赖项转换为 dll。但是 Event 最简单的应用程序上下文没有被加载。

应用上下文:/ * ** * ** * ** * **** /

    <?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> 

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

加载Beans的代码片段:/ * ** * ** * ** * ** * **** /

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。你能指出我在这里做错了什么吗?

感谢和问候 Ankur

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 回答