求解决org.springframework.beans.factory.BeanCreationException

dwr和spring整合时出的问题,请问有谁知道这是怎么回事呢?
具体代码如下:

dwr.xml

[code="java"]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.org/dwr/dwr20.dtd">



<!-- 用户信息 -->


<!-- 组织信息 -->
match="com.tw.pojo.OrgBean">

    <!-- 用户DWR调用定义 -->
    <create creator="spring" javascript="DWRUserDao">
        <param name="beanName" value="userDao"/>
    </create>
    <!-- 组织DWR调用定义 -->
    <create creator="spring" javascript="DWROrgDao">
        <param name="beanName" value="orgDao"/>
    </create>

</allow>


[/code]

UserDaoImpl.java

[code="java"]
public List getUserListInfo(String orgid) {
Map map = new HashMap();
map.put("orgid", orgid);
try {
List list = (List) this.getSqlMapClientTemplate().queryForList(
"getUserListInfo", map);
if (list != null) {
return list;
}
} catch (Exception e) {
log.error("获取指定组织的所有直用户getUserListInfo:", e);
e.printStackTrace();
}
return null;
}

[/code]

applicationContext.xml
[code="java"]

<bean id="baseDao" class="com.tw.framework.base.db.BaseDaoOracle"
    scope="prototype">
</bean>

<!-- 用户角色信息 -->
<bean id="userDao" class="com.tw.dao.impl.UserDaoImpl" scope="prototype">
    <property name="baseDao" ref="baseDao" />
</bean>

<!-- 组织信息 -->
<bean id="orgDao" class="com.tw.dao.impl.OrgDaoImpl" scope="prototype">
    <property name="baseDao" ref="baseDao" />
</bean>

[/code]

jsp代码

[code="java"]

    <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/DWROrgDao.js'></script>
    <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
    <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>    
    <script language="javascript">
    //初始化页面中各控制的值
    javascript:dwr.engine.setAsync(false);
    function loadControls()
    {
        loadSelectAreaList();
    }

    //Load所有公司信息,并将之设置到公司列表控制
    function loadSelectAreaList()
    {
        document.all.ddlArea.length = 1;
        //设置公司列表控制
        DWROrgDao.getCompanyList(true,function(list){
         for(var i=0;i<list.length;i++)
          {
             var li = document.createElement("OPTION");
             li.text = list[i].orgName;
             li.value = list[i].parentOrgId;
             document.all.ddlArea.options.add(li);    
          }
        });
    }

[/code]

可是运行的时候控制台报错

