Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues
Bug 981 - Serialization in NamingContextImpl causes ClassCastException
Summary: Serialization in NamingContextImpl causes ClassCastException
Status: RESOLVED INVALID
Alias: None
Product: JacORB
Classification: Unclassified
Component: ORB (show other bugs)
Version: 3.2
Hardware: Other AIX
: P5 minor
Assignee: Mailinglist to track bugs
URL:
Depends on:
Blocks:
 
Reported: 2014-04-22 05:31 UTC by tomasz.patola
Modified: 2014-07-11 08:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomasz.patola 2014-04-22 05:31:56 UTC
Following was found in logs, after restarting ORB:

terminating process  38469806 
2014-04-15 13:00:46.841 INFO shutdownHook invoked
2014-04-15 13:00:46.842 INFO prepare ORB for shutdown...
2014-04-15 13:00:46.842 INFO ORB going down...

2014-04-15 13:01:34.887 INFO 
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	JacORB V 3.2, www.jacorb.org
	(C) The JacORB project 07-Dec-2012 (Build December 7 2012 13:31:5)
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-04-15 13:01:34.910 INFO InterceptorManager started with 0 Server Interceptors, 0 Client Interceptors and 1 IOR Interceptors
2014-04-15 13:01:35.030 INFO NS up
2014-04-15 13:01:35.031 INFO ORB run
2014-04-15 13:01:37.005 INFO Opened new server-side TCP/IP transport0
2014-04-15 13:01:37.023 INFO oid: 5F 72 6F 6F 74                                              _rootincarnate
2014-04-15 13:01:37.531 INFO oid: 5F 72 6F 6F 74                                              _rootobject is activated
2014-04-15 13:01:37.638 SEVERE rid: 3714 opname: resolve invocation: throwable was thrown.
    org.jacorb.naming.NamingContextImpl.resolve(NamingContextImpl.java:582)
    org.omg.CosNaming.NamingContextExtPOA._invoke(NamingContextExtPOA.java:325)
    org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:348)
    org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:670)
    org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:820)

The exception occurs the until the system is restarted (that is not only jacorb, also the clients), causing in effect, that no corba communication takes place.
The exception is thrown in following code:
NamingContextImpl.java:582
                result = (org.omg.CORBA.Object)names.get(n);


NamingContextImpl recreates in init() method the org.omg.CORBA.Object objects in Hashtable names. Here, seemingly, there were still unserialized artefacts generated with the writeObject(java.io.ObjectOutputStream out) method. 

It is unclear to me, why the init() method didn't recreate the CORBA objects in Hashtable names in time; it might be a racing condition.

It is an isolated incident, that occured in production system. 

This mechanism (exchanging objects in not typized hashtable)is implemented in all jacorb versions I've checked (2.2 onwards).
Would it be a good idea, to just disable serialization, i.e in the
NameServantActivatorImpl.incarnate( byte[] oid, POA adapter ) 
omit the line 148, where teh serialized state is read from file, and always start with uninitialized NaminContextImpl. Are there any other consequences besides performance?
Comment 1 Nick Cross 2014-04-25 18:02:19 UTC
Thanks for the report. Unfortunately your report is not showing what problem occured in the incarnate method. It might be possible to use byteman (www.jboss.org/byteman) to assist in debugging/simulating/etc this issue.
Comment 2 Nick Cross 2014-07-11 08:39:26 UTC
Can you please reproduce this with 3.5 (and reopen the ticket). Debug logs and a test case would be very helpful