Problem:

Product Name: VisiBroker for Java
Product Version:  7.0/8.0/8.5
Platform/OS Version: All supported platforms

Consider the following IDL which has an operation name similar to the module name, in this case the "test" identifier.

#ifndef test_idl
#define test_idl
module test
{
   struct param
   {
     string input;
   };

   interface dummy
   {
       void foo(
           in param test
        );
   };
};
#endif // test_idl

If we save this IDL to test.idl file and follow the follow steps, a compilation error occurs.
(1) idl2java -root_dir idl_src test.idl
(2) find idl_src -name "*.java" > java_source_files_test
(3) javac -classpath ${VBROKERDIR}/lib/vbjorb.jar -sourcepath idl_src @java_source_files_test


After step #3, the following error is generated:

idl_src/test/dummyPOA.java:65: cannot find symbol
symbol  : variable paramHelper
location: class test.param
      test = test.paramHelper.read(_input);
                 ^
idl_src/test/_dummyStub.java:43: cannot find symbol
symbol  : variable paramHelper
location: class test.param
          test.paramHelper.write(_output, test);
              ^
idl_src/test/_dummyStub.java:82: cannot find symbol
symbol  : variable paramHelper
location: class test.param
            test.paramHelper.write(_output, test);

Resolution:

In VisiBroker's idl2cpp, this type of IDL declaration is allowed as in compliance to OMG CORBA specifications.

However, this is a known limitation of VisiBroker's idl2java. The issue has been raised to the VisiBroker Development group through RPI#1074945.

As a workaround, we suggest to change the parameter name to something different from the module name. This is safe since GIOP marshalling/unmarshalling operations do not include the parameter name.