WebService报错,求大神

x0516 2014-09-12 02:24:14
严重: StandardWrapper.Throwable
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cxf' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:549)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
at org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:60)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:64)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4425)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4738)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2014-9-12 14:20:27 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /test threw load() exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cxf' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:549)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
at org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:60)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:64)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4425)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4738)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2014-9-12 14:20:27 org.apache.catalina.core.ApplicationContext log
...全文
736 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
as350144 2014-09-13
  • 打赏
  • 举报
回复
bean 里没有 cxf 变量
丰王十 2014-09-12
  • 打赏
  • 举报
回复
异常太多,不想看
qq840727854 2014-09-12
  • 打赏
  • 举报
回复
UserService 无法创建,看看 是不是没有无参构造函数,或者在bean里面 配置了有参的,让他没找到相应的构造器,,你把代码的 也都贴出来吧~
x0516 2014-09-12
  • 打赏
  • 举报
回复
Caused by: java.lang.Error: Unresolved compilation problems: 
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	Service cannot be resolved to a type
	Transactional cannot be resolved to a type
	Autowired cannot be resolved to a type
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session

	at service.UserService.<init>(UserService.java:21)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
	... 45 more
2014-9-12 14:20:31 org.apache.catalina.core.ApplicationContext log
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'UserService' defined in URL [file:/E:/apache-tomcat-6.0.41/webapps/test/WEB-INF/classes/applicationContext-webservice.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [service.UserService]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	Service cannot be resolved to a type
	Transactional cannot be resolved to a type
	Autowired cannot be resolved to a type
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4425)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4738)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [service.UserService]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	Service cannot be resolved to a type
	Transactional cannot be resolved to a type
	Autowired cannot be resolved to a type
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session

	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
	... 43 more

x0516 2014-09-12
  • 打赏
  • 举报
回复
信息: Initializing Spring FrameworkServlet 'springMVC'
(6802 ms) [main] ERROR: org.springframework.web.servlet.DispatcherServlet#initServletBean : Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'UserService' defined in URL [file:/E:/apache-tomcat-6.0.41/webapps/test/WEB-INF/classes/applicationContext-webservice.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [service.UserService]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	Service cannot be resolved to a type
	Transactional cannot be resolved to a type
	Autowired cannot be resolved to a type
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4425)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4738)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [service.UserService]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	The import org.springframework cannot be resolved
	Service cannot be resolved to a type
	Transactional cannot be resolved to a type
	Autowired cannot be resolved to a type
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	The method getCurrentSession() from the type UserDao refers to the missing type Session
	BeanUtils cannot be resolved
	The method getCurrentSession() from the type UserDao refers to the missing type Session

	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
	... 43 more

67,550

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