pass a Payload to Java Object Gateway

Hello, my name is Maria.
I’m new using Mediator.
I have a problem.
I would like to pass a payload to a java method. My method receive a byte. but when I call to these method in the log file I have the next exception.
////////
ERROR[slf5s.PRIORITY] xbd[slf5s.CATEGORY] - SagSequencer - SEQUENCER ERROR: sequence “file:/C:/Documents and Settings/Administrador/Mis documentos/borrar/PruExtension2.xml”, line 7, : com.softwareag.xbridge.exceptions.XException: ObjectGatewayImpl.modify: (java.lang.NullPointerException)[slf5s.MESSAGE]
com.softwareag.xbridge.exceptions.XException: ObjectGatewayImpl.modify: (java.lang.NullPointerException)
at com.softwareag.xbridge.objectgateway.ObjectGatewayImpl.modify(DashOB6501:204)
at com.softwareag.xbridge.infrastructure.y.modify(DashOB6501:56)
at com.softwareag.xbridge.sequencer.KeywordSTEP.execute(DashOB6501:151)
at com.softwareag.xbridge.sequencer.SequencerImpl.execute(DashOB6501:607)
at com.softwareag.xbridge.sequencer.SequencerImpl.dispatch(DashOB6501:303)
at com.softwareag.xbridge.infrastructure.ac.perform(DashOB6501:252)
at com.softwareag.xbridge.util.WorkerThread.run(DashOB6501:450)
/////////
Please, somebody can help me?.

Thank you.

Hi Maria,

If you post your sequence we could tell you for certain what the problem might be. The most common explaination for the error you are getting is that you have not created the byte array before calling your method.
To pass a payload to your method you need to have another Java Object Gateway call before your class call where you select message as the xbd.object.function and getContent as the xbd.object.action. The value of the property xbd.object.content is then the name of the newly created ByteArray which you can then use as an input to your method.

Regards, :wink:

- Matthew G.

Hello.
Thank you for your help.
This is my secuence.

////////////
<?xml version="1.0" encoding="UTF-8"?>








////////////
I don’t know what I am doing worng.
Thank you.
Maria

Hi Maria,

The overall sequence looks like it should run ok. The only problem I see is that you set the payload equal to the property softwareag.extension.param1 but you give the property softwareag.extension.param to the method as an input parameter.

Regards, :slight_smile:

- Matthew G.

Thank you very much for your help. Now its ok.

Maria