You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Juergen Weber <we...@gmail.com> on 2008/06/05 20:40:41 UTC

Corba - harmless IDL generates NPE

Hi,

the IDL below (which compiles fine with JacORB IDL) throws an
exception when deployed in Axis2.

Is there a fix or work-around for this bug? Which IDL element causes
the problem?

Thanks,
Juergen

-----------

java.lang.NullPointerException
        at org.apache.axis2.corba.deployer.SchemaGenerator.generateSchema(SchemaGenerator.java:170)
        at org.apache.axis2.corba.deployer.CorbaDeployer.processOperations(CorbaDeployer.java:462)
        at org.apache.axis2.corba.deployer.CorbaDeployer.populateService(CorbaDeployer.java:298)
        at org.apache.axis2.corba.deployer.CorbaDeployer.processService(CorbaDeployer.java:126)
        at org.apache.axis2.corba.deployer.CorbaDeployer.deploy(CorbaDeployer.java:96)
        at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.
java:136)
        at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
        at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
        at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
        at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)

        at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
        at org.apache.axis2.deployment.FileSystemConfigurator.loadServices(FileSystemConfigurator.ja
va:147)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(Configura
tionContextFactory.java:82)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSy
stem(ConfigurationContextFactory.java:184)
        at org.apache.axis2.transport.SimpleAxis2Server.<init>(SimpleAxis2Server.java:48)
        at org.apache.axis2.transport.SimpleAxis2Server.main(SimpleAxis2Server.java:99)

-------


module functiontest
{
 exception FunctionTestException
 {
  string<120> text;
 };

 typedef string<2> magict;
 struct BasicTypesS
 {
  char achar;
  short ashort;
  magict m1;
  long along;
  magict m2;
  boolean abooleanTrue;
  boolean abooleanFalse;
  string<3> astring;
 };
        interface FunctionTestService
        {
 BasicTypesS testBasicTypes(in magict ms,
   in BasicTypesS b,
   in char achar, in short ashort, in long along,
   in boolean abooleanTrue,
   in boolean abooleanFalse,
   in magict me)
 raises (FunctionTestException);
 };
};

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: Corba - harmless IDL generates NPE

Posted by Juergen Weber <we...@gmail.com>.
Hi Eranga,

no, bounded strings are not the problem, I hacked a

public String getTypeName(AST node) {
        String typeName = node.getText();
        if ("string".equals(typeName)) return typeName; // **** my change

this supports bounded strings, but does not help with all issues.

BTW, your code using antlr and ASTs is really elegant.

Thanks,
Juergen



On Fri, Jun 6, 2008 at 2:19 AM, Eranga Jayasundera (එරංග)
<er...@gmail.com> wrote:
> Hi Juergen,
>
> It seems to be a bug.
> As a workaround, convert all string<NN> to string .
>
> Regards,
> Eranga
>
> On Fri, Jun 6, 2008 at 12:10 AM, Juergen Weber <we...@gmail.com> wrote:
>> Hi,
>>
>> the IDL below (which compiles fine with JacORB IDL) throws an
>> exception when deployed in Axis2.
>>
>> Is there a fix or work-around for this bug? Which IDL element causes
>> the problem?
>>
>> Thanks,
>> Juergen
>>
>> -----------
>>
>> java.lang.NullPointerException
>>        at org.apache.axis2.corba.deployer.SchemaGenerator.generateSchema(SchemaGenerator.java:170)
>>        at org.apache.axis2.corba.deployer.CorbaDeployer.processOperations(CorbaDeployer.java:462)
>>        at org.apache.axis2.corba.deployer.CorbaDeployer.populateService(CorbaDeployer.java:298)
>>        at org.apache.axis2.corba.deployer.CorbaDeployer.processService(CorbaDeployer.java:126)
>>        at org.apache.axis2.corba.deployer.CorbaDeployer.deploy(CorbaDeployer.java:96)
>>        at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.
>> java:136)
>>        at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
>>        at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
>>        at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
>>        at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)
>>
>>        at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
>>        at org.apache.axis2.deployment.FileSystemConfigurator.loadServices(FileSystemConfigurator.ja
>> va:147)
>>        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(Configura
>> tionContextFactory.java:82)
>>        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSy
>> stem(ConfigurationContextFactory.java:184)
>>        at org.apache.axis2.transport.SimpleAxis2Server.<init>(SimpleAxis2Server.java:48)
>>        at org.apache.axis2.transport.SimpleAxis2Server.main(SimpleAxis2Server.java:99)
>>
>> -------
>>
>>
>> module functiontest
>> {
>>  exception FunctionTestException
>>  {
>>  string<120> text;
>>  };
>>
>>  typedef string<2> magict;
>>  struct BasicTypesS
>>  {
>>  char achar;
>>  short ashort;
>>  magict m1;
>>  long along;
>>  magict m2;
>>  boolean abooleanTrue;
>>  boolean abooleanFalse;
>>  string<3> astring;
>>  };
>>        interface FunctionTestService
>>        {
>>  BasicTypesS testBasicTypes(in magict ms,
>>   in BasicTypesS b,
>>   in char achar, in short ashort, in long along,
>>   in boolean abooleanTrue,
>>   in boolean abooleanFalse,
>>   in magict me)
>>  raises (FunctionTestException);
>>  };
>> };
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-dev-help@ws.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>

