[jacorb-developer] _non_existent throws OBJECT_NOT_EXIST instead of returning true

Hugo Roenick hroenick at gmail.com
Wed Jun 19 02:15:00 CEST 2013


Hi everyone.

> On Friday, September 28, 2012 18:54:36 Nick Cross wrote:
> > Hi,
> > 
> > Please can you retest using the current version and provide a test case.
> > If you wanted you can access the code in github and provide a pull request.
> 
> I will try using the latest version of JacORB when I find the time and let you 
> know my findings.
> 
> For now I created a workaround helper method that wraps the call in a try 
> catch and returns true when it catches the OBJECT_NOT_EXIST exception.
> 
> > Thanks
> > 
> > Nick
> 
> Thanks!
> 
> Lothar


I'd like to confirm this bug reported in september-2012 by Lothar Werzinger (lothar at tradescape.biz). Hoping to help to fix it, I made a small change in the demo "corbaloc" provided in the Jocorb 3.2 package. The change I made basically was only to replace the object key of the costructed corbaloc in the client side to an invalid one.

FROM:

      // Lets call the known short object key
      System.out.println ("Calling server using short key form...");

      org.omg.CORBA.Object obj = orb.string_to_object("corbaloc:iiop:127.0.0.1:6969/VeryShortKey");

TO:

    // Lets call the known short object key
    System.out.println("Calling server using short key form...");

    // Building a corbalog with invalid ObjectKey
    org.omg.CORBA.Object obj =
      orb.string_to_object("corbaloc:iiop:127.0.0.1:6969/InvalidKey");
    try {
      if (obj != null && !obj._non_existent()) {
        System.out.println("Object does exists");
      }
      else {
        System.out.println("Object does not exists");
      }
    }
    catch (OBJECT_NOT_EXIST e) {
      System.err.println("We found a bug! :-s");
      e.printStackTrace();
      return;
    }



Running the demo, we have the following result:

     [jaco] Calling server using short key form...
     [jaco] Jun 18, 2013 2:42:09 PM org.jacorb.orb.giop.ClientConnectionManager getConnection
     [jaco] INFO: ClientConnectionManager: found ClientGIOPConnection to 127.0.0.1:6969 (53c86be5)
     [jaco] Jun 18, 2013 2:42:09 PM org.jacorb.orb.giop.ServerRequestListener requestReceived
     [jaco] WARNING: Received a request with a non-jacorb object key
     [jaco] We found a bug! :-s
     [jaco] org.omg.CORBA.OBJECT_NOT_EXIST: Server-side Exception: null
     [jaco] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     [jaco] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     [jaco] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     [jaco] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     [jaco] 	at org.jacorb.orb.SystemExceptionHelper.read(SystemExceptionHelper.java:222)
     [jaco] 	at org.jacorb.orb.ReplyReceiver.getReply(ReplyReceiver.java:455)
     [jaco] 	at org.jacorb.orb.Delegate._invoke_internal(Delegate.java:1389)
     [jaco] 	at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1160)
     [jaco] 	at org.jacorb.orb.Delegate.invoke(Delegate.java:1148)
     [jaco] 	at org.jacorb.orb.Delegate.invokeBuiltin(Delegate.java:2039)
     [jaco] 	at org.jacorb.orb.Delegate.non_existent(Delegate.java:1996)
     [jaco] 	at org.omg.CORBA.portable.ObjectImpl._non_existent(ObjectImpl.java:61)
     [jaco] 	at demo.corbaloc.Client.main(Client.java:31)


Regards,
-- Hugo 



More information about the jacorb-developer mailing list