<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.jacorb.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://www.jacorb.org/bugzilla/"
          
          maintainer="jacorb@goots.org"
>

    <bug>
          <bug_id>981</bug_id>
          
          <creation_ts>2014-04-22 05:31:56 +0000</creation_ts>
          <short_desc>Serialization in NamingContextImpl causes ClassCastException</short_desc>
          <delta_ts>2014-07-11 08:39:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>JacORB</product>
          <component>ORB</component>
          <version>3.2</version>
          <rep_platform>Other</rep_platform>
          <op_sys>AIX</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>tomasz.patola</reporter>
          <assigned_to name="Mailinglist to track bugs">jacorb-bugs</assigned_to>
          <cc>jacorb</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3124</commentid>
    <comment_count>0</comment_count>
    <who name="">tomasz.patola</who>
    <bug_when>2014-04-22 05:31:56 +0000</bug_when>
    <thetext>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&apos;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&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3131</commentid>
    <comment_count>1</comment_count>
    <who name="Nick Cross">jacorb</who>
    <bug_when>2014-04-25 18:02:19 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3199</commentid>
    <comment_count>2</comment_count>
    <who name="Nick Cross">jacorb</who>
    <bug_when>2014-07-11 08:39:26 +0000</bug_when>
    <thetext>Can you please reproduce this with 3.5 (and reopen the ticket). Debug logs and a test case would be very helpful</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>