Re: Corba - harmless IDL generates NPE

Posted by "Eranga Jayasundera (එරංග)" <er...@gmail.com>.
The issues in string<N> idl construct is now fixed.

Regards,
Eranga

On Fri, Jun 6, 2008 at 5:49 AM, Eranga Jayasundera (එරංග)
<er...@gmail.com> wrote:
> Hi Juergen,
>
> It seems to be a bug.
> As a workaround, convert all string<NN> to string .
>
> Regards,
> Eranga
>
> On Fri, Jun 6, 2008 at 12:10 AM, Juergen Weber <we...@gmail.com> wrote:
>> Hi,
>>
>> the IDL below (which compiles fine with JacORB IDL) throws an
>> exception when deployed in Axis2.
>>
>> Is there a fix or work-around for this bug? Which IDL element causes
>> the problem?
>>
>> Thanks,
>> Juergen
>>
>> -----------
>>
>> java.lang.NullPointerException
>>        at org.apache.axis2.corba.deployer.SchemaGenerator.generateSchema(SchemaGenerator.java:170)
>>        at org.apache.axis2.corba.deployer.CorbaDeployer.processOperations(CorbaDeployer.java:462)
>>        at org.apache.axis2.corba.deployer.CorbaDeployer.populateService(CorbaDeployer.java:298)
>>        at org.apache.axis2.corba.deployer.CorbaDeployer.processService(CorbaDeployer.java:126)
>>        at org.apache.axis2.corba.deployer.CorbaDeployer.deploy(CorbaDeployer.java:96)
>>        at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.
>> java:136)
>>        at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
>>        at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
>>        at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
>>        at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)
>>
>>        at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
>>        at org.apache.axis2.deployment.FileSystemConfigurator.loadServices(FileSystemConfigurator.ja
>> va:147)
>>        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(Configura
>> tionContextFactory.java:82)
>>        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSy
>> stem(ConfigurationContextFactory.java:184)
>>        at org.apache.axis2.transport.SimpleAxis2Server.<init>(SimpleAxis2Server.java:48)
>>        at org.apache.axis2.transport.SimpleAxis2Server.main(SimpleAxis2Server.java:99)
>>
>> -------
>>
>>
>> module functiontest
>> {
>>  exception FunctionTestException
>>  {
>>  string<120> text;
>>  };
>>
>>  typedef string<2> magict;
>>  struct BasicTypesS
>>  {
>>  char achar;
>>  short ashort;
>>  magict m1;
>>  long along;
>>  magict m2;
>>  boolean abooleanTrue;
>>  boolean abooleanFalse;
>>  string<3> astring;
>>  };
>>        interface FunctionTestService
>>        {
>>  BasicTypesS testBasicTypes(in magict ms,
>>   in BasicTypesS b,
>>   in char achar, in short ashort, in long along,
>>   in boolean abooleanTrue,
>>   in boolean abooleanFalse,
>>   in magict me)
>>  raises (FunctionTestException);
>>  };
>> };
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-dev-help@ws.apache.org
>>
>>
>

Re: Corba - harmless IDL generates NPE

Posted by "Eranga Jayasundera (එරංග)" <er...@gmail.com>.
Hi Juergen,

It seems to be a bug.
As a workaround, convert all string<NN> to string .

Regards,
Eranga

