|
|
The Gallery of Java CORBA Non-ComplianceIt is inevitable that given a specification, different readers will have different interpretations of how to translate that document into bits and bytes.This page lists all the non-compliances I know about in Java implementations of OMG specifications. Non-compliance can be difficult to prove. After all, no one has yet defined a foolproof mapping between English prose and binary digits. Therefore, even behavior that is not clearly non-compliant but merely at variance with other implementations of that behavior that is also not clearly non-compliant is worth discussing because it points to places where the specification may need to be clarified. A major source of confusion is that CORBA vendors do not hesitate to claim compliance with OMG specifications but very rarely actually state with which specifications they actually comply. In the issues explored below, all documents relied upon directly are specified unambiguously. Issue 1: CosNaming:NamingContext:rebind and OrbixWeb 3.0COSNaming::NamingContext::rebind() wrongly fails with the CosNaming::NamingContext::NotFound exception when the Name does not exist in the context prior to invocation in Iona OrbixWeb 3.0 Update 1.From the OMG CORBAservices Specification:The CORBAservices Specification (OMG document formal/98-07-05) specifies the CosNaming::NamingContext::rebind method as follows, on page 3-8:void rebind(in Name n, in Object obj)Table 3-1 on page 3-9 specifies the exceptions that can be raised by any of the four binding operations (bind, rebind, bind_context, rebind_context) to be: Table 3-1 Exceptions Raised by Binding Operations
From the OrbixWeb Documentation:The OrbixWeb 3.0 Programmer's Guide, November 1997 (found in the OrbixWeb 3.0 for Win32 March 1998 distribution as Iona\OrbixWeb3.0\docs\OW3PrgGuide.pdf), page 184, documents the corresponding method org.omg.CosNaming.NamingContext.rebind as:void rebind(in Name n, in Object o) Analysis of the problem:The OrbixWeb rebind method does indeed behave as documented: A NotFound exeception is thrown if the name is not already in use. Coupled with the statement that rebind "creates a binding between a name that is already bound in the context and an object", we deduce that this implementation will never create a binding where a binding involving that name does not already exist in the context.However, the OMG Specification states that rebind will "[c]reate[] a
binding of a name and an object in the naming context even if the
To further bolster this interpretation, both Sun Java IDL (as of JDK 1.2 beta 4) and Inprise Visibroker for Java 3.2 both in text and in code make it clear that creation of a binding where none previously existed is the repsonsibility of the rebind method. From Sun JDK 1.2 beta 4 documentation:rebindpublic void rebind(NameComponent[] n,
Unbinds the given name from an object and rebinds
it to the given object. If the given name is not already bound to an
Naming contexts that are bound using this method
do not participate in name resolution when compound names are passed
Throws:
CannotProceed
- when the implementation has given up for some reason. The client, however,
may be able to
InvalidName - if the name is invalid From the Visibroker Naming and Event Services 3.3 manual:void rebind(in Name n, in Object obj)raises(NotFound, CannotProceed, InvalidName); This method is exactly the same as the bind
method, except that the AlreadyBound exception will never be raised. If
the
Code that illustrates the problem:Hello.idl:#ifndef _HELLO_IDL
module Hello
interface HelloWorld
attribute string color; };
#endif HelloWorldServer.java: package Hello; import org.omg.CosNaming.*;
public class HelloWorldServer extends _HelloWorldImplBase
ORB orb = ORB.init(argv, null); // create servant and register it with
the ORB
// get the root naming context
// bind the Object Reference in Naming
public synchronized void setHello(String inString)
public synchronized void color(String inString)
public HelloWorldServer() { } private String helloString = "Hello World";
class Wait {
BuildHelloOW.bat (for Windows): rem Build HelloWorld for OrbixWeb 3.0 if not exist classes mkdir classes idl -jOMG -I. -jO . hello.idl owjavac -classpath .;c:\iona\orbixweb3.0\classes;c:\jdk1.1.6\lib\classes.zip -d .\classes *.java RunHelloOW.bat (for Windows): @echo off
rem 1. Unpack HelloJavaIDL source; make a note of where the JDK
and Hello code resides and use below where appropriate in steps 2,3 &
7.
echo Starting OrbixWeb Java daemon
echo Registering Iona's CosNaming Service
rem Modify classpath setting below to reflect location of JDK and
OrbixWeb on your system
|