日期:2014-05-20  浏览次数:20690 次

jar打包出错的问题
做了一个小程序,用了spring+mybatis

然后在eclipse里面测试都是正常的,可以运行。打包成jar后就出错了。

出错提示为:
[WARN ] 2011-11-07 14:38:29 :No MyBatis mapper was found in 'com.dddd.mybatis.pernsistence' package. Please check your configuration.
....................
xception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitio
nException: No bean named 'youZhengServiceImpl' is defined
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.
getBeanDefinition(DefaultListableBeanFactory.java:527)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getMerg
edLocalBeanDefinition(AbstractBeanFactory.java:1087)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:278)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
  at org.springframework.context.support.AbstractApplicationContext.getBea
n(AbstractApplicationContext.java:1093)
  at 'com.dddd.YouZheng.doStart(YouZheng.java:41)

求解。附带的包肯定没错,我在另外一台干净的电脑上重新安装了jre和eclipse测试的依然一样,
在eclipse里面可以运行,打包后就行。

------解决方案--------------------
配置文件没有弄出来吧?
报错 No bean named 'youZhengServiceImpl' is defined

------解决方案--------------------
youZhengServiceImpl 你配置在哪里的?
------解决方案--------------------
关键现在程序就把那个找不到,