[英]ikvm java spring issue: Cannot find the declaration of element 'beans'.
I am using ikvm .46 to convery java to dll. 我正在使用ikvm .46将Java转换为dll。
I am trying to call a function written in java (converted to DLL ) that loads spring beans.I have converted all dependencies to dll. 我试图调用一个用Java编写的函数(转换为DLL)来加载spring bean.I已将所有依赖项都转换为dll。 But Event the simplest application context is not getting loaded.
但是Event最简单的应用程序上下文没有被加载。
App context : / * ** * ** * ** * **** / 应用环境:/ * ** * ** * ** * **** /
<?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>
/ * ** * ** * ** * ** * / / * ** * ** * ** * ** * /
Code snippet to load 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' is being passed to function and all xml exists on the path. “类型”被传递给函数,并且所有xml都存在于路径中。 /
/ ** * ** * ** * ** * ** * *** /
** * ** * ** * ** * ** * *** /
Th exception that I get is : 我得到的例外是:
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 version that I am using is : org.springframework.beans-3.0.0.RC1.dll 我正在使用的Spring版本是:org.springframework.beans-3.0.0.RC1.dll
Code works fine with JVM. 代码与JVM配合良好。 Can you please point out what I am doing wrong here?
您能指出我在做什么错吗?
Thanks and regards Ankur 谢谢,问候安库
try using this in your xml file I had the same problem 尝试在您的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" >
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.