日期:2014-05-17  浏览次数:20682 次

【略相关】求助亿能的JavaWeb高手们
警告: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
可是我实在是不知道我的问题出在哪,我用工厂建的类,我觉得应该是建类没建成功?
这是我的config.properties
mlpUserDao=com.hxy.mlp.dao.MlpUserDao
mlpHomeDao=com.hxy.mlp.dao.MlpHomeDao
mlpCategoryDao=com.hxy.mlp.dao.MlpCategoryDao
mlpArticleDao=com.hxy.mlp.dao.MlpArticleDao
mlpReviewDao=com.hxy.mlp.dao.MlpReviewDao
mlpPictureDao=com.hxy.mlp.dao.MlpPictureDao
mlpMsgDao=com.hxy.mlp.dao.MlpMsgDao
mlpUserService=com.hxy.mlp.service.MlpUserService
mlpHomeService=com.hxy.mlp.service.MlpHomeService
mlpCategoryService=com.hxy.mlp.service.MlpCategoryService
mlpArticleService=com.hxy.mlp.service.MlpArticleService
mlpReviewService=com.hxy.mlp.service.MlpReviewService
mlpPictureService=com.hxy.mlp.service.MlpPictureService
mlpMsgService=com.hxy.mlp.service.MlpMsgService

StartServlet
Java code
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hxy.mlp.common;

import java.io.FileInputStream;
import java.io.InputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

/**
 *
 * @author Arondight
 */
public class StartServlet extends HttpServlet {

    @Override
    public void init() throws ServletException {
        try {
            String path = this.getServletContext().getRealPath("/WEB-INF/config.properties");
            InputStream in = new FileInputStream(path);
            Config.prop.load(in);
        } catch (Exception ex) {
            throw new ServletException(ex.getMessage());
        }
    }
}


工厂类
Java code
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hxy.mlp.common;

import com.hxy.mlp.idao.*;
import com.hxy.mlp.iservice.*;

/**
 *
 * @author Arondight
 */
public class MyFactory {

    private static Object getObject(String name) {
        try {
            String className = Config.prop.getProperty(name);
            Object obj = Class.forName(className).newInstance();
            return obj;
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }
    }

    public static IMlpUserDao createMlpUserDao() {
        return (IMlpUserDao) getObject("mlpUserDao");
    }

    public static IMlpHomeDao createMlpHomeDao() {
        return (IMlpHomeDao) getObject("mlpHomeDao");
    }

    public static IMlpCategoryDao createMlpCategoryDao() {
        return (IMlpCategoryDao) getObject("mlpCategoryDao");
    }

    public static IMlpArticleDao createMlpArticleDao() {
        return (IMlpArticleDao) getObject("mlpArticleDao");
    }

    public static IMlpReviewDao createMlpReviewDao() {
        return (IMlpReviewDao) getObject("mlpReviewDao");
    }

    public static IMlpPictureDao createMlpPictureDao() {
        return (IMlpPictureDao) getObject("mlpPictureDao");
    }

    public static IMlpMsgDao createMlpMsgDao() {
        return (IMlpMsgDao) getObject("mlpMsgDao");
    }

    public static IMlpUserService createMlpUserService() {
        return (IMlpUserService) getObject("mlpUserService");
    }

    public static IMlpHomeService createMlpHomeService() {
        return (IMlpHomeService) getObject("mlpHomeService");
    }

    public static IMlp