严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expertUserService' defined in ServletContext resource [/WEB-INF/ApplicationContext-service.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'expertUserDAO' of bean class [cn.ytc.xxkj.service.impl.ExpertUserServiceImp]: Bean property 'expertUserDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'expertUserDAO' of bean class [cn.ytc.xxkj.service.impl.ExpertUserServiceImp]: Bean property 'expertUserDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:793)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1127)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:424)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2011-10-24 17:08:30 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2011-10-24 17:08:30 org.apache.catalina.core.StandardContext start
严重: Context [/CMSWebAdmin] startup failed due to previous errors
2011-10-24 17:08:30 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2011-10-24 17:08:31 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2011-10-24 17:08:31 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2011-10-24 17:08:31 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/31  config=null
2011-10-24 17:08:31 org.apache.catalina.startup.Catalina start
信息: Server startup in 7457 ms
Exception in thread "HouseKeeper" java.lang.NullPointerException
at org.logicalcobwebs.proxool.HouseKeeperController.getHouseKeeperToRun(HouseKeeperController.java:53)
at org.logicalcobwebs.proxool.HouseKeeperThread.run(HouseKeeperThread.java:33)

解决方案 »

  1.   

    有可能是 struts2 配置文件中的 listener (监听器)配错了吧,导致无法启动Spring框架。
      

  2.   

     Invalid property 'expertUserDAO' of bean class [cn.ytc.xxkj.service.impl.ExpertUserServiceImp]: Bean property 'expertUserDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?ExpertUserServiceImp类中的'expertUserDAO' 属性set注入时发生错误。
    建议检查一下有没有正确的set方法,也就是setExpertUserDAO方法
    如果ExpertUserServiceImp类中有该方法,则检查一下你在配置的XML文件中传入的参数类型是否匹配,可在setExpertUserDAO方法里断点来直接查看
      

  3.   

    ExpertUserServiceImp类中的'expertUserDAO' 属性set注入时发生错误。
    建议检查一下有没有正确的set方法,也就是setExpertUserDAO方法
    如果ExpertUserServiceImp类中有该方法,则检查一下你在配置的XML文件中传入的参数类型是否匹配,可在setExpertUserDAO方法里断点来直接查看
      

  4.   

    [cn.ytc.xxkj.service.impl.ExpertUserServiceImp]: Bean property 'expertUserDAO' is not writable or has an invalid setter method. 很可能的就是楼主的expertUserDAO属性没有get和set方法
      

  5.   

    to:liwenso
    非常感谢你啊,分太少,对不住了。我就是少写了setExpertUserDAO方法