I used the following idl to build a simple server:
enum color_list { red, black, green };
module foo {
interface etest {
color_list getColor();
void setColor(in color_list aColor);
};
};
I purposely caused an enumeration range exception to be thrown
by writing the following Joe client code:
import sunw.corba.*;
import sunw.joe.*;
import idlGlobal.*;
import foo.*;
public
class etestClient {
static Joe orb;
static etestRef etestObject;
static final int green=7;
static
void colorIs(int aColor) {
if(aColor == color_list.red)
System.out.println("red");
}
public static
void main(String[] args) {
int someColor;
try {
orb = new Joe("localhost");
ObjectRef obj = orb.find("etest");
etestObject = etestStub.narrow(obj);
etestObject.setColor(color_list.red);
someColor = etestObject.getColor();
colorIs(someColor);
etestObject.setColor(green);
someColor = etestObject.getColor();
colorIs(someColor);
}
catch(CORBAException e) {
System.out.println("corba exception raised: ");
e.printStackTrace();
System.exit(1);
}
}
}
The output of the programis as follows
red
java.lang.Error: Inconsistent exceptions in invoke: sunw.corba.EnumerationRangeException
at foo.etestStub.setColor(etestStub.java:67)
at etestClient.main(etestClient.java:33)
This seems to be a problem with Joe's handling of server
side exceptions due to the fact that a java.lang.Error is
raised because of the incosistency betweem the
sunw.corba.EnumerationRangeException and the
java.lang.Exception.
enum color_list { red, black, green };
module foo {
interface etest {
color_list getColor();
void setColor(in color_list aColor);
};
};
I purposely caused an enumeration range exception to be thrown
by writing the following Joe client code:
import sunw.corba.*;
import sunw.joe.*;
import idlGlobal.*;
import foo.*;
public
class etestClient {
static Joe orb;
static etestRef etestObject;
static final int green=7;
static
void colorIs(int aColor) {
if(aColor == color_list.red)
System.out.println("red");
}
public static
void main(String[] args) {
int someColor;
try {
orb = new Joe("localhost");
ObjectRef obj = orb.find("etest");
etestObject = etestStub.narrow(obj);
etestObject.setColor(color_list.red);
someColor = etestObject.getColor();
colorIs(someColor);
etestObject.setColor(green);
someColor = etestObject.getColor();
colorIs(someColor);
}
catch(CORBAException e) {
System.out.println("corba exception raised: ");
e.printStackTrace();
System.exit(1);
}
}
}
The output of the programis as follows
red
java.lang.Error: Inconsistent exceptions in invoke: sunw.corba.EnumerationRangeException
at foo.etestStub.setColor(etestStub.java:67)
at etestClient.main(etestClient.java:33)
This seems to be a problem with Joe's handling of server
side exceptions due to the fact that a java.lang.Error is
raised because of the incosistency betweem the
sunw.corba.EnumerationRangeException and the
java.lang.Exception.