Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues
Bug 313 - Same POA name on 2 different jvms on same machine - NullPointerException
Summary: Same POA name on 2 different jvms on same machine - NullPointerException
Status: RESOLVED FIXED
Alias: None
Product: JacORB
Classification: Unclassified
Component: ORB (show other bugs)
Version: 1.4.1
Hardware: Other AIX
: P3 major
Assignee: Nick Cross
URL:
: 291 418 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-01-15 17:25 CET by john.seltzer
Modified: 2003-12-01 11:58 CET (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description john.seltzer 2003-01-15 17:25:27 CET
Case 1:
jvm 1 instantiates interface "Test1" on OAPort N and in Persistent Poa 
named "MyPoa"
It is a server process.

jvm 2 instantiates interface "Test2" on OAPort N+1 and in Persistent Poa 
named "MyPoa".  Poa in jvm 2 has the SAME name as the Poa in jvm 1.
It is a server process, but it also is a client to interface "Test1" in jvm 1.

When I call non_existent, I get a NullPointerException:
java.lang.NullPointerException
01/14 18:53:58:ERR:[Conn_FileReadService]:java.lang.NullPointerException
java.lang.NullPointerException
	at org.jacorb.orb.Delegate.non_existent(Delegate.java:1304)
	at org.omg.CORBA.portable.ObjectImpl._non_existent(ObjectImpl.java:57)
Because reference "so" in Delegate.java is null.

This is all because the orb is wrongly assuming that is_really_local is true.  
I think it implies that it thinks that the implemention could be running in the 
same VM.  And further tests described later imply this also.
With jacorb.verbosity=2, I see this before the NullPointerException:
############################ StackTrace ############################
org.omg.PortableServer.POAPackage.ObjectNotActive: 
IDL:omg.org/PortableServer/POA/ObjectNotActive:1.0
	at org.jacorb.poa.POA.reference_to_servant(POA.java:1380)
	at org.jacorb.orb.Delegate.servant_preinvoke(Delegate.java:1473)
	at org.jacorb.orb.Delegate.non_existent(Delegate.java:1300)
	at org.omg.CORBA.portable.ObjectImpl._non_existent(ObjectImpl.java:57)

So, it should recover from this and just return true for_non_existent
-------------------------------------------------------------------------
Next case, 

Case 2:
jvm 1 instantiates interface "Test1" on OAPort N and in Persistent Poa 
named "MyPoa"
It is a server process.

jvm 2 instantiates interface "Test1" on OAPort N+1 and in Persistent Poa 
named "MyPoa".  Poa in jvm 2 has the SAME name as the Poa in jvm 1.
The difference from Case1 is that both jvms are invoking the SAME interface
It is a server process, but it also is a client to interface "Test1" in jvm 1.  

When I invoke _non_existent here, it returns false, and I am able to invoke a 
method on interface 1.  I think that jvm2 is actually invoking the method on 
it's OWN implementation in it's OWN jvm.  I think this because there is no line 
that says:
[ ConnectionManager: created new conn to target xx.xx.xx.xx:portN+1].

Is it assuming that I want to talk to this interface in the same JVM?
This is really a test to prove a point.  It's not as important as Case 1.
Comment 1 Gerard Burnside 2003-03-21 10:31:25 CET
I experienced a similar problem; the work-around was to use different names for 
the two POAs.

G.Burnside - Alcatel
Comment 2 Simon McQueen 2003-03-21 10:59:51 CET
... or alternately if you wished to keep the same POA names you could set
different jacorb.implname property values for each server.
Comment 3 Nick Cross 2003-06-09 16:11:48 CEST
*** Bug 291 has been marked as a duplicate of this bug. ***
Comment 4 Nick Cross 2003-08-11 16:06:05 CEST
Solutions suggested. Error handling improved, see bug 313
Comment 5 Nick Cross 2003-08-11 16:06:53 CEST
Correction - Error handling improved, see bug 208
Comment 6 Simon McQueen 2003-12-01 11:58:38 CET
*** Bug 418 has been marked as a duplicate of this bug. ***