用的是tomcat7,然后第一次登录所有功能 正常使用,没有问题,然后点击退出,再次登录时报错:求大神!

解决方案 »

  1.   

    应该和tomcat无关,看看登出操作,都做了些什么。方便的话,可以把这块的代码拿来看看啊~
      

  2.   

    的一次登录网页正常,退出后第二次登报错?看看你处理登录和退出的servlet
      

  3.   

    内存溢出有很多原因的,在myeclipse把tomcat的jdk中的Optional Java VM argument:-Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m,意思网上搜,再者就是好好检查程序吧,把程序优化一下
      

  4.   


    package com.ldm.user.quit;
    import com.opensymphony.xwork2.Action;
    import com.opensymphony.xwork2.ActionSupport;public class QuitAction extends ActionSupport {

    private static final long serialVersionUID = -3561246517849289095L;

    public String execute() throws Exception {
    QuitProcessor quit = new QuitProcessor();

    if (quit.quitSystem()) {
    return Action.LOGIN;
    }

    this.addActionMessage(quit.getMessage());
    return Action.ERROR;
    }

    }
      

  5.   


    package com.ldm.user.quit;import java.util.Hashtable;
    import java.util.Map;import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;import com.opensymphony.xwork2.ActionContext;
    import com.ldm.login.Login;public class QuitProcessor {
    final static Log logger = LogFactory.getLog(QuitProcessor.class);

    private String message;

    public QuitProcessor() {
    this.message = "";
    }

    /**
     * @return the message
     */
    public String getMessage() {
    return message;
    }

    /**
     * @param message
     *            the message to set
     */
    public void setMessage(String message) {
    this.message = message;
    }

    @SuppressWarnings("unchecked")
    public boolean quitSystem() {
    Map<?, ?> session = ActionContext.getContext().getSession();
    Map<?, ?> application = ActionContext.getContext().getApplication();

    Login login = (Login) session.get("user");

    if (null == login || "".equals(login.getUsername().trim())) {

    this.message = "退出系统错误--Session error";
    logger.debug(this.message);
    return false;
    }
    try {
    application.remove(login.getUsername());
    session.clear();
    return true;
    } catch (Exception e) {
    this.message = "退出系统错误--application error";
    logger.error("quit system error!", e);
    }

    return false;
    }
    }
      

  6.   


    import com.opensymphony.xwork2.Action;
    import com.opensymphony.xwork2.ActionSupport;public class QuitAction extends ActionSupport {

    private static final long serialVersionUID = -3561246517849289095L;

    public String execute() throws Exception {
    QuitProcessor quit = new QuitProcessor();

    if (quit.quitSystem()) {
    return Action.LOGIN;
    }

    this.addActionMessage(quit.getMessage());
    return Action.ERROR;
    }

    }
    //import java.util.Hashtable;
    import java.util.Map;import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;import com.opensymphony.xwork2.ActionContext;
    import com.ldm.login.Login;public class QuitProcessor {
    final static Log logger = LogFactory.getLog(QuitProcessor.class);

    private String message;

    public QuitProcessor() {
    this.message = "";
    }

    /**
     * @return the message
     */
    public String getMessage() {
    return message;
    }

    /**
     * @param message
     *            the message to set
     */
    public void setMessage(String message) {
    this.message = message;
    }

    @SuppressWarnings("unchecked")
    public boolean quitSystem() {
    Map<?, ?> session = ActionContext.getContext().getSession();
    Map<?, ?> application = ActionContext.getContext().getApplication();

    Login login = (Login) session.get("user");

    if (null == login || "".equals(login.getUsername().trim())) {

    this.message = "退出系统错误--Session error";
    logger.debug(this.message);
    return false;
    }
    try {
    application.remove(login.getUsername());
    session.clear();
    return true;
    } catch (Exception e) {
    this.message = "退出系统错误--application error";
    logger.error("quit system error!", e);
    }

    return false;
    }
    }
      

  7.   

    退出没有任何error是把?tghl是什么目录?LZ的工程名是什么?把路径关系截个图发下呗?
    另外,是否存在jsp跳转涉及/tghl相关的?(嗯,日志看不出你的类有问题,猜测与配置的路径有关;登出的Action,建议将remove和clear操作注释掉试试能否正常再次登录)
      

  8.   


    tghl是项目名,跳转路径是对的啊,第一次登录一切能用,退出后也能登录,但是里面的功能不能用
      

  9.   

    个人觉得不是tomcat的原因,要看看你退出的代码是怎么写的,可能是退出那边有毛病