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 » Java Compute Node - evaluateXPath

Post new topic  Reply to topic
 Java Compute Node - evaluateXPath « View previous topic :: View next topic » 
Author Message
nathanw
PostPosted: Wed Jan 30, 2013 9:12 am    Post subject: Java Compute Node - evaluateXPath Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

Ok this has been implemented in the past and not by me I am just trying to find out why suddenly post V8 upgrade that the evaluateXPath function in a java compute node is failing in V8 when it worked in V6

The code snippet within the node is as follows (de-sensitised)

Code:
MbMessage inMessage = contact admin.getMessage();

                                MbMessage outMessage = new MbMessage(inMessage);

                                MbMessageAssembly outAssembly  = new MbMessageAssembly(contact admin, outMessage);

                                String transferMnemonics= (String) inMessage.getRootElement().getFirstElementByPath("filepath").getValue();

                                String fileName = (String) inMessage.getRootElement().getFirstElementByPath("filename").getValue();

                                outMessage.getRootElement().getLastChild().detach();

                                MbElement outRoot = outMessage.getRootElement();

                                MbElement outBody = outRoot.createElementAsLastChild("XMLNSC");

                               

                                // This block has changed to include file name in the trigger call

                               

                                outMessage.evaluateXPath("/?is04_service_request/?@xmlns:xsi[set-value('http://www.w3.org/2001/XMLSchema-instance')]");

                                outMessage.evaluateXPath("/is04_service_request/?$action/?@step[set-value(1)]" );


the error being received is (again de-sensitised)

Code:
2013-01-30 14:19:01.705552     5451   UserTrace   BIP2231E: Error detected whilst processing a message in node 'NODENAME'.

                                       The message broker detected an error whilst processing a message in node 'NODENAME'. The message has been augmented with an exception list and has been propagated to the node's failure terminal for further processing.

                                       See the following messages for details of the error.

2013-01-30 14:19:01.705580     5451   RecoverableException  BIP2230E: Error detected whilst processing a message in node 'NODENAME2'.

                                       The message broker detected an error whilst processing a message in node 'NODENAME2'. An exception has been thrown to cut short the processing of the message.

                                       See the following messages for details of the error.

2013-01-30 14:19:01.705588     5451   RecoverableException  BIP4359E: XPath query ''/?is04_service_request/?@xmlns:xsi[set-value('http://www.w3.org/2001/XMLSchema-instance')]'' has an undefined namespace prefix ''xmlns''

                                       All namespace prefixes in an XPath expression must be mapped to a namespace URI. The prefix quoted in the error message is not mapped.

                                       If you created the XPath expression using the XPath Expression Builder in the Toolkit:

                                       - Open the XPath Expression Builder.

                                       - Expand the 'Namespace Settings' section.

                                       - Add the prefix and its URI to the list.

                                       - Redeploy the message flow.

                                       If you supplied the XPath expression in a monitoring profile through a configurable service:

                                       - Add a 'prefixMapping' element to the monitoring profile.

                                       - Update the configurable service that contains the monitoring profile.


So folks do we know of any changes in V8 that could have affected this?
_________________
Who is General Failure and why is he reading my hard drive?

Artificial Intelligence stands no chance against Natural Stupidity.

Only the User Trace Speaks The Truth
Back to top
View user's profile Send private message MSN Messenger
lancelotlinc
PostPosted: Wed Jan 30, 2013 9:33 am    Post subject: Reply with quote

Jedi Knight

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

There is an APAR out related to the XERCES component of the WMB runtime about it running out of memory and generating errors like this. You'll need to open a PMR to get the APAR as the fix isn't scheduled for GA until next quarter. I don't have my notes any more about it, so I can't give you the number.
_________________
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
nathanw
PostPosted: Thu Jan 31, 2013 2:14 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

lancelotinc

thanks for the reply if you can find any info linking this i would be grateful
_________________
Who is General Failure and why is he reading my hard drive?

Artificial Intelligence stands no chance against Natural Stupidity.

Only the User Trace Speaks The Truth
Back to top
View user's profile Send private message MSN Messenger
kimbert
PostPosted: Thu Jan 31, 2013 4:54 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I don't think this is caused by that APAR. It looks like a simple configuration issue. Are you 100% sure that this worked OK in v6? Because there haven't been any major changes in this area for a long time.

Regardless, the error message is very specific about how to fix it - you need to declare all of the prefixes that your XPath expression uses. If v6 was allowing you to omit some of them then that was probably a defect in v6.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jan 31, 2013 4:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

kimbert wrote:
you need to declare all of the prefixes that your XPath expression uses. If v6 was allowing you to omit some of them then that was probably a defect in v6.

This is done by creating an MbXPath object, and setting the namespace prefixes on that object before executing the query.

