Possible. Here is text of email I sent Jules Gosnell.  He replied back that my
analysis was correct and that he would make changes in sourceforge.  I don't
know if he did, nor if this problem is the one you are having, nor what version
you are using  - I've not been following this thread that closely.  I've
attached the complete file as I have it onw my own machine.  It might be
beneficial if you compare it with what you have on your machine.

<snip>
I have been trying to get clustered http sessions to work with EXTENDED
Clustering turned on.

I was getting a ClassNotFoundException from the ois.readObject call in
MarshallingInterceptor.demarshal() whenever I tried to get an object
from the session.

It seemed strange to me that the marshal method was returning
baos.toString() instead of baos.toByteArray() because without an
encoding scheme, toString always puts 0 for the hi order byte of every
character.  I'm not an expert in this, but my impression is that
toString changes some of the bytes in the array inorder to make it a
proper string.

So I tried an experient that seems to work.  I changed marshal to return
byte[] and changed it to call baos.toByteArray and I changed demarshal
signature to byte[]  and any other changes required to make it compile
and it seems to work.  Also, with the change, the session info seems to
be replicated to the other instance of JBoss.

Would you give this some thought, and if I am right, make the official
change to the source forge.  marshal and demarshal are below.

  protected byte[]
    marshal(Object value)
    throws IOException
  {
    if (value==null)
      return null;

    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    ObjectOutputStream    oos =new ObjectOutputStream(baos);
    oos.writeObject(value);
    oos.flush();
    return baos.toByteArray();
  }

  protected Object
    demarshal (byte[] bytes)
    throws IOException,ClassNotFoundException
  {
    if (bytes==null)
      return bytes;

    ByteArrayInputStream bais=new ByteArrayInputStream(bytes);
    ObjectInputStream    ois =new ObjectInputStream(bais);
    return ois.readObject();
  }
</snip>


"Kim, Yong" wrote:

> Yes, it's serializable.
>
> Possible bug in "org.mortbay.j2ee.session.MarshallingInterceptor"?
>
> Mitchell Kim
>
> -----Original Message-----
> From: Greg Turner [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 11:29 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] Http Session Clustering problem
>
> Have you verified that your object is truely serializable.  Implementing
> Serializable is not a sufficient condition !   Verify by writing a simple
> program with main that instantiates your object, serializes it to a file,
> and
> then read back in from file.
>
> "Kim, Yong" wrote:
>
> > Sacha,
> > I have gone through all of my ear, jar, war, and so on to see if I have
> > multiple copies of the same class and they are not.  I was sure about this
> > but wanted to double check.
> >
> > Anyway, I am still having the same problem and this is driving me crzay.
> >
> > Here is the most recent error messages...  They are same as before... but.
> >
> > Thanks, Mitchell.
> >
> > 10:59:08,595 ERROR [MarshallingInterceptor] could not get Attribute:
> > credential
> > java.io.InvalidClassException:
> > com.staples.business.security.ApplicationSecurityCredential; Local class
> not
> > compatible: stream classdesc serialVersionUID=4701685434102361783 local
> > class serialVersionU
> > ID=4723640482285792951
> >         at
> > java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:523)
> >         at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:567)
> >         at
> > java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)
> >         at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
> >         at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
> >         at
> > java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
> >         at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
> >         at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
> >         at
> >
> org.mortbay.j2ee.session.MarshallingInterceptor.demarshal(MarshallingInterce
> > ptor.java:84)
> >         at
> >
> org.mortbay.j2ee.session.MarshallingInterceptor.getAttribute(MarshallingInte
> > rceptor.java:93)
> >         at
> >
> org.mortbay.j2ee.session.StateInterceptor.getAttribute(StateInterceptor.java
> > :43)
> >         at
> >
> org.mortbay.j2ee.session.StateInterceptor.getAttribute(StateInterceptor.java
> > :43)
> >         at
> >
> org.mortbay.j2ee.session.TypeCheckingInterceptor.getAttribute(TypeCheckingIn
> > terceptor.java:90)
> >         at
> > org.mortbay.j2ee.session.StateAdaptor.getAttribute(StateAdaptor.java:204)
> >         at
> >
> org.apache.jsp.securitychecker$jsp._jspService(securitychecker$jsp.java:447)
> >         at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> >
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> > va:201)
> >         at
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
> >         at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:344)
> >         at
> >
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandl
> > er.java:313)
> >         at
> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:554)
> >         at
> >
> org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler
> > .java:199)
> >         at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
> >         at org.mortbay.http.HttpContext.handle(HttpContext.java:1522)
> >         at org.mortbay.http.HttpServer.service(HttpServer.java:795)
> >         at org.jboss.jetty.Jetty.service(Jetty.java:531)
> >         at
> org.mortbay.http.HttpConnection.service(HttpConnection.java:784)
> >         at
> > org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:941)
> >         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:799)
> >         at
> > org.mortbay.http.SocketListener.handleConnection(SocketListener.java:186)
> >         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:322)
> >         at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:716)
> >         at java.lang.Thread.run(Thread.java:484)
> >
> > -----Original Message-----
> > From: Sacha Labourey [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, September 12, 2002 3:14 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [JBoss-user] Http Session Clustering problem
> >
> > Maybe because you write an e-mail every 2-hours with a new question:
> people
> > sleep and are at work sometime.
> >
> > Are you sure your class is not present in two differents xARs? What is
> your
> > packaging structure?
> >
> > > -----Message d'origine-----
> > > De : [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]]De la part de Kim, Yong
> > > Envoyé : mercredi, 11 septembre 2002 21:17
> > > À : '[EMAIL PROTECTED]'
> > > Objet : RE: [JBoss-user] Http Session Clustering problem
> > >
> > >
> > > Why is everyone so quiet?!  Nobody uses JBoss HTTP session clustering in
> > > their environment?  Am I the only one having this issue?
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
>
> --
> Greg Turner, JBoss Authorized Consultant
>
> Tiburon Enterprise Systems
> http://www.tiburon-e-systems.com
> Box 1171
> Tiburon, CA 94920
> 415-332-3363
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user

--
Greg Turner, JBoss Authorized Consultant

Tiburon Enterprise Systems
http://www.tiburon-e-systems.com
Box 1171
Tiburon, CA 94920
415-332-3363

Attachment: MarshallingInterceptor.java
Description: application/unknown-content-type-java_auto_file

Reply via email to