[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openorb-devel
Subject:    Re: [openorb-devel] marshalling of empty arrays in a valuetype
From:       Michael Rumpf <michael () rumpfonline ! de>
Date:       2004-01-20 20:51:13
Message-ID: 1074631873.2095.16.camel () michael ! home ! net
[Download RAW message or body]

On Tue, 2004-01-20 at 21:18, Lars Kühne wrote:
> Hi all,
> 
> a colleague of mine has found a problem in valuetype marshalling.
> 
> We have an operation that returns an array of some valuetype. The 
> valuetype itself includes an array of longs. If each of those arrays of 
> longs is non-empty, everything works fine. But if one array of longs has 
> length 0 then the next entry in the valuetype array does not arrive at 
> the client side - it's null instead of the correct value.
> 
> I created a unit test that demonstrates the problem, see attached files. 
> Could one of the the marshalling gurus please look into this?

The main task I'm currently working on is porting OpenORB to IBM JDK
1.4.1 (part of our AppServer's port to IBM AIX 5.2).
We recently tried to get rid of our internal CVS OpenORB version, based
on OpenORB 1.2.1, and switch to 1.4.0 BETA1. During some basic tests
(startup of the SPECjAppServer benchmark) we faced also a marshaling
problem. The guy reporting it said that it has something to do with a
zero length collection or vector (?). We haven't been able to isolate
the problem, so your test case might be what we've been looking for.
Unfortunately the move to OpenORB 1.4.0BETA1 has been on hold in order
to get the AIX 5.2 port finished. I will get back to the marshaling
problem as soon as possible and have a look at your stuff then...

Cheers,
   Michael

> Thanks,
> Lars
> 
> 
> ______________________________________________________________________
> ? .classpath
> ? .project
> ? classcast.txt
> ? longseqInVtTest.diff
> ? openorb.ipr
> ? openorb.iws
> ? src/main/log20030931.txt
> ? src/test/org/openorb/orb/test/iiop/value/ValueHDefaultFactory.java
> ? src/test/org/openorb/orb/test/iiop/value/ValueHImpl.java
> Index: src/idl/test/value.idl
> ===================================================================
> RCS file: /cvsroot/openorb/OpenORB/src/idl/test/value.idl,v
> retrieving revision 1.7
> diff -u -r1.7 value.idl
> --- src/idl/test/value.idl	21 Apr 2003 20:42:31 -0000	1.7
> +++ src/idl/test/value.idl	20 Jan 2004 19:37:27 -0000
> @@ -23,6 +23,8 @@
>  
>                  valuetype LongSeqBox sequence<long>;
>  
> +                typedef sequence<long long> LongLongSeq;
> +
>                  valuetype ValueA
>                  {
>                      public string str;
> @@ -81,6 +83,14 @@
>                      public ValueG parent;
>                  };
>  
> +                valuetype ValueH
> +                {
> +                    private LongLongSeq ids;
> +                    LongLongSeq getIds();
> +                };
> +
> +                typedef sequence<ValueH> ValueHSeq;
> +
>                  abstract interface AbstractA
>                  {
>                      void print();
> @@ -136,6 +146,8 @@
>                      CORBA::AbstractBase get_abstract( in long type );
>  
>                      AbstractA get_abstract_a( in long type );
> +
> +                    ValueHSeq get_multiple_valueh( in long length );
>                  };
>  
>                  abstract valuetype Node {};
> Index: src/test/org/openorb/orb/test/iiop/value/ValuetypeTest.java
> ===================================================================
> RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/value/ValuetypeTest.java,v
> retrieving revision 1.6
> diff -u -r1.6 ValuetypeTest.java
> --- src/test/org/openorb/orb/test/iiop/value/ValuetypeTest.java	11 Nov 2003 14:38:17 -0000	1.6
> +++ src/test/org/openorb/orb/test/iiop/value/ValuetypeTest.java	20 Jan 2004 19:37:30 -0000
> @@ -248,6 +248,19 @@
>                      val == val.left.parent && val == val.right.parent );
>      }
>  
> +    public void testMarshalValueTypeWithArray()
> +    {
> +        ValueH[] values = m_cltRef.get_multiple_valueh(10);
> +
> +        assertEquals("Expected 10 values", 10, values.length);
> +        for ( int i = 0; i < values.length; i++ ) {
> +            ValueH value = values[i];
> +            assertNotNull("array entry " + i + " is null", value);
> +            final long[] ids = value.getIds();
> +            assertEquals(0, ids.length);
> +        }
> +    }
> +
>      /**
>       * Test abstract valuetypes.
>       */
> @@ -471,6 +484,15 @@
>                  return null;
>              }
>          }
> +
> +        public ValueH[] get_multiple_valueh( int length )
> +        {
> +            ValueH[] retVal = new ValueH[length];
> +            for ( int i = 0; i < retVal.length; i++ ) {
> +                retVal[i] = new ValueHImpl();
> +            }
> +            return retVal;
> +        }
>      }
>  
>      /**

["signature.asc" (application/pgp-signature)]
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
openorb-devel mailing list
openorb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openorb-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic