This discussion is archived
11 Replies Latest reply: Aug 8, 2012 9:02 AM by Daniel Merchán RSS

NotSerializableException

ngsankar Journeyer
Currently Being Moderated
Experts, Can anyone have idea about the below exception? if yes how to overcome the same?

<SessionBasedScopeMap> <writeScopeMap> ADFc: Scope Object serialization failed (object can not be serialized), scope = pageFlowScope [ oracle / Webcenter / admin / view / JSF / taskFlowDefs / producer.xml # Producer], objectKey = ProducerConnection, object type = oracle.webcenter . admin.view.backing.ProducerConnection. <SessionBasedScopeMap> <writeScopeMap>
java.io.NotSerializableException: oracle.webcenter.admin.view.backing.ProducerConnection
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
     at oracle.adfinternal.controller.util.Utils.verifySerializable(Utils.java:341)
     at oracle.adfinternal.controller.state.SessionBasedScopeMap.writeScopeMap(SessionBasedScopeMap.java:122)
     at oracle.adfinternal.controller.state.PageFlowScope.writeObject(PageFlowScope.java:156)
     at sun.reflect.GeneratedMethodAccessor677.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
     at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1247)
     at sun.reflect.GeneratedMethodAccessor618.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
     at java.util.Hashtable.writeObject(Hashtable.java:824)
     at sun.reflect.GeneratedMethodAccessor862.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
     at weblogic.common.internal.PassivationUtils.toByteArray(PassivationUtils.java:33)
     at weblogic.common.internal.PassivationUtils.toByteArray(PassivationUtils.java:24)
     at weblogic.common.internal.PassivationUtils.sizeOf(PassivationUtils.java:59)
     at weblogic.servlet.internal.session.SessionData.calculateSessionSize(SessionData.java:1032)
     at weblogic.servlet.internal.session.SessionData.syncSession(SessionData.java:1022)
     at weblogic.servlet.internal.session.MemorySessionContext.sync(MemorySessionContext.java:101)
     at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2860)
     at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2835)
     at weblogic.servlet.internal.ServletResponseImpl$1.run(ServletResponseImpl.java:1485)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
     at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:1479)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1462)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

Edited by: ngsankar on Aug 7, 2012 5:34 PM
  • 1. Re: NotSerializableException
    Daniel Merchán Expert
    Currently Being Moderated
    Hi.

    Is a clustered enviroment?.

    Are you binding a UI Component to pageFlowScope bean?.

    Regards.
  • 2. Re: NotSerializableException
    Daniel Merchán Expert
    Currently Being Moderated
    Hi again.

    In clustered enviroments ensure that:

    All managed beans with a life span longer than one request are serializable (that is, they implement the java.io.Serializable interface).
    Beans stored in session scope, page flow scope, and view scope need to be serializable.

    Regards.
  • 3. Re: NotSerializableException
    ngsankar Journeyer
    Currently Being Moderated
    Hi Daniel, It is not an clustered envorionment,
    we are getting the same error even in the jdeveloper,
  • 4. Re: NotSerializableException
    938689 Newbie
    Currently Being Moderated
    Hi ngsankar.

    All the managed beans should be serializable because the container may occassionally serialize and passivate the beans or send it over the network. This occurs in situations
    such as heavy load (our case) or when clustering is enabled.

    Another tip:
    - The managed beans with pageFlow or session scope are required to be serialized while backingBean or request scope are not required to be serialized.
    - The ADF/JSF Rich UI components are not serializable and hence they should not be present in pageFlow scope managed beans.

    Response: Your pageFlowScope bean should implements Serializable.

    Regards.
  • 5. Re: NotSerializableException
    Daniel Merchán Expert
    Currently Being Moderated
    Hi ngsankar.

    935686 is me.

    Regards.
  • 6. Re: NotSerializableException
    ngsankar Journeyer
    Currently Being Moderated
    Hi Daniel,

    Iam very thankful for your immediate response, let me check and get back you with the result...

    Thanks,
    NGSankar
  • 7. Re: NotSerializableException
    951396 Newbie
    Currently Being Moderated
    For above error java.io.NotSerializableException: oracle.webcenter.admin.view.backing.ProducerConnection. Pleae find solution below.

    In weblogic.xml settings please do the following line comment mentioned below .


    <?xml version = '1.0' encoding = 'UTF-8'?>
    <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
    <!--
    If you change this file, make sure to change it's counterpart in src/main/deployment/weblogic.xml
    -->
    <!-- Comment out persistent store to fix serialization problem with webcenter portal

    <!--session-descriptor>
    <debug-enabled>true</debug-enabled>
    <max-in-memory-sessions>5000</max-in-memory-sessions>
    <cookie-http-only>false</cookie-http-only>
    <persistent-store-type>MEMORY</persistent-store-type>
    <encode-session-id-in-query-params>false</encode-session-id-in-query-params>
    <sharing-enabled>true</sharing-enabled>
    </session-descriptor-->
    -->
    </weblogic-web-app>


    That's it. No error will be displayed...

    Many thanks
    CN Balu Ramesh

    Edited by: 948393 on Aug 8, 2012 1:43 AM

    Edited by: 948393 on Aug 8, 2012 1:44 AM

    Edited by: 948393 on Aug 8, 2012 3:38 AM
  • 8. Re: NotSerializableException
    ngsankar Journeyer
    Currently Being Moderated
    Hi Balu, Thanks for your response,
    by the changing the web.xml will not write the debug messages in the logs, but we are not actually taking care of the exception, iam looking for the soution to handle the exception...
  • 9. Re: NotSerializableException
    Daniel Merchán Expert
    Currently Being Moderated
    Hi.

    Setting implements Serializable and configuring persistence-store in your weblogic.xml will fix your problem.

    Please share news if you achieve a solution, is an interesting thread.

    Regards.
  • 10. Re: NotSerializableException
    ngsankar Journeyer
    Currently Being Moderated
    Daniel sorry i did't get you, if you disable the entries in weblogic.xml it will not write the debug messages in the log, Correct me if iam not correct...
  • 11. Re: NotSerializableException
    Daniel Merchán Expert
    Currently Being Moderated
    Hi again.

    The workaround that you have to follow is:
    - Your beans higher than backing and request scopes should implements java.io.Serializable.Or test your bindings.
    - In weblogic.xml set persistence-store settings. Persistence store settings is for seralize information when you have a heavy load or clustered enviroments (probably your problem is a heavy load).
    Setting configuration like Balu says you are configuring persistence-store to serialize information in JVM Memory (by default your app should serializing at memory).

    However, to see exactly the problem set this JVM parameter at Run properties of your Portal JDeveloper:
    -Dorg.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION=all
    And share to us log info.

    Regards.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points