org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexService' defined in file [D:\konghaoShopping\cms-web\target\classes\com\lj\cms\service\IndexService.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.lj.cms.service.IndexService]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
Caused by:
org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.lj.cms.service.IndexService]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:217)
Caused by:
java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
这里是由于我在写service的时候自定义了一个constructor,而beans.xml中并没有配置对应的依赖注入。
spring要用无参构造函数,但是不能调用。
@Service("indexService")
public class IndexService implements IIndexService{
@Autowired(required=true)
public IndexService(String ftlPath,String outPath)
{
super();
this.ftlPath=ftlPath;
this.outPath = outPath;
}
}
解决方法只要在beans.xml中配置一下对应的依赖注入即可:
<bean id="ftlPath" class="java.lang.String">
<constructor-arg value="/ftl"></constructor-arg>
</bean>
<bean id="outPath" class="java.lang.String">
<constructor-arg value="/jsp/template"></constructor-arg>
</bean>
分享到:
相关推荐
Instance of Subclass, Subclass, Instance of Superclass, Superclass,及方法直接的关系
This superclass can be used to create a simple search suggestions provider for your application Source Code for Linux.
Classes Doing Work in Constructors Default Constructors Explicit Constructors Copy Constructors Structs vs. Classes Inheritance Multiple Inheritance Interfaces Operator Overloading Access Control ...
title invoke method of superclass.
invoke method of superclass Source Code for Linux.
3.3.3Constructors 3.3.4Methods and Messaging 3.3.5Finalizers 3.3.6Subclasses 3.3.7Java Language Interfaces 3.3.8Access Control 3.3.9Packages 3.3.10Class Variables and Class Methods ...
SuperClass是JavaScript预处理器/解释器对象,旨在促进JavaScript中基于类的OOP。 注意:项目已关闭。 替换为:http://sourceforge.net/projects/jsclass
现象: … java: 1801: method does not override a method from its superclass @Override… 原因: Eclipse is defaulting to Java... but in Java 1.5 can only be applied to methods overriding a superclass meth
Noa 是一个快速、小巧、精心编写的 javascript MVC 框架。 它有3个主要目标。 成为您需要的一切。 解决大型和小型应用程序存在的常见问题和陷阱。 要容易写。文档楷模活动应用程序 诺亚Noa 有0 个依赖项。 支持 IE >...
visual c++超类化实例代码superclass_注释相当全 关于超类化的一切问题这里都有答案_产生多个超类的实例.rar
The compiler provides us with a default constructor to the class having no arguments. Abstract classes We does not make a object of the abstract class. This class must be inherited. Unlike ...
class SuperClass{ int x; SuperClass( ) { x=3; System.out.println("in SuperClass : x=" +x); } void doSomething( ) { System.out.println("in SuperClass.doSomething()"); } } class ...
AboutProperty简单获取对象属性列表,键值对,superclass列表
NULL 博文链接:https://thaipine.iteye.com/blog/2354220
解决Android studio 添加butterknife依赖,运行报错。
本篇幅内容较多,但是干货满满,不仅涉及源码分析还涉及模拟系统计算分配流程,建议分次食用,耐心看完相信会有很多收获~
11.9 Extractors with One or No Arguments L2 149 11.10 The unapplySeq Method L2 149 11.11 Dynamic Invocation L2 150 Exercises 153 12 HIGHER-ORDER FUNCTIONS L1 157 12.1 Functions as Values 157 12.2 ...
If the ViewPager has already been * through its first layout there will be a smooth animated transition * between the current item and the specified item. * * @param item * Item index to ...