f



[tao-users] Use of TAO_OutputCDR and ACE_Message_Block in CORBA::Any from TAO 1.4.1|ACE 5.4.1 to TAO2.2.0|ACE 6.2.0

This is a multipart message in MIME format.

------=_NextPart_000_00BF_01CEA8D4.9E005C80
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

    TAO VERSION: 2.2.0

    ACE VERSION: 6.2.0

=20

    HOST MACHINE and OPERATING SYSTEM:

    x86_64 and  Red Hat  - Linux 2.6.18-194.26.1.el5

=20

    TARGET MACHINE and OPERATING SYSTEM, if different from HOST:

=20

    COMPILER NAME AND VERSION (AND PATCHLEVEL):

    gcc (GCC) 4.8.1

=20

    THE $ACE_ROOT/ace/config.h FILE:

    config-linux.h

=20

    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:

    platform_linux.GNU

=20

    CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features

    (used by MPC when you generate your own makefiles):

=20

    AREA/CLASS/EXAMPLE AFFECTED:

    TAO_OutputCDR and ACE_Message_Block.

=20

    DOES THE PROBLEM AFFECT:

    EXECUTION.

    My application is affected.

=20

    SYNOPSIS:

    The code that extract data from CORBA::Any using TAO_OutputCDR and

     ACE_Message_Block for user defined types works properly in the old
platform

     (TAO 1.4.1|ACE 5.4.1), but not in the new one(ACE 6.2.0).

=20

    DESCRIPTION:

    The code in the =93REPEAT BY=94 section works fine in the old platform =
for
user

    defined types, that is, the TAO_OutputCDR and ACE_Message_Block objects

    have the same length, but in the new platform the lengths are different=
..

=20

    Any idea on how to solve the problem?

=20

   Old platform:

    TAO VERSION: 1.4.1

    ACE VERSION: 5.4.1

    HOST MACHINE and OPERATING SYSTEM:

    sun4v sparc SUNW,Sun-Fire-T200 Solaris  and SunOS 5.10 Generic_142900-0=
3

    COMPILER NAME AND VERSION (AND PATCHLEVEL):

    gcc (GCC) 2.95.2

    THE $ACE_ROOT/ace/config.h FILE:

    config-linux.h

    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:

    platform_sunos5_g++.GNU

=20

    REPEAT BY:

Void fromAny ( const CORBA::Any& a, OctetArray1D& b)

{

  try

  {   =20

    unsigned max_size =3D 1048576;  // 1Mb

    TAO_OutputCDR cdr(max_size);

=20

    if ( ! (cdr << a) )

    {

      CannotProceed ex("::fromAny(CORBA::Any&,OctetArray1D&)", "");

      ex.addText("Error extracting TAO_OutputCDR from CORBA::Any");

      throw ex;

    }

   =20

    ACE_Message_Block* mb =3D (ACE_Message_Block*)cdr.begin();

   =20

    if ( cdr.total_length() !=3D mb->length() )

    {

        CannotProceed ex("::fromAny(CORBA::Any&,OctetArray1D&)", "");

        ex.addText("max. size=3D%d exceeded", max_size );

        ex.addText("cdr.total_length()=3D%d", cdr.total_length() );

        ex.addText("mb->length()=3D%d", mb->length() );

        throw ex;

    }

=20

    b.set(mb->length(), (unsigned char*)mb->rd_ptr());

  }

  catch ( CORBA::Exception& ex)

  {

    throw ex;

  }

}

=20

=20

    SAMPLE FIX/WORKAROUND:

=20

=20

Jose Antonio Rodriguez Losada

Sofware Engineer

Grantecan,SA

+34922315031



