Forum Stats

  • 3,815,377 Users
  • 2,259,010 Discussions
  • 7,893,063 Comments

Discussions

Getting java.io.NotSerializableException: oracle.adf.share.logging.ADFLogger for HA enabled apps

Team,

We are planning to make our application HA enabled. Made the necessary configuration and deployed the apps. When running the app getting below error

All session objects should be serializable to replicate. Check the objects in the session. Failed to replicate a non-serializable object in context /AppName/CRoot. java.rmi.MarshalException: failed to marshal update(Lweblogic.cluster.replication.ROID;ILjava.io.Serializable;Ljava.lang.Object;); nested exception is: java.io.NotSerializableException: oracle.adf.share.logging.ADFLogger at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:100) at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:297) at weblogic.cluster.replication.RemoteReplicationServicesInternalImpl_12213_WLStub.update(Unknown Source) at sun.reflect.GeneratedMethodAccessor1277.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at weblogic.cluster.replication.SecureReplicationInvocationHandler$ReplicationServicesInvocationAction.run(SecureReplicationInvocationHandler.java:222) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:137) at weblogic.cluster.replication.SecureReplicationInvocationHandler.invoke(SecureReplicationInvocationHandler.java:192) at com.sun.proxy.$Proxy261.update(Unknown Source) at weblogic.cluster.replication.ReplicationServicesImplBase.sendUpdateRequestToSecondary(ReplicationServicesImplBase.java:1670) at weblogic.cluster.replication.ReplicationServicesImplBase.updateSecondaryInternal(ReplicationServicesImplBase.java:1559) at weblogic.cluster.replication.ReplicationServicesImplBase.updateSecondary(ReplicationServicesImplBase.java:1525) at weblogic.cluster.replication.ReplicationServicesImplBase.updateSecondary(ReplicationServicesImplBase.java:1520) at weblogic.servlet.internal.session.ReplicatedSessionData._syncSession(ReplicatedSessionData.java:741) at weblogic.servlet.internal.session.ReplicatedSessionData.syncSession(ReplicatedSessionData.java:705) at weblogic.servlet.internal.session.SessionContext.sync(SessionContext.java:161) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:3447) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSessions(ServletRequestImpl.java:3425) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:3413) at weblogic.servlet.internal.ServletResponseImpl$1.run(ServletResponseImpl.java:1811) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344) at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197) at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203) at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) at weblogic.servlet.internal.ServletResponseImpl.syncSession(ServletResponseImpl.java:1807) at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:1742) at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1715) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665) at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272) at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352) at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337) at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57) at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41) at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420) at weblogic.work.ExecuteThread.run(ExecuteThread.java:360) Caused By: java.io.NotSerializableException: oracle.adf.share.logging.ADFLogger at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at weblogic.servlet.internal.session.ReplicatedSessionChange.writeMapKeysAndValuesToStream(ReplicatedSessionChange.java:234) at weblogic.servlet.internal.session.ReplicatedSessionChange.writeExternal(ReplicatedSessionChange.java:202) at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at weblogic.cluster.replication.WrappedSerializable.writeExternal(WrappedSerializable.java:23) at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:674) at weblogic.rjvm.MsgAbbrevOutputStream.writeObjectWL(MsgAbbrevOutputStream.java:666) at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:38) at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:96) at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:297) at weblogic.cluster.replication.RemoteReplicationServicesInternalImpl_12213_WLStub.update(Unknown Source) at sun.reflect.GeneratedMethodAccessor1277.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at weblogic.cluster.replication.SecureReplicationInvocationHandler$ReplicationServicesInvocationAction.run(SecureReplicationInvocationHandler.java:222) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:137) at weblogic.cluster.replication.SecureReplicationInvocationHandler.invoke(SecureReplicationInvocationHandler.java:192) at com.sun.proxy.$Proxy261.update(Unknown Source) at weblogic.cluster.replication.ReplicationServicesImplBase.sendUpdateRequestToSecondary(ReplicationServicesImplBase.java:1670) at weblogic.cluster.replication.ReplicationServicesImplBase.updateSecondaryInternal(ReplicationServicesImplBase.java:1559) at weblogic.cluster.replication.ReplicationServicesImplBase.updateSecondary(ReplicationServicesImplBase.java:1525) at weblogic.cluster.replication.ReplicationServicesImplBase.updateSecondary(ReplicationServicesImplBase.java:1520) at weblogic.servlet.internal.session.ReplicatedSessionData._syncSession(ReplicatedSessionData.java:741) at weblogic.servlet.internal.session.ReplicatedSessionData.syncSession(ReplicatedSessionData.java:705) at weblogic.servlet.internal.session.SessionContext.sync(SessionContext.java:161) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:3447) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSessions(ServletRequestImpl.java:3425) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:3413) at weblogic.servlet.internal.ServletResponseImpl$1.run(ServletResponseImpl.java:1811) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344) at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197) at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203) at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) at weblogic.servlet.internal.ServletResponseImpl.syncSession(ServletResponseImpl.java:1807) at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:1742) at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1715) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665) at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272) at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352) at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337) at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57) at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41) at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420) at weblogic.work.ExecuteThread.run(ExecuteThread.java:360) 

Tagged:

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,270 Red Diamond

    Well, that's plain java. If you mark a class to be serializable, all properties or class variables should be serializable. In your case, the ADFLogger is not serializable and your class can't be serialized.

    A solution is to make the ADFLogger transient as transient variables are not serialized.


    Timo

  • dvohra21
    dvohra21 Member Posts: 14,486 Gold Crown

    Your application is attempting to place a non-serializable object in the HttpSession. The problem is not in one of your classes, but a standard Java class oracle.adf.share.logging.ADFLogger, which is not serializable and is being added to the HttpSession.

  • dvohra21
    dvohra21 Member Posts: 14,486 Gold Crown

    For a serializable logger, use class ContextualLoggerProvider which extends LoggerProvider<ContextualLogger>, which implements java.io.Serializable

    This provider will always create instances of DefaultContextualLogger. Consumers are free to extend this provider and override method createLogger() to make it create any custom implementation of the FunctionalLogger interface.