[omniORB] BAD_TYPECODE: Java <--> Python
Duncan Grisby
duncan at grisby.org
Thu Feb 5 15:41:57 GMT 2009
On Wednesday 4 February, EntonH wrote:
> i want to use the omniORB implementation for Python to communicate with a
> server that was programmed in Java.
> The return type of the called Java-Method is a Object[]. Everytime I call
> this method, I receive the BAD_TYPECODE Error.
Did you start with a hand-written IDL file, or have you generated the
IDL from the Java with rmic? rmic is famous for generating broken
IDL...
> In the IDL file the method is declared as follows:
> any getVariable(in string Name)raises(Exception);
>
> The any instance on java side inherits from
> com.sun.corba.se.internal.corba.AnyImpl which inherits from
> org.omg.CORBA.Any.
>
> The any data type on java side is filled with
> insertObjectArray(org.omg.CORBA.Any a, Object[] objArray).
>
> Do i have to cast the return type before i assign it to a variable on python
> client side?
I don't understand what your Java code looks like. Can you post a
minimal example of it? What does the implementation of the
getVariable() method look like?
Run your omniORB client with command line -ORBtraceExceptions 1 . That
will tell you where the BAD_TYPECODE exception comes from. If it comes
from GIOP_C.cc, then the server sent the exception and the problem has
nothing to do with omniORB. If it comes from anywhere else, then omniORB
generated it and the problem could be on either side.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the omniORB-list
mailing list