Java 找不到元素';豆子';运行jar时出错
我正在用Spring3.0和 我使用的是EclipseIDE,该项目是在IDE中查找的,但当我生成jar文件时,请运行它。 出现错误org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:类路径资源[springbeans.xml]的xml文档中的第13行无效;嵌套异常为org.xml.sax.saxpasseeption;行号:13;栏目号:84;cvc elt.1:找不到元素“bean”的声明。 这是我的spring配置文件Java 找不到元素';豆子';运行jar时出错,java,spring,swing,schema,Java,Spring,Swing,Schema,我正在用Spring3.0和 我使用的是EclipseIDE,该项目是在IDE中查找的,但当我生成jar文件时,请运行它。 出现错误org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:类路径资源[springbeans.xml]的xml文档中的第13行无效;嵌套异常为org.xml.sax.saxpasseeption;行号:13;栏目号:84;cvc elt.1:找不到元素“bean”的声明。 这是我的sp
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:annotation-config/>
<context:component-scan base-package="com.plyd.java"/>
</beans>
我在谷歌上搜索这个错误,并在我的项目中测试解决方案,但不正常。
代码可以在IDE中找到,但是当我生成runnable jar并运行它时,会出现错误。
请给我一些建议,谢谢。如果您使用的是Eclipse,请试试这个
export jar with>Copy required libraries to a sub folder您在Eclipse中使用的JRE与您在命令行中使用的JRE相同吗?例如,两个JRE都是相同的供应商/版本,还是不同的版本相同的供应商,还是不同的供应商?@PaulGrime是的,两个JRE都是相同的。