ORBit-Python problem :(

Discussion in 'Python' started by Akhilesh S. Shirbhate, May 15, 2004.

  1. I wrote a small CORBA program and am using ORBit-python.
    The IDL file was as below:
    ---------------------------
    module MESSAGING
    {
    typedef sequence<string> msgLines;
    struct msg
    {
    string fr;
    string to;
    msgLines body;
    };
    interface mail
    {
    void submit (in msg message);
    };
    };
    ---------------------------------



    The server program is as below:
    ---------------------------------
    #!/usr/bin/python
    import CORBA
    class mail:
    msg = 0
    def submit(self, msg):
    print "Message Recieved from:", msg.fr
    print "Message for:", msg.to
    for line in msg.body:
    print line
    self.msgs = self.msgs + 1;
    print "Message Served: ", self.msgs

    CORBA.load_idl("msg.idl")
    CORBA.load_idl("/usr/share/idl/name-service.idl")

    orb = CORBA.ORB_init((), CORBA.ORB_ID)
    poa = orb.resolve_initial_references("RootPOA")

    servant = POA.MESSAGING.mail(mail())
    poa.activate_object(servant)
    ref = poa.servant_to_reference(servant)
    open("./msg-server.ior","w").write(orb.object_to_string(ref))
    print "Wrote IOR to file", orb.object_to_string(ref)
    poa.the_POAManager.activate()
    orb.run()
    ---------------------------------

    After running the program, it gives the following errors:
    ---------------------------------
    Traceback (innermost last):
    File "./msg-server.py", line 14, in ?
    CORBA.load_idl("msg.idl")
    AttributeError: load_idl
    ---------------------------------

    If I change the CORBA.load_idl to CORBA._load_idl then the error comes
    at some other place... Namely below:

    ---------------------------------
    Traceback (innermost last):
    File "./msg-server.py", line 20, in ?
    servant = POA.MESSAGING.mail(mail())
    NameError: POA
    ---------------------------------

    The CORBA module is dynamically loaded from the following file:
    /usr/lib/python1.5/site-packages/CORBAmodule.so

    I have installed orbit-python-0.3.0-1 on my machine.

    Please help me out.. I need help desperately to run the server :((
    Thanx in advance :)
    Akhilesh S. Shirbhate, May 15, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. newbieSatSeeker

    Re: Orbit propagator in java ?

    newbieSatSeeker, Jan 27, 2005, in forum: Java
    Replies:
    0
    Views:
    760
    newbieSatSeeker
    Jan 27, 2005
  2. Replies:
    0
    Views:
    729
  3. Kira Yamato

    Defining orbit schemes

    Kira Yamato, Nov 10, 2007, in forum: C++
    Replies:
    2
    Views:
    290
    Rolf Magnus
    Nov 10, 2007
  4. Paul Moore
    Replies:
    0
    Views:
    600
    Paul Moore
    Mar 1, 2008
  5. Martin v. Löwis
    Replies:
    0
    Views:
    641
    Martin v. Löwis
    Mar 1, 2008
Loading...

Share This Page