----------
ADVERTENCIA: Sobre la privacidad y cumplimiento de la Ley de Protecci=F3n d=
e Datos, acceda a http://www.gtc.iac.es/gtc/legal_es.php
WARNING: For more information on privacy and fulfilment of the Law concerni=
ng the Protection of Data, consult http://www.gtc.iac.es/gtc/legal_es.php
------=_NextPart_000_00BF_01CEA8D4.9E005C80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40"><head><meta http-equiv=3DContent-Type content=
=3D"text/html; charset=3Diso-8859-1"><meta name=3DGenerator content=3D"Micr=
osoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EstiloCorreo17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
..MsoChpDefault
	{mso-style-type:export-only;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DES link=3Dblue vlink=
=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span lang=3DEN-US=
>=A0=A0=A0 TAO VERSION: 2.2.0<o:p></o:p></span></p><p class=3DMsoNormal><sp=
an lang=3DEN-US>=A0=A0=A0 ACE VERSION: 6.2.0<o:p></o:p></span></p><p class=
=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoN=
ormal><span lang=3DEN-US>=A0=A0=A0 HOST MACHINE and OPERATING SYSTEM:<o:p><=
/o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 x86_64 an=
d=A0 Red Hat=A0 - Linux 2.6.18-194.26.1.el5<o:p></o:p></span></p><p class=
=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoN=
ormal><span lang=3DEN-US>=A0=A0=A0 TARGET MACHINE and OPERATING SYSTEM, if =
different from HOST:<o:p></o:p></span></p><p class=3DMsoNormal><span lang=
=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span lang=3DEN-U=
S>=A0=A0=A0 COMPILER NAME AND VERSION (AND PATCHLEVEL):<o:p></o:p></span></=
p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 gcc (GCC) 4.8.1<o:p></o=
:p></span></p><p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></sp=
an></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 THE $ACE_ROOT/ace/=
config.h FILE:<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US=
>=A0=A0=A0 config-linux.h<o:p></o:p></span></p><p class=3DMsoNormal><span l=
ang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span lang=3DE=
N-US>=A0=A0=A0 THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:<=
o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 plat=
form_linux.GNU<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US=
><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=
=A0 CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features<o:=
p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 (used =
by MPC when you generate your own makefiles):<o:p></o:p></span></p><p class=
=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoN=
ormal><span lang=3DEN-US>=A0=A0=A0 AREA/CLASS/EXAMPLE AFFECTED:<o:p></o:p><=
/span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 TAO_OutputCDR a=
nd ACE_Message_Block.<o:p></o:p></span></p><p class=3DMsoNormal><span lang=
=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span lang=3DEN-U=
S>=A0=A0=A0 DOES THE PROBLEM AFFECT:<o:p></o:p></span></p><p class=3DMsoNor=
mal><span lang=3DEN-US>=A0=A0=A0 EXECUTION.<o:p></o:p></span></p><p class=
=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 My application is affected.<o:p><=
/o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></=
span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 SYNOPSIS:<o:p></=
o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 The code t=
hat extract data from CORBA::Any using TAO_OutputCDR and<o:p></o:p></span><=
/p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0=A0 ACE_Message_Block f=
or user defined types works properly in the old platform<o:p></o:p></span><=
/p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 =A0(TAO 1.4.1|ACE 5.4.=
1), but not in the new one(ACE 6.2.0).<o:p></o:p></span></p><p class=3DMsoN=
ormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><=
span lang=3DEN-US>=A0=A0=A0 DESCRIPTION:<o:p></o:p></span></p><p class=3DMs=
oNormal><span lang=3DEN-US>=A0=A0=A0 The code in the &#8220;REPEAT BY&#8221=
; section works fine in the old platform for user<o:p></o:p></span></p><p c=
lass=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 defined types, that is, the T=
AO_OutputCDR and ACE_Message_Block objects<o:p></o:p></span></p><p class=3D=
MsoNormal><span lang=3DEN-US>=A0=A0=A0 have the same length, but in the new=
 platform the lengths are different.<o:p></o:p></span></p><p class=3DMsoNor=
mal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><sp=
an lang=3DEN-US>=A0=A0=A0 Any idea on how to solve the problem?<o:p></o:p><=
/span></p><p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span><=
/p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0 Old platform:<o:p></o:p><=
/span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0 =A0TAO VERSION: 1.=
4.1<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 =
ACE VERSION: 5.4.1<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DE=
N-US>=A0=A0=A0 HOST MACHINE and OPERATING SYSTEM:<o:p></o:p></span></p><p c=
lass=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 sun4v sparc SUNW,Sun-Fire-T20=
0 Solaris=A0 and SunOS 5.10 Generic_142900-03<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 COMPILER NAME AND=
 VERSION (AND PATCHLEVEL):<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US>=A0=A0=A0 gcc (GCC) <span style=3D'color:black'>2.95.2</span><=
o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 THE =
$ACE_ROOT/ace/config.h FILE:<o:p></o:p></span></p><p class=3DMsoNormal><spa=
n lang=3DEN-US>=A0=A0=A0 config-linux.h<o:p></o:p></span></p><p class=3DMso=
Normal><span lang=3DEN-US>=A0=A0=A0 THE $ACE_ROOT/include/makeinclude/platf=
orm_macros.GNU FILE:<o:p></o:p></span></p><p class=3DMsoNormal><span lang=
=3DEN-US>=A0=A0=A0 platform_sunos5_g++.GNU<o:p></o:p></span></p><p class=3D=
MsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNorm=
al><span lang=3DEN-US>=A0=A0=A0 REPEAT BY:<o:p></o:p></span></p><p class=3D=
MsoNormal><span lang=3DEN-US>Void fromAny ( const CORBA::Any&amp; a, OctetA=
rray1D&amp; b)<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US=
>{<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0 try<o:p=
></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0 {=A0=A0=A0 <o=
:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0=A0uns=
igned max_size =3D 1048576;=A0 // 1Mb<o:p></o:p></span></p><p class=3DMsoNo=
rmal><span lang=3DEN-US>=A0=A0=A0 TAO_OutputCDR cdr(max_size);<o:p></o:p></=
span></p><p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></=
p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 if ( ! (cdr &lt;&lt; a)=
 )<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 {=
<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0=A0=
=A0 CannotProceed ex(&quot;::fromAny(CORBA::Any&amp;,OctetArray1D&amp;)&quo=
t;, &quot;&quot;);<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DE=
N-US>=A0=A0=A0=A0=A0 ex.addText(&quot;Error extracting TAO_OutputCDR from C=
ORBA::Any&quot;);<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN=
-US>=A0=A0=A0=A0=A0 throw ex;<o:p></o:p></span></p><p class=3DMsoNormal><sp=
an lang=3DEN-US>=A0=A0=A0 }<o:p></o:p></span></p><p class=3DMsoNormal><span=
 lang=3DEN-US>=A0=A0=A0 <o:p></o:p></span></p><p class=3DMsoNormal><span la=
ng=3DEN-US>=A0=A0=A0=A0ACE_Message_Block* mb =3D (ACE_Message_Block*)cdr.be=
gin();<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=
=A0 <o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0=
=A0if ( cdr.total_length() !=3D mb-&gt;length() )<o:p></o:p></span></p><p c=
lass=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 {<o:p></o:p></span></p><p cla=
ss=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0=A0=A0=A0=A0 CannotProceed ex(&q=
uot;::fromAny(CORBA::Any&amp;,OctetArray1D&amp;)&quot;, &quot;&quot;);<o:p>=
</o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0=A0=A0=A0=
=A0 ex.addText(&quot;max. size=3D%d exceeded&quot;, max_size );<o:p></o:p><=
/span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0=A0=A0=A0=A0 ex.=
addText(&quot;cdr.total_length()=3D%d&quot;, cdr.total_length() );<o:p></o:=
p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0=A0=A0=A0=A0 =
ex.addText(&quot;mb-&gt;length()=3D%d&quot;, mb-&gt;length() );<o:p></o:p><=
/span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0=A0=A0=A0=A0 thr=
ow ex;<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=
=A0 }<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US><o:p>&nb=
sp;</o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 b.set=
(mb-&gt;length(), (unsigned char*)mb-&gt;rd_ptr());<o:p></o:p></span></p><p=
 class=3DMsoNormal><span lang=3DEN-US>=A0 }<o:p></o:p></span></p><p class=
=3DMsoNormal><span lang=3DEN-US>=A0 catch ( CORBA::Exception&amp; ex)<o:p><=
/o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0 {<o:p></o:p></s=
pan></p><p class=3DMsoNormal><span lang=3DEN-US>=A0=A0=A0 throw ex;<o:p></o=
:p></span></p><p class=3DMsoNormal><span lang=3DEN-US>=A0 }<o:p></o:p></spa=
n></p><p class=3DMsoNormal><span lang=3DEN-US>}<o:p></o:p></span></p><p cla=
ss=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMs=
oNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal=
><span lang=3DEN-US>=A0=A0=A0 SAMPLE FIX/WORKAROUND:<o:p></o:p></span></p><=
p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=
=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><p class=3DMsoN=
ormal>Jose Antonio Rodriguez Losada<o:p></o:p></p><p class=3DMsoNormal>Sofw=
are Engineer<o:p></o:p></p><p class=3DMsoNormal>Grantecan,SA<o:p></o:p></p>=
<p class=3DMsoNormal>+34922315031<o:p></o:p></p></div><br>----------<br>
ADVERTENCIA: Sobre la privacidad y cumplimiento de la Ley de Protecci=F3n d=
e Datos, acceda a http://www.gtc.iac.es/gtc/legal_es.php<br>
WARNING: For more information on privacy and fulfilment of the Law concerni=
ng the Protection of Data, consult http://www.gtc.iac.es/gtc/legal_es.php</=
body></html>
------=_NextPart_000_00BF_01CEA8D4.9E005C80--

0
iso
9/3/2013 5:37:17 PM
comp.soft-sys.ace 20326 articles. 1 followers. marlow.andrew (167) is leader. Post Follow

0 Replies
1521 Views

Similar Articles

[PageSpeed] 20

Reply: