Problem when invoking name service from Visibroker
Sai-Lai Lo
S.Lo@orl.co.uk
20 Aug 1997 18:09:11 +0100
Hi! I hope when you say "omniBroker", you mean omniORB :-)
The problem you have experienced is caused by a bug in omniidl2
(omniORB_2.2.0):
The stub code to unmarshal user exception allocates the
wrong size buffer for the repository ID string. This causes marshalling
failures when the exception has a #pragma prefix defined.
This bug has been reported by several users.
The following patch to omniidl2 fix the problem:
------------------------- Cut here ------------------------------------
*** omniORB_2.2.0/src/tool/omniidl2/omniORB2_be/o2be_exception.cc Tue May 6 14:54:52 1997
--- /project/omni/develop/src/tool/omniidl2/omniORB2_be/o2be_exception.cc Wed Aug 13 10:23:45 1997
***************
*** 25,30 ****
--- 25,35 ----
/*
$Log: o2be_exception.cc,v $
+ Revision 1.5 1997/08/13 09:23:38 sll
+ o2be_exception::repoIdConstLen() now returns the correct length of the
+ repository ID. Previously, it wrongly returns the length of the header macro
+ name.
+
// Revision 1.4 1997/05/06 13:54:46 sll
// Public release.
//
***************
*** 45,51 ****
pd_repoid = new char[strlen(_fqname())+strlen(IRREPOID_POSTFIX)+1];
strcpy(pd_repoid,_fqname());
strcat(pd_repoid,IRREPOID_POSTFIX);
! pd_repoidsize = strlen(pd_repoid)+1;
}
void
--- 50,56 ----
pd_repoid = new char[strlen(_fqname())+strlen(IRREPOID_POSTFIX)+1];
strcpy(pd_repoid,_fqname());
strcat(pd_repoid,IRREPOID_POSTFIX);
! pd_repoidsize = strlen(repositoryID())+1;
}
void
--------------------------------- End---------------------
Yvan Peter <Yvan.Peter@cnet.francetelecom.fr> writes:
>
> I am trying to use omniORB's name service from Visibroker 2.5 C++ and
> still have some problems.
>
> I have recompiled omniBroker with #pragma prefix "omg.org" in IDL.
> I used this IDL to generate the stub for Visibroker and I can now
> successfully invoke the name service.
>
> However, I have a problems when an exception is raised by the
> name service. The exception is not recognized by the client.
>
> for example, the following code would run fine the first time
> and return with a SystemException of minor code 0 if I run it
> a second time:
>
> ...
> try {
> testContext = naming->bind_new_context(contextName);
> }
> catch ( CosNaming::NamingContext::AlreadyBound& ex) {
> fprintf(stderr, "user\n");
> }
> catch ( CORBA::SystemException& ex) {
> fprintf(stderr, "system = %d\n", ex.minor());
> }
>
--
E-mail: S.Lo@orl.co.uk | Olivetti & Oracle Research Lab
| 24a Trumpington Street
Tel: +44 223 343000 | Cambridge CB2 1QA
Fax: +44 223 313542 | ENGLAND