You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by Tim Putnam <t....@reading.ac.uk> on 2006/11/13 15:43:58 UTC
StAXUtils and XMLInputFactory instantiation
Hi,
I'm using Axiom 1.2 in the context of the latest Axis 2 v1.1 snapshots. I've
twice in two months had issues with a particular part of the source, that
being in org.apache.axiom.om.util.StAXUtils:
synchronized public static XMLInputFactory getXMLInputFactory() {
if (!xmlInputFactoryPool.empty()) {
return (XMLInputFactory) xmlInputFactoryPool.pop();
}
return
XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory",
StAXUtils.class.getClassLoader());
}
When I run my application on either Java 1.6 beta ONE, or the recent Java
1.6 RC 1, it fails when attempting to create the new instance. I have no
idea why, but I get an InstantiationException (exactly the same thing worked
perfectly on Java 1.6 beta TWO).
I've currently got around the issue by replacing the above instantiation in
StAXUtils with the line:
return XMLInputFactory.newInstance();
..which works perfectly. Could anybody shed any light on what the issue is
that I'm experiencing and why its changing with the Java versions? Also, why
is StAXUtils using the parameterised version of this interface when its just
passing in defaults?
Many thanks,
Tim
Re: StAXUtils and XMLInputFactory instantiation
Posted by Davanum Srinivas <da...@gmail.com>.
Please log a bug. we need to add a try/catch and fall back to ("return
XMLInputFactory.newInstance();"). looks like the stax api inside your
jdk version has a problem. (try dropping the stax 1.0.1 api jar in
lib/endorsed) if you want to run w/o a code fix.
thanks,
dims
On 11/13/06, Tim Putnam <t....@reading.ac.uk> wrote:
> Hi,
>
>
>
> I'm using Axiom 1.2 in the context of the latest Axis 2 v1.1 snapshots. I've
> twice in two months had issues with a particular part of the source, that
> being in org.apache.axiom.om.util.StAXUtils:
>
>
>
> synchronized public static XMLInputFactory getXMLInputFactory() {
> if (!xmlInputFactoryPool.empty()) {
> return (XMLInputFactory) xmlInputFactoryPool.pop();
> }
> return
> XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory",
> StAXUtils.class.getClassLoader());
> }
>
>
>
> When I run my application on either Java 1.6 beta ONE, or the recent Java
> 1.6 RC 1, it fails when attempting to create the new instance. I have no
> idea why, but I get an InstantiationException (exactly the same thing worked
> perfectly on Java 1.6 beta TWO).
>
>
>
> I've currently got around the issue by replacing the above instantiation in
> StAXUtils with the line:
>
>
>
> return XMLInputFactory.newInstance();
>
>
> ..which works perfectly. Could anybody shed any light on what the issue is
> that I'm experiencing and why its changing with the Java versions? Also, why
> is StAXUtils using the parameterised version of this interface when its just
> passing in defaults?
>
>
>
> Many thanks,
>
> Tim
>
>
>
>
>
--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org