[omniORB] BAD_TYPECODE: Java <--> Python

entonh at gmx.de entonh at gmx.de
Fri Feb 6 12:06:27 GMT 2009


Here is an extract from the java implementation:

public Any getVariable(String Name) throws Exception 
{
	try 
        {
		Object[] objectArray = Server.getVariable(Name);
		org.omg.CORBA.Any aAny = orb.create_any();
                HelperJava.insertObjectArray(aAny, objectArray);
		return aAny;
	} 
        catch (Exception e) 
        {
		throw new Exception(e.getMessage());
	}
}

The message after calling getVariable by the python client sounds like:

Exception: BAD_TYPECODE ... COMPLETED YES

The idl was created before the programming started.

Cheers,
EntonH

-------- Original-Nachricht --------
> Datum: Thu, 05 Feb 2009 15:41:57 +0000
> Von: Duncan Grisby <duncan at grisby.org>
> An: EntonH <entonh at gmx.de>
> CC: omniorb-list at omniorb-support.com
> Betreff: Re: [omniORB] BAD_TYPECODE: Java <--> Python

> 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 --

-- 
Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL 
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a



More information about the omniORB-list mailing list