Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 70983 invoked from network); 9 Aug 2007 14:30:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Aug 2007 14:30:50 -0000 Received: (qmail 13237 invoked by uid 500); 9 Aug 2007 14:30:45 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 12825 invoked by uid 500); 9 Aug 2007 14:30:43 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 12816 invoked by uid 99); 9 Aug 2007 14:30:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2007 07:30:43 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2007 14:30:38 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1IJ91l-0001gE-7P for user@commons.apache.org; Thu, 09 Aug 2007 07:30:17 -0700 Message-ID: <12073372.post@talk.nabble.com> Date: Thu, 9 Aug 2007 07:30:17 -0700 (PDT) From: david2 To: user@commons.apache.org Subject: XPathFactoryFinder. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: David.Bueche@l-3comcept.com X-Virus-Checked: Checked by ClamAV on apache.org We have a Web Services Notification application that uses Muse, Xalan, and XML commons (we have tried both xml-apis-1.3.03.jar and xml-apis-1.3.04.jar). We are using XPath message pattern filtering as the filtering mechanism for web service notification, but we also require some custom filtering (subclassing MessagePatternFilter with ExtnMessagePatternFilter). Our ExtnMessagePatternFilter accept method is as follows: public boolean accepts(NotificationMessage message) { Document doc = XmlUtils.createDocument(); logger.debug("doc = " + doc); Element messageXML = message.toXML(doc); ogger.debug("messageXML = " + messageXML); doc.appendChild(messageXML); logger.debug("appended doc = " + doc); XPathFactory factory = XPathFactory.newInstance(); XPath xpath = factory.newXPath(); CompositeNamespaceContext namespaceContext = new CompositeNamespaceContext(); namespaceContext.addNamespaceContext(new ExtensionNamespaceContext()); namespaceContext.addNamespaceContext(new SnaNamespaceContext()); xpath.setNamespaceContext(namespaceContext); xpath.setXPathFunctionResolver(new XPathFunctionResolverImpl()); try { boolean result = ((Boolean)xpath.evaluate(this._pattern, doc, XPathConstants.BOOLEAN)).booleanValue(); logger.debug("result = " + result); return result; } catch (Exception error) { error.printStackTrace(); return false; } } This code works fine in the Eclipse debugger using the Maven Dependencies plugin. However, when we perform a Maven build and deploy to Tomcat, we get the following exception when the XPathFactory is instantiated (bold line above): java.lang.NullPointerException at javax.xml.xpath.XPathFactoryFinder._newFactory(XPathFactoryFinder.java:222) at javax.xml.xpath.XPathFactoryFinder.newFactory(XPathFactoryFinder.java:143) at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:185) at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:99) at com.myorg.myapp.ws.notification.impl.ExtnMessagePatternFilter.accepts(ExtnMessagePatternFilter.java:69) at org.apache.muse.ws.notification.impl.FilterCollection.accepts(FilterCollection.java:64) at com.myorg.myapp.ws.notification.impl.BufferedSubscriptionManager.publish(BufferedSubscriptionManager.java:73) at com.myorg.myapp.ws.notification.impl.NewsNotificationProducer.publish(NewsNotificationProducer.java:38) at org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(SimpleNotificationProducer.java:420) at com.myorg.myapp.ws.handler.DDSHandler.run(DDSHandler.java:304) at com.myorg.commons.util.reactor.ReactorAdapter.run(ReactorAdapter.java:19) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) Have there been any previous issues with instantiating XPathFactory with Muse using a Maven build? -David -- View this message in context: http://www.nabble.com/XPathFactoryFinder.-tf4242920.html#a12073372 Sent from the Commons - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org