Struts Problem Report
Struts has detected an unhandled exception:
Messages:
No unique bean of type [net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj] is defined: Unsatisfied dependency of type [class net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj]: expected at least 1 matching bean
Error creating bean with name 'net.shougongfang.action.paymoney.AlipayPayMoneyReturnAction': Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj] is defined: Unsatisfied dependency of type [class net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj]: expected at least 1 matching bean
Unable to instantiate Action, net.shougongfang.action.paymoney.AlipayPayMoneyReturnAction, defined for 'alipay_pay_money_return' in namespace '/paymoney'Error creating bean with name 'net.shougongfang.action.paymoney.AlipayPayMoneyReturnAction': Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj] is defined: Unsatisfied dependency of type [class net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj]: expected at least 1 matching bean
File: org/springframework/beans/factory/support/DefaultListableBeanFactory.java
Line number: 613
Stacktraces
Unable to instantiate Action, net.shougongfang.action.paymoney.AlipayPayMoneyReturnAction, defined for 'alipay_pay_money_return' in namespace '/paymoney'Error creating bean with name 'net.shougongfang.action.paymoney.AlipayPayMoneyReturnAction': Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj] is defined: Unsatisfied dependency of type [class net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj]: expected at least 1 matching bean
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:307)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:388)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:187)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
java.lang.Thread.run(Thread.java:619)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'net.shougongfang.action.paymoney.AlipayPayMoneyReturnAction': Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj] is defined: Unsatisfied dependency of type [class net.shougongfang.action.paymoney.AlipayPayMoneyReturnObj]: expected at least 1 matching bean
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:292)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:329)
com.opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:182)
com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:162)
com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:133)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:139)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:109)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:288)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:388)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:187)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
java.lang.Thread.run(Thread.java:619)
原因:
AlipayPayMoneyReturnAction 类中,有
AlipayPayMoneyReturnObj alipayPayMoneyReturnObj; 成员变量
这个是一个辅助类,没有抽象接口,所有需要直接注入
@Component
public class AlipayPayMoneyReturnObj
另外增加AlipayPayMoneyReturnObj的构造函数.
分享到:
相关推荐
它主要通过Struts2的IoC(Inversion of Control)容器来实现,该容器负责管理对象的生命周期,并根据配置将依赖注入到对象中。在Struts2中,可以通过Action类的getter和setter方法来定义可注入的属性。当配置文件...
Struts Bean标签是Java Web开发中Struts框架的一部分,它主要用于简化页面上的Java对象操作,尤其是在JSP页面中。这个标签库提供了丰富的功能,包括显示和设置Bean中的属性,以及进行一些基本的数据转换和格式化。...
在Spring与Struts2集成时,Spring可以作为Struts2的依赖注入容器,负责初始化和管理Action类,使得我们在Action中可以直接使用由Spring管理的其他服务组件。 然后,Hibernate作为ORM框架,使得数据库操作更加简单。...
3. 类加载器问题:Struts2使用了自定义的类加载机制,这为攻击者提供了利用的机会。通过特定的请求,攻击者可能可以加载并执行恶意类,进一步执行RCE。 4. 漏洞利用库:攻击者通常会利用已知的Struts2漏洞库,如CVE...
3. **参数注入**:Struts2支持从请求中自动注入表单参数到Action类的属性中。在Action类中定义与表单字段同名的属性,Struts2会自动将请求参数值赋给这些属性。此外,Struts2还支持通过`@Param`注解来指定参数映射,...
前几天在网上下载一个struts2的helloword的例子,那个作者也真够缺德的,搞个错误...看网上都催struts2比struts1 整的整的好,我看就这个问题,完全可以算struts2是个垃圾 我现在把完整的程序提供给大家,希望大家看看
我们将深入探讨如何解决在MyEclipse环境下开发Struts应用时遇到的一个常见问题:“org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.bean....
在Struts中,`struts-bean:message`标签是用于处理国际化(i18n)和本地化(l10n)的关键组件,它允许开发者在应用中方便地显示多语言支持的文本。这篇博客文章可能详细解释了如何使用`<bean:message>`标签来实现...
- **Struts2** 为每个请求创建新的Action实例,解决了线程安全问题,同时也更易于管理和测试。 5. **Servlet依赖** - **Struts1.x** 的Action类直接依赖于Servlet API,这使得测试变得更加困难。 - **Struts2** ...
struts-bean
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="myDefaultActionMapper" class="com.struts2.MyDefaultActionMapper" /> <constant name="struts.mapper.class" value=...
9. **struts2-spring-plugin**: 与Spring框架的整合插件,允许Struts2的Action和其它组件注入Spring管理的bean,实现依赖注入和事务管理。 10. **struts2-plugins**: 除了上述特定功能的插件外,Struts2还包含一...
struts-bean.tld struts开发插件
在Struts2SpringUnitDemo中,Action类通常会与Spring的bean进行整合,以便利用Spring的依赖注入。 2. **Spring框架**:Spring是Java企业级应用的基石,提供了一个全面的编程和配置模型,支持事务管理、数据访问、...
2009 MLDN魔乐科技 Struts课堂实战视频教程 全6讲 01-Struts_简介与登陆...02-Struts_工作原理与核心配置 03-Struts_对于输入参数的处理 04-Struts_Bean标签功能 05-Struts_Struts国际化处理 非常经典,适合初学者!
4. **Action类设计**:Action类需要实现Spring的`ApplicationContextAware`接口,以便在Struts2中获取Spring的ApplicationContext,从而能够注入其他服务。例如: ```java public class ExampleAction implements ...
4. **Spring插件**:在Struts2中使用Spring插件(struts2-spring-plugin),这个插件能够帮助Struts2与Spring进行交互,自动将Action类实例化并注入依赖。 5. **Action类**:Action类需要实现Spring的`org.spring...
- **Action代理**:Struts2-Spring插件会自动查找Spring容器中的Action Bean,避免了手动创建Action实例。 - **结果映射**:Struts2的结果映射依然正常配置,但Action的实例由Spring提供。 6. **优势**: - **松...
Struts2是一个强大的MVC(Model-View-Controller)框架,主要用于处理Web层的业务逻辑,而Spring则是一个全面的企业应用框架,提供依赖注入(DI)、面向切面编程(AOP)以及容器管理等服务。将Struts2和Spring整合...
在没有Struts2-Spring-Plugin的情况下,要在Struts2应用中使用Spring,需要手动配置Action类与Spring Bean之间的关联。而有了这个插件,配置过程变得更加简单。以下是Struts2-Spring-Plugin-2.2.1.jar提供的主要功能...