ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SOAPRequest node java null pointer // thread dead

Post new topic  Reply to topic
 SOAPRequest node java null pointer // thread dead « View previous topic :: View next topic » 
Author Message
lancelotlinc
PostPosted: Wed Aug 03, 2011 10:17 am    Post subject: SOAPRequest node java null pointer // thread dead Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

On 7.0.0.2 IFix 01:

Ran into an interesting problem today. Admittedly my WSDL file was not up to par, so I am working on that.

But I noticed that the SOAPRequest node threw a java lang null pointer exception and did not propagate that exception up the node chain.

Code:
      (0x01000000:Folder)http://schemas.xmlsoap.org/soap/envelope/:Fault = (
        (0x03000000:PCDataField):faultcode   = 'soapenv:Server' (CHARACTER)
        (0x03000000:PCDataField):faultstring = 'java.lang.NullPointerException' (CHARACTER)


I would have expected the exception to have been propagated up the chain, back into the previous nodes, but instead the thread just died.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Wed Aug 03, 2011 12:18 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

We identified the cause of the java lang null pointer exception. The data coming back has a date value and when the SOAPRequest tries to parse the date value, the null pointer exception is thrown.

So our workaround is to represent the date value differently. However, it would be nice that when any exception happens, even null pointers, the exception gets pushed back up the node chain. I think this may be a bug.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Wed Aug 03, 2011 12:42 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

This form of the date value works well:

Code:
<transactionDate>Wed Aug 03 15:37:11 CDT 2011</transactionDate>
<transactionTime>Wed Aug 03 15:37:11 CDT 2011</transactionTime>


This form of the date value causes the SOAPRequest node to fail, and the thread to be killed:

Code:
<transactionDate>2011-05-08</transactionDate>
<transactionTime>2011-05-08</transactionTime>


The datatype defined in the WSDL is string:

Code:
<xsd:element minOccurs="0" name="transactionDate"  type="xsd:string"/>
<xsd:element minOccurs="0" name="transactionTime"  type="xsd:string"/>


I'm not clear on why this makes a difference since the date is string type, therefore, any string of chars would be acceptable.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Aug 03, 2011 1:02 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

lancelotlinc wrote:
This form of the date value works well:

Code:
<transactionDate>Wed Aug 03 15:37:11 CDT 2011</transactionDate>
<transactionTime>Wed Aug 03 15:37:11 CDT 2011</transactionTime>


This form of the date value causes the SOAPRequest node to fail, and the thread to be killed:

Code:
<transactionDate>2011-05-08</transactionDate>
<transactionTime>2011-05-08</transactionTime>


The datatype defined in the WSDL is string:

Code:
<xsd:element minOccurs="0" name="transactionDate"  type="xsd:string"/>
<xsd:element minOccurs="0" name="transactionTime"  type="xsd:string"/>


I'm not clear on why this makes a difference since the date is string type, therefore, any string of chars would be acceptable.


It is fine to give us the values but you did not specify any format clause. Maybe your xsd contains a specific format clause that will throw out the number only formatted date... although from the content both fields look more like a datetimestamp than like a date and time...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Aug 03, 2011 1:40 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi.

Can you explain where this came from in your first post:

Code:
 (0x01000000:Folder)http://schemas.xmlsoap.org/soap/envelope/:Fault = (
        (0x03000000:PCDataField):faultcode   = 'soapenv:Server' (CHARACTER)
        (0x03000000:PCDataField):faultstring = 'java.lang.NullPointerException' (CHARACTER)


I ask because this is output from a trace node, and if the thread really had died you would not have been able to get this output. So in addition, why do you think the thread died?

Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Wed Aug 03, 2011 2:19 pm    Post subject: Re: SOAPRequest node java null pointer // thread dead Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

lancelotlinc wrote:
But I noticed that the SOAPRequest node threw a java lang null pointer exception

... or the remote web service returned a SOAP Fault, indicating that it encountered a null pointer exception.

lancelotlinc wrote:
Code:
(0x03000000:PCDataField):faultcode   = 'soapenv:Server' (CHARACTER)

A little more evidence one way or the other could help clear up where the null pointer exception actually occurred.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Aug 03, 2011 2:53 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Hi Guys,

Thanks for your replies.

Flow:

SOAPInput -> Compute -> SOAPRequest -> Compute -> SOAPReply

Off the SOAPInput, have all four terminals connected running to independent processing paths: Happy Path plus Failure, Timeout, and Catch. In this default config, the thread will die upon receipt of the reply from the downstream provider (SOAPRequest fails with null pointer exception).

I found this out by connecting a trace node to the Failure terminal of the SOAPRequest node. When connected, the trace file produces the output you see above. If the SOAPRequest node's Failure terminal is left unconnected, I would have thought the Failure path off the SOAPInput node would have been activated; but it does not, the thread dies.

There is no format for the values, it is a simple string. If the string reads 2011-05-08 then the SOAPRequest node fails with null pointer exception.

The remote service does not produce the null pointer exception. The SOAPRequest node is generating the null pointer exception when it tries to read the date. If we take both date fields out entirely of the response coming back from downstream provider, then everything works. If we leave the date fields in but change the way the date is represented, then everything works.

