空指针异常
java.lang.NullPointerException 
at com.jeecms.article.entity.Article.writeContent(Article.java:158) 
at com.jeecms.article.manager.impl.ArticleMngImpl.save(ArticleMngImpl.java:127) 
对象没有初始化值就用。
错误已经报的非常的清楚了

解决方案 »

  1.   

    在你程序中一步步的调试吧 用System.out.print() 输出看看  是哪个变量或对象为 null 的
      

  2.   

    查一下要转向的地方用到的值,是否为NULL
      

  3.   

    String path = Thread.currentThread().getContextClassLoader()
    .getResource("").getPath();
    Configuration conf = new Configuration(path + "static.properties");
    String ftlTemplate = conf.getValue("article.ftlTemplate");
    String savePath = conf.getValue("article.savePath");
    String saveFilename = this.getHtmlFile();
    HashMap contents = new HashMap();
    contents.put("arti", this);
    ServletContext sc = ServletActionContext.getServletContext();
    try {
    templateGenerate.HtmlTemplateGenerator(sc);
    templateGenerate.create(ftlTemplate, contents, savePath,
    saveFilename);
    } catch (IOException e) {
    e.printStackTrace();
    } catch (TemplateException e) {
    e.printStackTrace();
    }跳到红色那行报错。。但是sc是有值的。。