473,473 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CORBA Python Query

Sorry for reposting, but please help me... I desperately need help.

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 :)
Jul 18 '05 #1
1 2310
Akhilesh S. Shirbhate wrote:
---------------------------------
Traceback (innermost last):
File "./msg-server.py", line 20, in ?
servant = POA.MESSAGING.mail(mail())
NameError: POA
---------------------------------


No wonder, as you don't import a module named POA. As you seem to look for
the generated class of your dynamically loaded idl, you might try to use
the rootpoa, thus writing

servant = poa.MESSAGING.mail(mail())

notice the lower case.

If thats no help, look into the examples from orbit python, I bet you can
find something working there.
--
Regards,

Diez B. Roggisch
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John | last post by:
I am looking at solutions for creating distributed objects. I am interested in comparing Python + CORBA (Fnorb, OmniORBPy etc) vs EJB. Could any of you who have used both contrast them for me? At...
1
by: Birgit Rahm | last post by:
Hello newsgroup, is this the right group to ask about the logging of Corba while usingomniORB for Python? I know that there are 3 funktions in the Corba package. But I dont know, where I can...
3
by: gerald.maher | last post by:
Hi, I am trying to excuate the follwong code: I get the following error: Here is my Lib path:
0
by: gerald.maher | last post by:
Hi, I just want to execute a script that used omniORB, omniORBpy Python, Here are the version that I Tried, is this correct ? omniORBpy 2.5 omniORB 4.0.5 Python 2.4.1 The script is below:
0
by: Craig Rodrigues | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.object.corba.tao This is a formal Request For Discussion (RFD) to create comp.object.corba.tao as an unmoderated world-wide Usenet newsgroup...
30
by: Kong Bhat | last post by:
With XML becoming the de facto data description standard, I am extremely surprised that there is no movement towards standardizing an xml library API for use with C and C++. Personally I have been...
0
by: none | last post by:
I have followed http://java.sun.com/j2se/1.4.2/docs/guide/idl/GShome.html to build a corba application. When i run the orb, server and client on the same machine it works fine. When i follow...
6
by: rodmc | last post by:
Can anyone recommend an easy to install COBRA implementation which works with Python? I am using Windows XP. Thanks in advance. Best, rod
4
by: Sai Krishna M | last post by:
Hi everybody, i have been developing web based applications using python+cheetah. The numbers are increasing. The applications have many common parts of code. Though these applications are...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.