tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: serializable class not persisting (long email)
Date Mon, 05 May 2003 18:42:04 GMT

Howdy,
It doesn't seem like the problem is in the actual
serializing/de-serializing of the class.  You don't get a
readObject/writeObject exception nor a SerializationException.

It seems like the class is not found during session archive
de-serialization.  Try putting the jar with the class in it in
common/lib instead of WEB-INF/lib and see if that makes a difference.

Also, the [Lextras.SearchResult indicates an attempt to de-serialize an
array of SearchResult items, not just one SearchResult instance.  This
is fine, just wanted to make sure you were aware of it.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Chris Cheshire [mailto:ccheshire@bigredwire.com]
>Sent: Monday, May 05, 2003 2:25 PM
>To: Tomcat Users List
>Subject: serializable class not persisting (long email)
>
>
>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(WebappClassLoade
r.ja
>va:1443)
>        at
>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade
r.ja
>va:1289)
>        at
>org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObj
ectI
>nputStream.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(StandardSess
ion.
>java:864)
>        at
>org.apache.catalina.session.StandardManager.load(StandardManager.java:4
40)
>        at
>org.apache.catalina.session.StandardManager.start(StandardManager.java:
655)
>        at
>org.apache.catalina.core.StandardContext.reload(StandardContext.java:25
72)
>        at
>org.apache.catalina.servlets.ManagerServlet.reload(ManagerServlet.java:
802)
>        at
>org.apache.catalina.servlets.HTMLManagerServlet.reload(HTMLManagerServl
et.j
>ava:501)
>        at
>org.apache.catalina.servlets.HTMLManagerServlet.doGet(HTMLManagerServle
t.ja
>va: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(Applic
atio
>nFilterChain.java:247)
>        at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
terC
>hain.java:193)
>        at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
ve.j
>ava:256)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(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(StandardContextVal
ve.j
>ava:191)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(StandardPipeline.java:643)
>        at
>org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato
rBas
>e.java:551)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(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:24
15)
>        at
>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
a:18
>0)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(StandardPipeline.java:643)
>        at
>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV
alve
>.java:171)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(StandardPipeline.java:641)
>        at
>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
a:17
>2)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(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
.jav
>a:174)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(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(ThreadPoo
l.ja
>va: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(WebappClassLoade
r.ja
>va:1443)
>        at
>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade
r.ja
>va:1289)
>        at
>org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObj
ectI
>nputStream.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(StandardSess
ion.
>java:864)
>        at
>org.apache.catalina.session.StandardManager.load(StandardManager.java:4
40)
>        at
>org.apache.catalina.session.StandardManager.start(StandardManager.java:
655)
>        at
>org.apache.catalina.core.StandardContext.reload(StandardContext.java:25
72)
>        at
>org.apache.catalina.servlets.ManagerServlet.reload(ManagerServlet.java:
802)
>        at
>org.apache.catalina.servlets.HTMLManagerServlet.reload(HTMLManagerServl
et.j
>ava:501)
>        at
>org.apache.catalina.servlets.HTMLManagerServlet.doGet(HTMLManagerServle
t.ja
>va: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(Applic
atio
>nFilterChain.java:247)
>        at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
terC
>hain.java:193)
>        at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
ve.j
>ava:256)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(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(StandardContextVal
ve.j
>ava:191)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(StandardPipeline.java:643)
>        at
>org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato
rBas
>e.java:551)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(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:24
15)
>        at
>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
a:18
>0)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(StandardPipeline.java:643)
>        at
>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV
alve
>.java:171)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(StandardPipeline.java:641)
>        at
>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
a:17
>2)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(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
.jav
>a:174)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
>keNext(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(ThreadPoo
l.ja
>va: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




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
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