<?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>291</bug_id>
          
          <creation_ts>2002-11-07 21:36:09 +0000</creation_ts>
          <short_desc>Client confused when connecting to server with same POA name</short_desc>
          <delta_ts>2003-06-09 16:11:47 +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>POA</component>
          <version>1.4.1</version>
          <rep_platform>All</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>313</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Nedde">dnedde</reporter>
          <assigned_to name="Reimo Tiedemann">tie</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>513</commentid>
    <comment_count>0</comment_count>
    <who name="David Nedde">dnedde</who>
    <bug_when>2002-11-07 21:36:09 +0000</bug_when>
    <thetext>If the JacORB server has a POA name that matches the JacORB client&apos;s POA name, 
and the client calls _is_existent on the server object, the client thinks the 
server&apos;s POA is it&apos;s local POA, with NullPointerException resulting.

Workaround: make sure server and client use different names for their POA.

Below is the code I used to create the POA, in case this is specific to the 
policy I am using.

/** 
 * Create and return a POA configured with the desired policies. 
 * @return null if failure to create the poa.
 */
static public POA createPoa( ORB orb )
{
    POA serverPoa = null;

    try
    {
        // Resolve Root POA
        POA rootPoa = 
            POAHelper.narrow(orb.resolve_initial_references(&quot;RootPOA&quot;));

        // Create policies for our serverPOA
        org.omg.CORBA.Policy [] policies = {
            // PERSISTENT POA creates CORBA objects where the object ids of
            // created objects outlive the process in which they are
            // created.
            rootPoa.create_lifespan_policy(LifespanPolicyValue.PERSISTENT),
        };

        // Create our serverPOA with the right policies.  
        // The lifespan policy of Root POA is TRANSIENT and we want
        // PERSISTENT.
        serverPoa = rootPoa.create_POA( &quot;Poa&quot;, 
                                        rootPoa.the_POAManager(), policies);

        // Activate all POAs managed by the POA manager, i.e., allow them
        // to listen for requests.
        rootPoa.the_POAManager().activate();
    }
    catch ( org.omg.CORBA.ORBPackage.InvalidName e )
    {
        System.out.println(&quot;Exception resolving RootPOA&quot; );
        e.printStackTrace();
    }
    catch ( org.omg.PortableServer.POAPackage.AdapterAlreadyExists e )
    {
        System.out.println(&quot;Exception creating serverPoa&quot; );
        e.printStackTrace();
    }
    catch ( org.omg.PortableServer.POAPackage.InvalidPolicy e )
    {
        System.out.println(&quot;Exception creating serverPoa&quot; );
        e.printStackTrace();
    }
    catch ( org.omg.PortableServer.POAManagerPackage.AdapterInactive e )
    {
        System.out.println(&quot;Exception activating POA manager&quot; );
        e.printStackTrace();
    }

    return serverPoa;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655</commentid>
    <comment_count>1</comment_count>
    <who name="Nick Cross">rnc</who>
    <bug_when>2003-06-09 16:11:47 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 313 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>