0

我在下面的构造函数中得到了一个 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");
    }
    ....
4

1 回答 1

0

您是否尝试过 ommit addCssaddJs确保问题不在实现方法之内?

于 2012-04-26T23:00:55.200 回答