tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Cheshire <cchesh...@bigredwire.com>
Subject serializable class not persisting (long email)
Date Mon, 05 May 2003 18:25:08 GMT

I am using tomcat 4.1.24 on Apache 2.0.45 on Solaris 2.8 (Intel)  with 
JDK 1.4.1-b21.

I have a class called SearchResult in a package called extras. When I 
reload the context with the manager app I get the exceptions listed below.
The class is a simple class with 4 strings, get/set methods, clone and 
toString. It implements Serializable and Cloneable (source after 
exceptions).
I get the exceptions regardless of where the class is located : ie in a 
jar in WEB-INF/lib or in its .class format in 
WEB-INF/classes/extras/SearchResult.class.

In the session I have way more involved classes that are all 
serializable and all persist properly. For some reason this class doesn't.

All my jsp and servlets that reference it compiles and runs, tomcat just 
will not persist it. Can anyone help shed some light here please?

Thanks

Chris

2003-05-05 11:11:03 StandardManager[] ClassNotFoundException while 
loading persisted sessions: java.lang.ClassNotFoundException: 
[Lextras.SearchResult;
java.lang.ClassNotFoundException: [Lextras.SearchResult;
        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1443)
        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1289)
        at 
org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:119)
        at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
        at 
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1560)
        at 
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
        at 
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1369)
        at 
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:864)
        at 
org.apache.catalina.session.StandardManager.load(StandardManager.java:440)
        at 
org.apache.catalina.session.StandardManager.start(StandardManager.java:655)
        at 
org.apache.catalina.core.StandardContext.reload(StandardContext.java:2572)
        at 
org.apache.catalina.servlets.ManagerServlet.reload(ManagerServlet.java:802)
        at 
org.apache.catalina.servlets.HTMLManagerServlet.reload(HTMLManagerServlet.java:501)
        at 
org.apache.catalina.servlets.HTMLManagerServlet.doGet(HTMLManagerServlet.java:151)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:551)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at 
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
        at 
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
        at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
        at 
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
        at java.lang.Thread.run(Thread.java:536)

2003-05-05 11:11:03 StandardManager[] Exception loading sessions from 
persistent storage
java.lang.ClassNotFoundException: [Lextras.SearchResult;
        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1443)
        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1289)
        at 
org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:119)
        at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
        at 
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1560)
        at 
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
        at 
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1369)
        at 
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:864)
        at 
org.apache.catalina.session.StandardManager.load(StandardManager.java:440)
        at 
org.apache.catalina.session.StandardManager.start(StandardManager.java:655)
        at 
org.apache.catalina.core.StandardContext.reload(StandardContext.java:2572)
        at 
org.apache.catalina.servlets.ManagerServlet.reload(ManagerServlet.java:802)
        at 
org.apache.catalina.servlets.HTMLManagerServlet.reload(HTMLManagerServlet.java:501)
        at 
org.apache.catalina.servlets.HTMLManagerServlet.doGet(HTMLManagerServlet.java:151)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:551)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at 
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
        at 
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
        at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
        at 
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
        at java.lang.Thread.run(Thread.java:536)

package extras;

import java.io.Serializable;
import com.bigredwire.util.Utility;

public class SearchResult implements Serializable, Cloneable {
   
    private String memberId;
   
    private String firstName;
   
    private String lastName;
   
    private String emailAddress;
   
    /**
     * Creates a new instance of SearchResult
     */
    public SearchResult() {
        memberId = "";
        firstName = "";
        lastName = "";
        emailAddress = "";
    }

    public String getMemberId() {
        return memberId;
    }
   
    public String getEmailAddress() {
        return emailAddress;
    }
   
    public String getFirstName() {
        return firstName;
    }
   
    public String getLastName() {
        return lastName;
    }
   
    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }
   
    public void setEmailAddress(String emailAddress) {
        this.emailAddress = emailAddress;
    }
   
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
   
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
   
    public Object clone() {
        try {
            return super.clone();
        }
        catch (CloneNotSupportedException ex) {
            throw new InternalError(ex.getMessage());
        }
    }
   
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("member id = " + memberId);
        sb.append(Utility.EOL);
        sb.append("first name = " + firstName);
        sb.append(Utility.EOL);
        sb.append("last name = " + lastName);
        sb.append(Utility.EOL);
        sb.append("email address = " + emailAddress);
        sb.append(Utility.EOL);
        return sb.toString();
    }
}




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message