Would you agree, that no matter what is causing any exception, the expected behaviour would have the fault being handled by the SOAPInput rather than die?

Using SoapUI, can successfully process many transactions from downstream provider no issues with any date format. Also, validation is turned off from the SOAPRequest; no validation is performed.

Thanks for your ideas.
Lance
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Aug 03, 2011 7:38 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Did you open a PMR yet?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Thu Aug 04, 2011 4:21 am    Post subject: Re: SOAPRequest node java null pointer // thread dead Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

lancelotlinc wrote:
In this default config, the thread will die upon receipt of the reply from the downstream provider (SOAPRequest fails with null pointer exception).

Did the node actually receive a reply from the downstream provider? What did that look like?

lancelotlinc wrote:
I found this out by connecting a trace node to the Failure terminal of the SOAPRequest node. When connected, the trace file produces the output you see above.

Trace file, or usertrace? The latter might provide additional useful information.

Did the SOAPRequest node also send an ExceptionList through the Failure terminal? That might be useful too.

lancelotlinc wrote:
Would you agree, that no matter what is causing any exception, the expected behaviour would have the fault being handled by the SOAPInput rather than die?

No. The SOAPRequest node is not throwing an Exception; it's catching one, and then handling it, by wrapping it in a SOAP Fault.

SOAP Faults are messages, not Exceptions. WMB nodes propagate messages; they don't throw them. And Java Exceptions are not WMB Exceptions. WMB nodes don't throw Java Exceptions.

When a WMB node propagates a message to an unconnected terminal, that completes the transaction. The thread isn't dying; it's terminating.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Aug 04, 2011 4:53 am    Post subject: Re: SOAPRequest node java null pointer // thread dead Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

rekarm01 wrote:
lancelotlinc wrote:
Would you agree, that no matter what is causing any exception, the expected behaviour would have the fault being handled by the SOAPInput rather than die?

No. The SOAPRequest node is not throwing an Exception; it's catching one, and then handling it, by wrapping it in a SOAP Fault.

SOAP Faults are messages, not Exceptions. WMB nodes propagate messages; they don't throw them. And Java Exceptions are not WMB Exceptions. WMB nodes don't throw Java Exceptions.

When a WMB node propagates a message to an unconnected terminal, that completes the transaction. The thread isn't dying; it's terminating.


So if my SOAPRequest node only has Out terminal connected, and the Failure and Fault terminals are not connected, your saying that the SOAP Fault message would not be pushed back up the node chain to be handled by the unhappy path processing connected to the SOAPInput node?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu Aug 04, 2011 4:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

errors propagated to the Fault terminal should get propagated backwards.

errors propagated to the Failure terminal... not necessarily.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Aug 04, 2011 5:00 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

So, everywhere I use a SOAPRequest node, I must have a separate execution path to handle exceptions connected to Failure terminal? This concept seems counter-intuitive. Intuitively, I would want all failures and faults to be handled by the original unhappy path processing already coded.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Thu Aug 04, 2011 6:22 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
If the SOAPRequest node's Failure terminal is left unconnected, I would have thought the Failure path off the SOAPInput node would have been activated; but it does not, the thread dies.


Hi, the above is a mis-understanding. The failure terminal on any given node is only ever used if a failure occurs within that node. So once the message leaves the SOAPInput node, the failure terminal will never be fired. However, it should be caught and go down the catch terminal on the SOAPInput node. if it is wired. If it is not wired, I would expect the SOAPInput node to send a SOAPFault back to the caller of the flow, assuming that the SOAPRequest node is throwing an exception.

I'm still not conviced of this yet, as the error you posted was a SOAPFault message and if th SOAPRequest node had an internal exception, it would not generate a SOAPFault message to send to its failure terminal - it would give you an exception list. My working assumption of what is happening here is the the remote server is returning you the SOAPFault message with the nullpointer info in it, and you have not wired the Fault terminal on the SOAPRequest node. In this case, the SOAPFault return message will still be sent to th Fault terminal, which, if not wired, would make it seem like the "thread died" as the flow would never see the message again. Can you check out the terminals wired on the SOAPRequest node please and make sure the Fault terminal is wired to a Trace node. Also, use an HTTPProxy to have a look at the messages being sent on the wire to see what is returned by the remote server...

Hope this helps...
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
mgk
PostPosted: Thu Aug 04, 2011 6:26 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
errors propagated to the Fault terminal should get propagated backwards.

errors propagated to the Failure terminal... not necessarily.


This is back to front. SOAPFault message returned are always sent to the Fault terminal, even if it is not wired. Any other exception in the SOAPRequest node is always sent to the Failure terminal (if wired) or thrown back up the flow (if not wired).

Kind Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Aug 04, 2011 6:30 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Thanks to all who posted.

The original assertion that rekarm made that the null pointer exception was coming from the downstream proved to be correct.

The downstream was faulting, and sending back a Soap message.

I am also smarter thanks to mgk about how the SOAPRequest node handles such. I will have to come up with special processing for these possibilities that is separate from my normal unhappy path processing.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SOAPRequest node java null pointer // thread dead
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.