On Fri, Jun 6, 2008 at 12:10 AM, Juergen Weber <we...@gmail.com> wrote:
> Hi,
>
> the IDL below (which compiles fine with JacORB IDL) throws an
> exception when deployed in Axis2.
>
> Is there a fix or work-around for this bug? Which IDL element causes
> the problem?
>
> Thanks,
> Juergen
>
> -----------
>
> java.lang.NullPointerException
>        at org.apache.axis2.corba.deployer.SchemaGenerator.generateSchema(SchemaGenerator.java:170)
>        at org.apache.axis2.corba.deployer.CorbaDeployer.processOperations(CorbaDeployer.java:462)
>        at org.apache.axis2.corba.deployer.CorbaDeployer.populateService(CorbaDeployer.java:298)
>        at org.apache.axis2.corba.deployer.CorbaDeployer.processService(CorbaDeployer.java:126)
>        at org.apache.axis2.corba.deployer.CorbaDeployer.deploy(CorbaDeployer.java:96)
>        at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.
> java:136)
>        at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
>        at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
>        at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
>        at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)
>
>        at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
>        at org.apache.axis2.deployment.FileSystemConfigurator.loadServices(FileSystemConfigurator.ja
> va:147)
>        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(Configura
> tionContextFactory.java:82)
>        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSy
> stem(ConfigurationContextFactory.java:184)
>        at org.apache.axis2.transport.SimpleAxis2Server.<init>(SimpleAxis2Server.java:48)
>        at org.apache.axis2.transport.SimpleAxis2Server.main(SimpleAxis2Server.java:99)
>
> -------
>
>
> module functiontest
> {
>  exception FunctionTestException
>  {
>  string<120> text;
>  };
>
>  typedef string<2> magict;
>  struct BasicTypesS
>  {
>  char achar;
>  short ashort;
>  magict m1;
>  long along;
>  magict m2;
>  boolean abooleanTrue;
>  boolean abooleanFalse;
>  string<3> astring;
>  };
>        interface FunctionTestService
>        {
>  BasicTypesS testBasicTypes(in magict ms,
>   in BasicTypesS b,
>   in char achar, in short ashort, in long along,
>   in boolean abooleanTrue,
>   in boolean abooleanFalse,
>   in magict me)
>  raises (FunctionTestException);
>  };
> };
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: Corba - harmless IDL generates NPE

Posted by Juergen Weber <we...@gmail.com>.
Hi,

my fault. I had a typo in <parameter name="interfaceName">
so
        Interface intf = (Interface) interfaces.get(interfaceName);
would not get the Interface and result in a NPE in
intf.getOperations();

What about a friendly
if (intf==0) throw new SchemaGeneratorException("Interface name not
found in IDL");
?

Thanks,
Juergen

<parameter name="interfaceName">corba2ws::MyCorbaService</parameter>

On Thu, Jun 5, 2008 at 8:40 PM, Juergen Weber <we...@gmail.com> wrote:
> Hi,
>
> the IDL below (which compiles fine with JacORB IDL) throws an
> exception when deployed in Axis2.
>
> Is there a fix or work-around for this bug? Which IDL element causes
> the problem?
>
> Thanks,
> Juergen
>
> -----------
>
> java.lang.NullPointerException
>        at org.apache.axis2.corba.deployer.SchemaGenerator.generateSchema(SchemaGenerator.java:170)
>        at org.apache.axis2.corba.deployer.CorbaDeployer.processOperations(CorbaDeployer.java:462)
>        at org.apache.axis2.corba.deployer.CorbaDeployer.populateService(CorbaDeployer.java:298)
>        at org.apache.axis2.corba.deployer.CorbaDeployer.processService(CorbaDeployer.java:126)
>        at org.apache.axis2.corba.deployer.CorbaDeployer.deploy(CorbaDeployer.java:96)
>        at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.
> java:136)
>        at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
>        at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
>        at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
>        at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)
>
>        at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
>        at org.apache.axis2.deployment.FileSystemConfigurator.loadServices(FileSystemConfigurator.ja
> va:147)
>        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(Configura
> tionContextFactory.java:82)
>        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSy
> stem(ConfigurationContextFactory.java:184)
>        at org.apache.axis2.transport.SimpleAxis2Server.<init>(SimpleAxis2Server.java:48)
>        at org.apache.axis2.transport.SimpleAxis2Server.main(SimpleAxis2Server.java:99)
>
> -------
>
>
> module functiontest
> {
>  exception FunctionTestException
>  {
>  string<120> text;
>  };
>
>  typedef string<2> magict;
>  struct BasicTypesS
>  {
>  char achar;
>  short ashort;
>  magict m1;
>  long along;
>  magict m2;
>  boolean abooleanTrue;
>  boolean abooleanFalse;
>  string<3> astring;
>  };
>        interface FunctionTestService
>        {
>  BasicTypesS testBasicTypes(in magict ms,
>   in BasicTypesS b,
>   in char achar, in short ashort, in long along,
>   in boolean abooleanTrue,
>   in boolean abooleanFalse,
>   in magict me)
>  raises (FunctionTestException);
>  };
> };
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org