Re: Orbacus problem

Darren Middleman <[email protected]> Tue, 5 Apr 2005 14:49:21 -0230
Newsgroups gmane.comp.corba.orbacus
Organization IONA | Making Software Work Together TM
Message-ID <[email protected]>
Hi Kleva

> >>  I have a question abour ORBacus, maybe you can help me?
> >> 
> >>  I've "start from helloclient.cpp", so my code in run function is:
> >> 
> >>  
> >>     CORBA::Object_var obj;
> >> 
> >>     try
> >>     {obj  = orb -> 
> >> 
> >> string_to_object("corbaloc::127.0.0.1:19740/ORB/OA/IDL:SuiteManager:1.0");}
> >>     catch(const CORBA::BAD_PARAM&)  {}
> >> 
> >>     if(CORBA::is_nil(obj))
> >>     { cerr << argv[0] << ": cannot read IOR from Hello.ref" << endl;
> >>  return EXIT_FAILURE; }
> >>     
> >>     SuiteManager_ptr sm = SuiteManager::_narrow(obj);
> >>     assert(!CORBA::is_nil(sm));
> >> 
> >>     int fm = sm->getFreeMemory();
> >>     cout << "freemem:" << fm << "\n";
> >> 
> >>     return EXIT_SUCCESS;
> >>  
> >> The error occures in line sm->getFreeMemory();
> >> I run my program with TCP sniffer and first GIOP request
> >> succeds(SuiteManager_ptr sm = SuiteManager::_narrow(obj);)
> >> 
> >> But second even not sending via TCP. It meant, tha error occures
> >> before it should be send.
> >> 
> >> Firs rune-time error occures in malloc.c:
> >> on line: return HeapAlloc(_crtheap, 0, size);
> >> Unhandled exception at 0x793aa4e1 in NokiaHello.exe: Microsoft
> >> C++ exception: __non_rtti_object @ 0x0012fb64.
> >> 
> >> 
> >> then if I choose continue the error occures in client.c:
> >> on line: OBStubImpl_imletmanager::SuiteManager_ptr _ob_stubImpl
> >> = dynamic_cast<
> >> OBStubImpl_imletmanager::SuiteManager_ptr>(_ob_stubImplBase.in());
> >> Unhandled exception at 0x7c35a371 (msvcr71.dll) in
> >> NokiaHello.exe: 0xC0000005: Access violation reading location
> >> 0x00000004.
> >> 
> >> What you suggest me to do?
> >> Should I send complete myidl.idl, myidl.cpp and myidl.h?
> >>     
> >> Best regards,
> >>  kleva                            mailto:[email protected]
>
> [...]
> 
> code that gets executed in this call:
> //
> // IDL:imletmanager/SuiteManager/getFreeMemory:1.0
> //
> ::CORBA::Long
> OBProxy_imletmanager::SuiteManager::getFreeMemory()
> {
>     ::CORBA::ULong _ob_retry = 0, _ob_hop = 0;
>     while(true)
>     {
>         try
>         {
>             OB::StubImplBase_var _ob_stubImplBase = _OB_getStubImpl();
>             
>                         OBStubImpl_imletmanager::SuiteManager_ptr _ob_stubImpl = 
>                                  dynamic_cast< OBStubImpl_imletmanager::SuiteManager_ptr>(_ob_stubImplBase.in());
>             
>                         return _ob_stubImpl -> getFreeMemory();
>         }
>         catch(const OB::ExceptionBase& _ob_ex)
>         {
>             _OB_handleException(_ob_ex, _ob_retry, _ob_hop);
>         }
>     }
> }
> 

Can you also send me your implementation code that defines the actual code
for your functions defined in IDL?  The code you have given me above is
only from the generated file.  The source of the problem most likely
resides in the implementation file you should have written which performs
the actual 'getFreeMemory()' call.

Regards,
Darren

-- 
Darren Middleman, Software Engineer
Team Orbacus - Your CORBA Source
Email: mailto:[email protected]
WWW: http://www.orbacus.com/
_______________________________________________
OB-Users Mailing List - [email protected]
http://mail.ooc.nf.ca/mailman/listinfo/ob-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html