Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

java.io.NotSerializableException

Help
rocky316
2007-01-12
2013-01-13
  • rocky316
    rocky316
    2007-01-12

    Hi,

       I am using cewolf in one of my projects.My environment uses weblogic 8.1 sp5.Basically I am using cewolf with struts application.But whenever I change a source file in some other application(other than cewolf), the chart image does not appear.It is blank.But whenever I re-deploy my application, it works fine.Actually I don't have to re-deploy my application because the file which I have changed reflects those changes.The only reason I had to re-deploy is because the cewolf doesn't work.

    I get the following error message when the chart image is blank.

    <Jan 12, 2007 7:44:02 AM CST> <Error> <HTTP> <101002> <[ServletContext(id=24798854,name=blink,context-path=/blink)] Could not deserialize context attribute
    java.io.NotSerializableException: de.laures.cewolf.Configuration

    Start server side stack trace:
    java.io.NotSerializableException: de.laures.cewolf.Configuration
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
        at weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:91)
        at weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:66)
        at weblogic.servlet.internal.WebAppServletContext.getAttribute(WebAppServletContext.java:416)
        at org.apache.struts.action.ActionServlet.destroyModules(ActionServlet.java:721)
        at org.apache.struts.action.ActionServlet.destroy(ActionServlet.java:430)
        at weblogic.servlet.internal.ServletStubImpl$ServletDestroyAction.run(ServletStubImpl.java:1108)
        at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
        at weblogic.servlet.internal.ServletStubImpl.destroyServlet(ServletStubImpl.java:599)
        at weblogic.servlet.internal.ServletStubImpl.destroyServlet(ServletStubImpl.java:625)
        at weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.java:704)
        at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:538)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:364)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
        at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)

    Did anyone encounter such problems?Can anyone guide me through this.

    Thanks
    Rakesh.

     
    • y_masa
      y_masa
      2007-01-16

      Root cause is that de.laures.cewolf.Configuration is not serializable.

      Some J2EE Servlet container requires to be serializable to implement replication (session persistance, migration between VMs etc.).

      Weblogic requires ServletContext attributes to be serializable .

      (see http://lists.ofbiz.org/pipermail/dev/2004-April/004775.html\)

      I think de.laures.cewolf.Configuration and de.laures.cewolf.Strage should implement java.io.Serializable.

       
    • rocky316
      rocky316
      2007-01-16

      hi,

         Thanks for the reply to my problem.I did make the Configuration & Storage implement the java.io.Serializable interface,but yet it doesn't solve my problem.I still get an empty chart when I modify some file.The only way I can make it to work is to re-deploy the application.

      Do you think this has to do with anything else?

      Thanks for your suggestions.

      Rakesh.

       
    • y_masa
      y_masa
      2007-01-19

      Implementation class instance of Storage may be non-serizlizable.

      Serialization Spacification (http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf) sais:
      -------------------------------------------
      A Serializable class must do the following:
      • Implement the java.io.Serializable interface
      • Identify the fields that should be serializable
      (Use the serialPersistentFields member to explicitly declare them
      serializable or use the transient keyword to denote nonserializable fields.)
      • Have access to the no-arg constructor of its first nonserializable superclass
      -------------------------------------------

      Findbugs can suggest some serialization problem.
      http://sourceforge.net/projects/findbugs