[code="java"]

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: sqlMapClient is required
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
at org.directwebremoting.spring.SpringCreator.getInstance(SpringCreator.java:144)
at org.directwebremoting.spring.SpringCreator.getType(SpringCreator.java:106)
at org.directwebremoting.impl.DefaultCreatorManager.addCreator(DefaultCreatorManager.java:118)
at org.directwebremoting.impl.DefaultCreatorManager.addCreator(DefaultCreatorManager.java:100)
at org.directwebremoting.impl.DwrXmlConfigurator.loadCreate(DwrXmlConfigurator.java:274)
at org.directwebremoting.impl.DwrXmlConfigurator.loadAllows(DwrXmlConfigurator.java:224)
at org.directwebremoting.impl.DwrXmlConfigurator.configure(DwrXmlConfigurator.java:170)
at org.directwebremoting.impl.ContainerUtil.configureFromDefaultDwrXml(ContainerUtil.java:264)
at org.directwebremoting.impl.ContainerUtil.configureContainerFully(ContainerUtil.java:421)
at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:79)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: sqlMapClient is required
at org.springframework.orm.ibatis.SqlMapClientTemplate.afterPropertiesSet(SqlMapClientTemplate.java:144)
at org.springframework.orm.ibatis.support.SqlMapClientDaoSupport.checkDaoConfig(SqlMapClientDaoSupport.java:104)
at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 30 more
2011-08-12 09:34:34 org.directwebremoting.util.CommonsLoggingOutput.error(CommonsLoggingOutput.java:83) [ERROR] Error loading class for creator 'SpringCreator[DWROrgDao]'.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orgDao' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: sqlMapClient is required
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
at org.directwebremoting.spring.SpringCreator.getInstance(SpringCreator.java:144)
at org.directwebremoting.spring.SpringCreator.getType(SpringCreator.java:106)
at org.directwebremoting.impl.DefaultCreatorManager.addCreator(DefaultCreatorManager.java:118)
at org.directwebremoting.impl.DefaultCreatorManager.addCreator(DefaultCreatorManager.java:100)
at org.directwebremoting.impl.DwrXmlConfigurator.loadCreate(DwrXmlConfigurator.java:274)
at org.directwebremoting.impl.DwrXmlConfigurator.loadAllows(DwrXmlConfigurator.java:224)
at org.directwebremoting.impl.DwrXmlConfigurator.configure(DwrXmlConfigurator.java:170)
at org.directwebremoting.impl.ContainerUtil.configureFromDefaultDwrXml(ContainerUtil.java:264)
at org.directwebremoting.impl.ContainerUtil.configureContainerFully(ContainerUtil.java:421)
at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:79)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: sqlMapClient is required
at org.springframework.orm.ibatis.SqlMapClientTemplate.afterPropertiesSet(SqlMapClientTemplate.java:144)
at org.springframework.orm.ibatis.support.SqlMapClientDaoSupport.checkDaoConfig(SqlMapClientDaoSupport.java:104)
at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 30 more

[/code]

10个回答

