Author |
Message
|
arvind kris |
Posted: Thu Oct 25, 2007 4:50 pm Post subject: java compute node setting local environment |
|
|
Newbie
Joined: 25 Oct 2007 Posts: 4
|
I am having issues setting queuename in the local environment.
I am using a java compute node and xpath.
can some one post a sample working code |
|
Back to top |
|
 |
Vitor |
Posted: Thu Oct 25, 2007 10:46 pm Post subject: Re: java compute node setting local environment |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
arvind kris wrote: |
I am having issues setting queuename in the local environment.
|
What issues? Error code? Java dump? Spirit voices warning of doom?
A little more information may help us help you. Particually why you're setting queue name like that.
Or do you mean local environment rather than LocalEnvironment? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 26, 2007 4:53 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm sure that arvind.kris is trying to save a queue name into LocalEnvironment, in order to re-use it later after wherever it's been stored has been overwritten by something else.
But it would be easier to see the code that's been tried. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
arvind kris |
Posted: Fri Oct 26, 2007 9:26 am Post subject: Exception |
|
|
Newbie
Joined: 25 Oct 2007 Posts: 4
|
EXCEPTION IS AS BELOW
Setting root element throwing Exception other than MBEX
<com.ibm.broker.plugin.MbBrokerException source:BIPv600 key:2230 message:[BIPv600:2230]BIP2230E: Error detected whilst processing a message in node 'Caught exception and rethrowing'.
The message broker detected an error whilst processing a message in node 'Caught exception and rethrowing'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error. : Caught exception and rethrowing >
at com.ibm.broker.plugin.MbOutputTerminal._propagate(Native Method)
at com.ibm.broker.plugin.MbOutputTerminal.propagate(MbOutputTerminal.java:140)
at MUFIDS_JavaCompute.evaluate(TEST_JavaCompute.java:85)
at com.ibm.broker.javacompute.MbRuntimeJavaComputeNode.evaluate(MbRuntimeJavaComputeNode.java:146)
at com.ibm.broker.plugin.MbNode.evaluate(MbNode.java:1222)
There is a null pointer at propogate to output terminal.
If you have done something similar then can you send a sample code that works. |
|
Back to top |
|
 |
arvind kris |
Posted: Fri Oct 26, 2007 9:28 am Post subject: loval environment |
|
|
Newbie
Joined: 25 Oct 2007 Posts: 4
|
Printing local environment shows
(
(0x01000000):LocalEnvironment = (
(0x01000000):Destination = (
(0x01000000):MQ = (
(0x01000000):DestinationData = (
(0x03000000):queuename = 'UAQ.MUFIDS.OMA.OUT.TEST'
)
)
)
)
) |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 26, 2007 9:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
arvind kris |
Posted: Fri Oct 26, 2007 2:25 pm Post subject: |
|
|
Newbie
Joined: 25 Oct 2007 Posts: 4
|
Guys does any one have a sample java code using DestinationList. |
|
Back to top |
|
 |
Miriam Kaestner |
Posted: Fri Nov 09, 2007 3:45 pm Post subject: |
|
|
Centurion
Joined: 26 Jun 2001 Posts: 103 Location: IBM IT Education Services, Germany
|
This works for me:
public void evaluate(MbMessageAssembly contact admin) throws MbException {
MbOutputTerminal out = getOutputTerminal("out");
MbOutputTerminal alt = getOutputTerminal("alternate");
// ----------------------------------------------------------
// Add user code below
MbMessage outLocalEnv = new MbMessage(contact admin.getLocalEnvironment());
MbElement oLE = outLocalEnv.getRootElement();
MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,
outLocalEnv, contact admin.getExceptionList(), contact admin
.getMessage());
MbMessage inMsg = contact admin.getMessage();
String rtsService = (String) inMsg
.evaluateXPath("string(CC_Order/Routing_Slip/Service/Name)");
oLE.evaluateXPath("string(?Destination/?MQ/?$DestinationData/?queueName[set-value('" + rtsService+"')]");
outLocalEnv.finalizeMessage(MbMessage.FINALIZE_NONE);
// End of user code
// ----------------------------------------------------------
// The following should only be changed
// if not propagating message to the 'out' terminal
out.propagate(outAssembly);
} |
|
Back to top |
|
 |
|