Using xpath for this simple a task, however, seems a bit unnecessary.
Back to top
View user's profile Send private message
nathanw
PostPosted: Fri Feb 01, 2013 6:29 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

as an update talking about this with IBM the initial response was they were not sure if this was a XPATH expression issue or an underlying issue with the XPATH engine itself.

@kimbert I agree about the defect in V6 as we have had similar points to ponder in the past where we have had to change a line of esql in V8.

I am looking at the expression side of things as well as waiting for response from IBM

Thanks for all your inputs so far
_________________
Who is General Failure and why is he reading my hard drive?

Artificial Intelligence stands no chance against Natural Stupidity.

Only the User Trace Speaks The Truth
Back to top
View user's profile Send private message MSN Messenger
kimbert
PostPosted: Fri Feb 01, 2013 9:24 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
talking about this with IBM the initial response was they were not sure if this was a XPATH expression issue or an underlying issue with the XPATH engine itself.
It's 'neither of the above'.

The XPath specification requires that every namespace prefix is mapped to a URL. It doesn't say how this mapping should be done. The WMB Java API does it in the way described by mqjeff above.
Back to top
View user's profile Send private message
nathanw
PostPosted: Tue Feb 05, 2013 4:11 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

As an update

"We" have coded a work around to this issue.

The original code was

Code:
outMessage.evaluateXPath("/?is04_service_request/?@xmlns:xsi[set-value('http://www.w3.org/2001/XMLSchema-instance')]");


This was changed to be

Code:
outMessage.evaluateXPath("/?is04_service_request");


The process now works with the javanode initiating the application trigger to read the file.

I can only assume that V6 worked the same way but ignored the second portion whereas V8 reads the entire portion and was trying to use the data and failing as it was not a real "link"

As ever thanks for the advice chaps.

I have informed IBM of the change and that if they have anything further to add then they should let us know.
_________________
Who is General Failure and why is he reading my hard drive?

Artificial Intelligence stands no chance against Natural Stupidity.

Only the User Trace Speaks The Truth
Back to top
View user's profile Send private message MSN Messenger
kimbert
PostPosted: Tue Feb 05, 2013 5:16 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I can only assume that V6 worked the same way but ignored the second portion whereas V8 reads the entire portion and was trying to use the data and failing as it was not a real "link"
I cannot work out why you are assuming that. The error message was very specific: you did not provide bindings for all of the namespace prefixes in the query. WMB v8 is applying that rule strictly - as v6.1 should have done.
What am I missing? ( Vitor and mqjeff: polite answers only, please )
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Feb 05, 2013 5:18 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

kimbert wrote:
What am I missing? ( Vitor and mqjeff: polite answers only, please )


If I phrase it in the form of a question, is it still an answer?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 05, 2013 5:31 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kimbert wrote:
What am I missing? ( Vitor and mqjeff: polite answers only, please )


That hurts. As the truth often does.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Feb 05, 2013 10:48 pm    Post subject: Reply with quote

Grand High Poobah

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

kimbert wrote:
Quote:
I can only assume that V6 worked the same way but ignored the second portion whereas V8 reads the entire portion and was trying to use the data and failing as it was not a real "link"
I cannot work out why you are assuming that. The error message was very specific: you did not provide bindings for all of the namespace prefixes in the query. WMB v8 is applying that rule strictly - as v6.1 should have done.
What am I missing? ( Vitor and mqjeff: polite answers only, please )


Don't think you're missing anything at all. As I remember V7 already worked the correct way. So this might be strictly a V6 problem...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Wed Feb 06, 2013 2:04 am    Post subject: Re: Java Compute Node - evaluateXPath Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

nathanw wrote:
Code:
outMessage.evaluateXPath("/?is04_service_request/?@xmlns:xsi[set-value('http://www.w3.org/2001/XMLSchema-instance')]");

'@' is the wrong axis-specifier to use for namespace declarations. Use 'namespace::' instead.

kimbert wrote:
Regardless, the error message is very specific about how to fix it - you need to declare all of the prefixes that your XPath expression uses.

The XML namespace standard prohibits an explicit declaration for the 'xmlns' prefix itself. MbXPath should not require adding a namespace prefix for it.

It's more likely that the error is indirectly due to the wrong axis-specifier. The 'xmlns' prefix is meant only for namespace declarations, not for other attributes.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Feb 06, 2013 5:45 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
The XML namespace standard prohibits an explicit declaration for the 'xmlns' prefix itself. MbXPath should not require adding a namespace prefix for it.
That's a very good point - thanks.
Quote:
It's more likely that the error is indirectly due to the wrong axis-specifier. The 'xmlns' prefix is meant only for namespace declarations, not for other attributes.


Right - so the error message is insisting on the 'xmlns' prefix only because the axis specifier says that this is a normal attribute. That's a theory worth following up on.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Java Compute Node - evaluateXPath
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.