Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 558EAF1B9 for ; Mon, 25 Mar 2013 17:34:52 +0000 (UTC) Received: (qmail 62033 invoked by uid 500); 25 Mar 2013 17:34:52 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 61964 invoked by uid 500); 25 Mar 2013 17:34:52 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 61957 invoked by uid 99); 25 Mar 2013 17:34:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Mar 2013 17:34:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Mar 2013 17:34:49 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 022CE23889EB; Mon, 25 Mar 2013 17:34:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1460772 - /cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Date: Mon, 25 Mar 2013 17:34:28 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130325173429.022CE23889EB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Mon Mar 25 17:34:28 2013 New Revision: 1460772 URL: http://svn.apache.org/r1460772 Log: If cannot create a parser factory at startup, allow trying at runtime. Modified: cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Modified: cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=1460772&r1=1460771&r2=1460772&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Mon Mar 25 17:34:28 2013 @@ -163,14 +163,19 @@ public final class StaxUtils { allowInsecureParser = "1".equals(s) || Boolean.parseBoolean(s); } - XMLInputFactory xif = createXMLInputFactory(true); - String xifClassName = xif.getClass().getName(); - if (xifClassName.contains("ctc.wstx") || xifClassName.contains("xml.xlxp") - || xifClassName.contains("xml.xlxp2") || xifClassName.contains("bea.core")) { - SAFE_INPUT_FACTORY = xif; - } else { - SAFE_INPUT_FACTORY = null; + XMLInputFactory xif = null; + try { + xif = createXMLInputFactory(true); + String xifClassName = xif.getClass().getName(); + if (!xifClassName.contains("ctc.wstx") && !xifClassName.contains("xml.xlxp") + && !xifClassName.contains("xml.xlxp2") && !xifClassName.contains("bea.core")) { + xif = null; + } + } catch (Throwable t) { + //ignore, can always drop down to the pooled factories + xif = null; } + SAFE_INPUT_FACTORY = xif; XMLOutputFactory xof = XMLOutputFactory.newInstance(); String xofClassName = xof.getClass().getName();