我正在使用ikvm .46将java转换为dll。
我试图调用一个用java编写的函数(转换为DLL),加载spring bean。我已将所有依赖项转换为dll。但是最简单的应用程序上下文没有被加载。
App上下文:/ * * * * * * * * * * * * * * /
<?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'正在传递给function,并且所有XML都存在于路径中。/ * * * * * * * * * * * * * * * * * * /
我得到的异常是:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from file [D:configspringapplicationContext-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
试着在你的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" >