[erlang-questions] Orber: struct IFR id not found

Niclas Eklund nick@REDACTED
Wed Dec 13 12:43:05 CET 2006


Hello!

You need to register the module in the IFR (see also
http://www.erlang.org/doc/doc-5.5.2/lib/orber-3.6.3/doc/html/ch_debugging.html#14).

Depending on the name of the IDL-file, there shall be a generated file
named oe_<IDL FILE NAME>.erl. 

I recommend that you use the IC compile flag 'light_ifr' and activate 
Light IFR when starting Orber. On the server side you can change the code
to ({flags, 16#0080} activates light IFR):

run() ->
    corba:orb_init([{flags, 16#0080},
                    {orber_debug_level, 10}]),
    orber:jump_start(4030),
    oe_<IDL FILE NAME>:oe_register(),
    Server = 'Foo':oe_create(),
    corba:add_initial_service("Test", Server).

You also need to register it on the client side.

/Nick

On Wed, 13 Dec 2006, Dominic Williams wrote:

> Hello,
> 
> I am having difficulties getting Orber to decode structs
> (its IFR Id is not found).
> 
> With the following simplified IDL:
> 
> struct Person {
>   string name;
>   short age;
> };
> 
> interface Foo {
>   Person echo_person(in Person person);
> };
> 
> ... a client that just does:
> 
> run() ->
>     orber:jump_start(4031),
>     orber:configure(orber_debug_level,10),
>     Server = corba:string_to_object("corbaloc:iiop:127.0.0.1:4030/Test"),
>     'Foo':echo_person(Server, #'Person'{name="Dominic", age=36}).
> 
> ... a server that just does:
> 
> run() ->
>     orber:jump_start(4030),
>     orber:configure(orber_debug_level,10),
>     Server = 'Foo':oe_create(),
>     corba:add_initial_service("Test", Server).
> 
> ... and the following implementation:
> 
> -module('Foo_impl').
> -export([init/1, terminate/2, echo_person/2]).
> 
> init(_) ->
>     {ok, []}.
> 
> terminate(_, _) ->
>     ok.
> 
> echo_person(State, Arg) ->
>     io:fwrite("echo_person: ~p~n", [Arg]),
>     {reply, Arg, State}.
> 
> 
> ... the client prints the following errors:
> 
> =ERROR REPORT==== 13-Dec-2006::10:36:20 ===
> Error in process <0.39.0> on node 'client@REDACTED' with exit value:
> {{nocatch,{'EXCEPTION',{'MARSHAL',[],16#4552000A,'COMPLETED_MAYBE'}}},[{corba,raise,1},{shell,exprs,6},{shell,eval_loop,3}]}
> 
> ** exited:
> {{nocatch,{'EXCEPTION',{'MARSHAL',[],1163001866,'COMPLETED_MAYBE'}}},
>             [{corba,raise,1},{shell,exprs,6},{shell,eval_loop,3}]} **
> 
> 
> ... the server prints the following errors:
> 
> =ERROR REPORT==== 13-Dec-2006::11:36:20 ===
> =================== Orber =================
> [1103] cdr_decode:ifrid_to_name("IDL:Person:1.0"). IFR Id not found: []
> ===========================================
> 
> =ERROR REPORT==== 13-Dec-2006::11:36:20 ===
> =================== Orber =================
> [330] orber_iiop_inrequest:decode_body({request_header,
>                                            [],
>                                            1,
>                                            true,
>                                            {'Foo',
>                                                key,
>                                                <<131,104,2,104,3,98,0,0,4,142,98,0,0,24,31,98,0,9,181,43,100,0,16,115,101,114,118,101,114,64,108,111,99,97,108,104,111,115,116>>,
>                                                <<131,100,0,9,117,110,100,101,102,105,110,101,100>>,
>                                                0,
>                                                0},
>                                            echo_person,
>                                            "client@REDACTED"},
> <<71,73,79,80,1,0,0,0,0,0,0,166,0,0,0,0,0,0,0,1,1,3,3,3,0,0,0,96,49,50,55,46,48,46,48,46,49,58,52,48,51,48,7,131,104,6,100,0,3,70,111,111,100,0,3,107,101,121,109,0,0,0,39,131,104,2,104,3,98,0,0,4,142,98,0,0,24,31,98,0,9,181,43,100,0,16,115,101,114,118,101,114,64,108,111,99,97,108,104,111,115,116,109,0,0,0,13,131,100,0,9,117,110,100,101,102,105,110,101,100,97,0,97,0,0,0,0,12,101,99,104,111,95,112,101,114,115,111,110,0,0,0,0,17,99,108,105,101,110,116,64,108,111,99,97,108,104,111,115,116,0,3,3,3,0,0,0,8,68,111,109,105,110,105,99,0,0,36>>)
> Failed decoding request body: {'MARSHAL',[],1163001866,'COMPLETED_MAYBE'}
> ===========================================
> 
> Any help would be much appreciated.
> 
> I am using R10B-10, but I get the same thing with the latest
> R11B-2.
> 
> Cheers,
> 
> Dominic Williams
> http://www.dominicwilliams.net
> 
> ----
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
> 





More information about the erlang-questions mailing list