控制器无法扩展类

时间:2012-04-26 22:55:30

标签: java spring-mvc

我正在使用下面的构造函数获取nullPointerException ...我还包含了父类。

SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentController' defined in file [C:\Users\bkuhl\JavaProjects\cmt\cmt\target\cmt\WEB-INF\classes\com\site\cmt\web\ContentController.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.fettergroup.cmt.web.ContentController]: Constructor threw exception; nested exception is java.lang.NullPointerException

并且类(构造函数被省略以便它将使用父构造函数)

public class ContentController extends com.site.cmt.library.Controller {
     ...
}

和父类

public class Controller {
    private SortedMap<Integer, String> cssFiles;
    private SortedMap<Integer, String> jsFiles;

    public Controller () {
        this.addCss("global.css");
        this.addJs("global.js");
    }
    ....

1 个答案:

答案 0 :(得分:0)

您是否尝试过省略addCssaddJs以确保问题不在实施方法内?