1 Reply Latest reply on Apr 10, 2002 5:34 PM by Chris Harris

    Not serializable - but optimized?

    Tyson Norris Newbie

      Sorry about the FAQ-ness of this topic, but I'm getting java.io.NotSerializableException exceptions.

      My question is regarding the tomcat shared-vm optimization. I thought this optimization prevented serialization during in-vm ejb calls (between tomcat/jboss). Do my parameter classes still need to implement serializable? Will serialization be bypassed?

      I have mostly default catalina config files (with the jboss 2.4.4 tomcat 4.0.1 dist), which are all set to "Optimized=true".

      Any ideas on this?


        • 1. Re: Not serializable - but optimized?
          Chris Harris Newbie

          The optimisation happens only if the class is loaded by the same classloader on both sides - if you're loading it from different archives in the webapp and the ejb app then the chances are the container will attempt a serialisation to avoid ClassCastExceptions. This will happen even if you have the exact same bytecode in each copy of the class since the jvm regards classes loaded via different classloaders as different - regardless of their content.

          Check the location of the class you're trying to use across tomcat-jboss. If you're using separate copies in different parts of your app then the container will serialise (or try to).