直接在[code="java"]SqlMapClientFactoryBean[/code]类的方法:
[code="java"] protected SqlMapClient buildSqlMapClient(
Resource[] configLocations, Resource[] mappingLocations, Properties properties)
throws IOException {[/code]
设置断点调试一下,看看到底传入的“configLocations”哪里不对。

就是它说的意思,你这个userDao需要一个sqlMapClient(应该是通过属性设置)。你没有设置。于是在调用初始化函数的时候出错了。

你的DAO为什么没有注入sqlSessionFactory呢?我一般都是这样的:
[code="java"]






[/code]

[quote]我用的是ibatis 你这个是mybatis的配置,有区别吗?ibatis需要怎么配置呢? 我有用到 [/quote]
原理的是一样的。如果是ibatis你要注入的是:
[code="java"]org.springframework.orm.ibatis.SqlMapClientFactoryBean[/code]
把我上面的SqlSessionFactoryBean替换就好了。

[code="java"] [/code]
这个设置的地址不对,这样不是绝对路径,spring找不到。你把sqlMapConfig.xml放到classes里面去,然后把这个改成:
[code="java"] [/code]

这孩子,一碰到问题就问

[quote]这个是公司的项目,不能这样子改配置的,有其他的办法米? [/quote]
你spring的配置文件放在哪里?

sqlMapConfig.xml和spring配置在同一目录的话,直接把
[code="java"] [/code]
改成:


再试试。

这样,
[code="java"] [/code]
“WEB-INF”前面加个斜杠。

我把自己的配置改了,放到web-inf下,都是可以的啊:

web.xml
[code="java"]

contextConfigLocation
/WEB-INF/applicationContext.xml

[/code]

applicationContext.xml
[code="java"]




[/code]

日志出来正常:
[code="java"]2011-08-12 13:07:58,593 WEB-MES [main] DEBUG o.m.s.SqlSessionFactoryBean - Parsed configuration file: 'ServletContext resource [/WEB-INF/mybatis-config.xml]'[/code]

检查一下你文件的位置!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
报org.springframework.beans.factory.BeanCreationException错求解决
Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'babyWapService': Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonDao': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [spring-datasource.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring-datasource.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name FLYCITY is not bound in this Contextrn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:292)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:252)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:566)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
求高手解决一个关于问题org.springframework.beans.factory.BeanCreationException
[u][color=#0000FF]org.springframework.beans.factory.BeanCreationException[/color][/u]: Error creating bean with name 'sessionFactory' defined in file [C:\Tomcat 6.0\webapps\PCHMonitor\WEB-INF\classes\applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/AnnotationConfiguration
100分相送,求高手解决org.springframework.beans.factory.BeanCreationException:
我的程序在tomacat5。0和JDK1。50下可以运行rn但换到tomacat6。0和JDK1。60下就出现异常rn我的application.xml是rn rn rn hibernate.cfg.xmlrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPassrnjava.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPassrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:620)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)rn at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1814)rn at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:868)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1321)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1200)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)rn at org.hibernate.cfg.Configuration.add(Configuration.java:386)rn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)rn at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)rn at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)rn at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)rn at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)rn at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)rn at org.hibernate.cfg.Configuration.configure(Configuration.java:1325)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:651)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:87)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:72)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:63)rn at com.xingkong.struts.action.AppContext.(AppContext.java:20)rn at com.xingkong.struts.action.AppContext.getInstace(AppContext.java:13)rn at com.xingkong.struts.action.BaseAction.getBooktypeService(BaseAction.java:17)rn at com.xingkong.struts.action.BookindexAction.(BookindexAction.java:37)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:494)rn at java.lang.Class.newInstance0(Class.java:350)rn at java.lang.Class.newInstance(Class.java:303)rn at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)rn at org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:326)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:268)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:270)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:191)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)rn at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:698)rn at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:669)rn at org.apache.jsp.bookindex_jsp._jspx_meth_html_005fhtml_005f0(bookindex_jsp.java:121)rn at org.apache.jsp.bookindex_jsp._jspService(bookindex_jsp.java:70)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:319)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:270)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:191)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:227)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:211)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:817)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:623)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:444)rn at java.lang.Thread.run(Thread.java:595)rn
100分相送,求高手解决org.springframework.beans.factory.BeanCreationException
我的程序在tomacat5。0和JDK1。50下可以运行rn但换到tomacat6。0和JDK1。60下就出现异常rn我的application.xml是rn rn rn hibernate.cfg.xmlrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPassrnjava.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPassrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:620)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)rn at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1814)rn at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:868)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1321)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1200)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)rn at org.hibernate.cfg.Configuration.add(Configuration.java:386)rn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)rn at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)rn at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)rn at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)rn at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)rn at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)rn at org.hibernate.cfg.Configuration.configure(Configuration.java:1325)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:651)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:87)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:72)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:63)rn at com.xingkong.struts.action.AppContext.(AppContext.java:20)rn at com.xingkong.struts.action.AppContext.getInstace(AppContext.java:13)rn at com.xingkong.struts.action.BaseAction.getBooktypeService(BaseAction.java:17)rn at com.xingkong.struts.action.BookindexAction.(BookindexAction.java:37)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:494)rn at java.lang.Class.newInstance0(Class.java:350)rn at java.lang.Class.newInstance(Class.java:303)rn at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)rn at org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:326)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:268)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:270)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:191)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)rn at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:698)rn at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:669)rn at org.apache.jsp.bookindex_jsp._jspx_meth_html_005fhtml_005f0(bookindex_jsp.java:121)rn at org.apache.jsp.bookindex_jsp._jspService(bookindex_jsp.java:70)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:319)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:270)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:191)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:227)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:211)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:817)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:623)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:444)rn at java.lang.Thread.run(Thread.java:595)rn
org.springframework.beans.factory.BeanCreationException 怎么解决啊~~
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in file [E:\AutoNavi\tomcat\apache-tomcat-6.0.26\webapps\zls_dang\WEB-INF\classes\applicationContext-dao.xml]: Cannot resolve reference to bean 'hibernateTemplate' while setting bean property 'hibernateTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in file [E:\AutoNavi\tomcat\apache-tomcat-6.0.26\webapps\zls_dang\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\AutoNavi\tomcat\apache-tomcat-6.0.26\webapps\zls_dang\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:519)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:581)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in file [E:\AutoNavi\tomcat\apache-tomcat-6.0.26\webapps\zls_dang\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\AutoNavi\tomcat\apache-tomcat-6.0.26\webapps\zls_dang\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)rn ... 42 morern
org.springframework.beans.factory.BeanCreationException怎么解决
严重: StandardWrapper.Throwablernorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPassrnjava.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPassrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:621)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)rn at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1819)rn at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1327)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn at org.hibernate.cfg.Configuration.add(Configuration.java:386)rn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:683)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1099)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:400)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:234)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:144)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:321)rn at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:252)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)rn at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)rn at javax.servlet.GenericServlet.init(GenericServlet.java:212)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:578)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: java.lang.ClassNotFoundException: org.hibernate.cfg.HbmBinder$SecondPassrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn ... 48 morern2010-6-19 17:20:08 org.apache.catalina.core.StandardContext loadOnStartuprn严重: Servlet /mytest threw load() exceptionrnjava.lang.ClassNotFoundException: org.hibernate.cfg.HbmBinder$SecondPassrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:621)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)rn at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1819)rn at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1327)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn at org.hibernate.cfg.Configuration.add(Configuration.java:386)rn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:683)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1099)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:400)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:234)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:144)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:321)rn at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:252)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)rn at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)rn at javax.servlet.GenericServlet.init(GenericServlet.java:212)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:578)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rn
org.springframework.beans.factory.BeanCreationException:
启动tomcat之后就报错!求大神解决!rnrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerErrorrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: java.lang.ExceptionInInitializerErrorrn at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:244)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)rn ... 36 morernCaused by: java.lang.IllegalStateException: Expected method not found: java.lang.NoSuchMethodException: org.hibernate.cfg.Configuration.addAnnotatedClass(java.lang.Class)rn at org.springframework.util.ClassUtils.getMethod(ClassUtils.java:626)rn at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.(LocalSessionFactoryBuilder.java:68)rn ... 39 more
org.springframework.beans.factory.BeanCreationException
在开发中遇到的错误。求找大神帮助,谢谢rnrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orgAction' defined in ServletContext resource [/WEB-INF/classes/config/app_action.xml]: Cannot resolve reference to bean 'stationService' while setting bean property 'stationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stationService' defined in ServletContext resource [/WEB-INF/classes/config/app_service.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'addStationService' of bean class [hqhop.scada.services.res.impl.StationServiceImpl]: Bean property 'addStationService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stationService' defined in ServletContext resource [/WEB-INF/classes/config/app_service.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'addStationService' of bean class [hqhop.scada.services.res.impl.StationServiceImpl]: Bean property 'addStationService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)rn ... 25 morernCaused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'addStationService' of bean class [hqhop.scada.services.res.impl.StationServiceImpl]: Bean property 'addStationService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rn at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1064)rn at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)rn ... 33 more
org.springframework.beans.factory.BeanCreationException: ……
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.baobaotao.dao.UserDao com.baobaotao.service.UserService.userDao; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourcernRelated cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourcern at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:243)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4681)rn at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5184)rn at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5179)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.baobaotao.dao.UserDao com.baobaotao.service.UserService.userDao; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourcern rnrn rn运行Spring项目时,报错。是什么原因呢?好纠结啊,找了好久都没解决……会的帮忙解答下,谢谢啦~
org.springframework.beans.factory.BeanCreationException?
大家帮我看一下 这个么错误该怎么解决啊?rnrn严重: action: nullrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name '/login' defined in ServletContext resource [/WEB-INF/spring_config.xml]: Cannot resolve reference to bean 'commonDAO' while setting bean property 'commonDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonDAO' defined in ServletContext resource [/WEB-INF/spring_config.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring_config.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProviderrnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonDAO' defined in ServletContext resource [/WEB-INF/spring_config.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring_config.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProviderrnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring_config.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProviderrnCaused by: java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProviderrn at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:124)rn at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:180)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:811)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:737)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1198)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1167)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:267)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1095)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:267)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1095)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)rn at org.springframework.web.struts.ContextLoaderPlugIn.createWebApplicationContext(ContextLoaderPlugIn.java:354)rn at org.springframework.web.struts.ContextLoaderPlugIn.initWebApplicationContext(ContextLoaderPlugIn.java:295)rn at org.springframework.web.struts.ContextLoaderPlugIn.init(ContextLoaderPlugIn.java:225)rn at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)rn at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)rn at javax.servlet.GenericServlet.init(GenericServlet.java:211)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1164)rn at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:132)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:211)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:817)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:623)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:444)rn at java.lang.Thread.run(Unknown Source)rn2009-6-26 12:56:14 org.apache.catalina.core.ApplicationContext logrnrn
org.springframework.beans.factory.BeanCreationException错误
四月 16, 2012 1:56:56 下午 org.apache.catalina.core.AprLifecycleListener initrn信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:\tools\Java\jdk1.7.0_03\bin;F:\tools\Tomcat 7.0\binrn四月 16, 2012 1:56:57 下午 org.apache.coyote.AbstractProtocol initrn信息: Initializing ProtocolHandler ["http-bio-80"]rn四月 16, 2012 1:56:57 下午 org.apache.coyote.AbstractProtocol initrn信息: Initializing ProtocolHandler ["ajp-bio-8009"]rn四月 16, 2012 1:56:57 下午 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 738 msrn四月 16, 2012 1:56:57 下午 org.apache.catalina.core.StandardService startInternalrn信息: Starting service Catalinarn四月 16, 2012 1:56:57 下午 org.apache.catalina.core.StandardEngine startInternalrn信息: Starting Servlet Engine: Apache Tomcat/7.0.26rn四月 16, 2012 1:56:57 下午 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory F:\tools\Tomcat 7.0\webapps\blogrn四月 16, 2012 1:57:03 下午 org.apache.catalina.core.ApplicationContext logrn信息: No Spring WebApplicationInitializer types detected on classpathrn四月 16, 2012 1:57:03 下午 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContextrnlog4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).rnrnlog4j:WARN Please initialize the log4j system properly.rn四月 16, 2012 1:57:05 下午 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerExceptionrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: java.lang.NullPointerExceptionrn at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:207)rn at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)rn at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71)rn at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2273)rn at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2269)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1738)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1778)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)rn ... 26 morern四月 16, 2012 1:57:05 下午 org.apache.catalina.core.StandardContext startInternalrn严重: Error listenerStartrn四月 16, 2012 1:57:05 下午 org.apache.catalina.core.StandardContext startInternalrn严重: Context [/blog] startup failed due to previous errorsrn四月 16, 2012 1:57:05 下午 org.apache.catalina.core.ApplicationContext logrn信息: Closing Spring root WebApplicationContextrn四月 16, 2012 1:57:05 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbcrn严重: The web application [/blog] registered the JDBC driver [oracle.jdbc.driver.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.rn四月 16, 2012 1:57:05 下午 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory F:\tools\Tomcat 7.0\webapps\docsrn四月 16, 2012 1:57:05 下午 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory F:\tools\Tomcat 7.0\webapps\managerrn四月 16, 2012 1:57:05 下午 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory F:\tools\Tomcat 7.0\webapps\ROOTrn四月 16, 2012 1:57:05 下午 org.apache.coyote.AbstractProtocol startrn信息: Starting ProtocolHandler ["http-bio-80"]rn四月 16, 2012 1:57:05 下午 org.apache.coyote.AbstractProtocol startrn信息: Starting ProtocolHandler ["ajp-bio-8009"]rn四月 16, 2012 1:57:05 下午 org.apache.catalina.startup.Catalina startrn信息: Server startup in 8368 msrn
疯了!org.springframework.beans.factory.BeanCreationException
搞了一下午!都说是包的问题。但是我找了一下包发现没有重复的包。rn我还有一个项目也是一样的配置但可以运行。rn这个项目我是用别人已有的项目再把我的 类 与配置文件 拷贝进去,已经修改的跟我原有项目一摸一样了。rn配置文件都在。rn我去配置文件中把 ‘dddService'的配置 注释就不会报异常了.rnrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dddService' defined in file [E:\Tomcat 6.0\webapps\iteflat\WEB-INF\classes\springconfig\applicationContext-ddd.xml]: Invocation of init method failed; nested exception is org.aopalliance.aop.AspectException: nullrnjava.lang.IllegalArgumentException: Cannot subclass final class class $Proxy2rn at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:442)rn at net.sf.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33)rn at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)rn at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215)rn at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373)rn at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281)rn at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:199)rn at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:156)rn at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:70)rn at org.springframework.transaction.interceptor.TransactionProxyFactoryBean.getProxy(TransactionProxyFactoryBean.java:338)rn at org.springframework.transaction.interceptor.TransactionProxyFactoryBean.afterPropertiesSet(TransactionProxyFactoryBean.java:310)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:810)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:779)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:360)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:256)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:331)rn at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:150)rn at org.springframework.web.struts.ContextLoaderPlugIn.createWebApplicationContext(ContextLoaderPlugIn.java:353)rn at org.springframework.web.struts.ContextLoaderPlugIn.initWebApplicationContext(ContextLoaderPlugIn.java:296)rn at org.springframework.web.struts.ContextLoaderPlugIn.init(ContextLoaderPlugIn.java:225)rn at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)rn at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)rn at javax.servlet.GenericServlet.init(GenericServlet.java:212)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:451)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnrn2008-4-22 15:41:18 org.apache.catalina.core.ApplicationContext logrn严重: action: null
关于org.springframework.beans.factory.BeanCreationException
[b]org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'paymentReportService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.yl.hr.service.PunchCardService com.yl.hr.service.impl.PaymentReportServiceImpl.punchCardService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'punchCardService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yl.pms.service.UserService com.yl.hr.service.impl.PunchCardServiceImpl.userService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.yl.pms.service.UserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)[/b]rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1073)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)rn at org.apache.catalina.startup.Embedded.start(Embedded.java:825)rn at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)rn at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)rn at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)rn at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)rn at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)rn at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)rn at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)rn at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)rn at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)rn at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)rn at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)rn at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)rn at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)rn at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)rn at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)rn at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:601)rn at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)rn at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)rn at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)rn at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)rn at org.codehaus.classworlds.Launcher.main(Launcher.java:47)rnCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.yl.hr.service.PunchCardService com.yl.hr.service.impl.PaymentReportServiceImpl.punchCardService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'punchCardService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yl.pms.service.UserService com.yl.hr.service.impl.PunchCardServiceImpl.userService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.yl.pms.service.UserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)rn ... 45 morernCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'punchCardService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yl.pms.service.UserService com.yl.hr.service.impl.PunchCardServiceImpl.userService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.yl.pms.service.UserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1073)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)rn ... 47 morernCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yl.pms.service.UserService com.yl.hr.service.impl.PunchCardServiceImpl.userService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.yl.pms.service.UserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)rn ... 58 morern[b]注:这个项目在我的Myeclipse上报错但是在我同事的eclipse上运行就没有问题[/b]
org.springframework.beans.factory.BeanCreationException问题
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_filterChainProxy': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_filterChainList': Cannot resolve reference to bean '_rememberMeFilter' while setting bean property 'filters' with key [6]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeFilter': Cannot resolve reference to bean '_rememberMeServices' while setting bean property 'rememberMeServices'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeServices': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private flex.messaging.MessageBroker com.htinf.uimp.common.user.service.security.MyUserDetailServiceImpl.messageBroker; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageBroker': Invocation of init method failed; nested exception is flex.messaging.config.ConfigurationException: Unrecognized tag found in . rn这是什么问题?各位大大
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件