-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b92
-
x86
-
linux, windows_xp
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b60)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b60, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
SAXParserFactory.newInstance() throws FactoryConfigurationError if in current contextClassLoader=null. Version 1.5_04, 1.5_05 works ok. As result of this change of the behaviour, maven tool can't work under mustang.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run example
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
SAXParserFactory.newInstance() expected to use system loader when there is no context one.
ACTUAL -
Exception is thrown
ERROR MESSAGES/STACK TRACES THAT OCCUR :
C:\>java -showversion -Djaxp.debug=1 JAXPTest
java version "1.6.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b60)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b60, mixed mode, sharing)
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: found jar resource=META-INF/services/javax.xml.parsers.SAXParserFactory using ClassLoader: nul
l
JAXP: found in resource, value=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
Exception in thread "main" javax.xml.parsers.FactoryConfigurationError: Provider com.sun.org.apache.
xerces.internal.jaxp.SAXParserFactoryImpl could not be instantiated: java.lang.NullPointerException
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
at JAXPTest.main(JAXPTest.java:8)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.xml.parsers.SAXParserFactory;
public class JAXPTest
{
public static void main(String[] args) throws Exception
{
Thread.currentThread().setContextClassLoader(null);
SAXParserFactory.newInstance();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Don't set context class loader to null.
Release Regression From : 5.0u5
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
java version "1.6.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b60)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b60, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
SAXParserFactory.newInstance() throws FactoryConfigurationError if in current contextClassLoader=null. Version 1.5_04, 1.5_05 works ok. As result of this change of the behaviour, maven tool can't work under mustang.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run example
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
SAXParserFactory.newInstance() expected to use system loader when there is no context one.
ACTUAL -
Exception is thrown
ERROR MESSAGES/STACK TRACES THAT OCCUR :
C:\>java -showversion -Djaxp.debug=1 JAXPTest
java version "1.6.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b60)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b60, mixed mode, sharing)
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: found jar resource=META-INF/services/javax.xml.parsers.SAXParserFactory using ClassLoader: nul
l
JAXP: found in resource, value=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
Exception in thread "main" javax.xml.parsers.FactoryConfigurationError: Provider com.sun.org.apache.
xerces.internal.jaxp.SAXParserFactoryImpl could not be instantiated: java.lang.NullPointerException
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
at JAXPTest.main(JAXPTest.java:8)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.xml.parsers.SAXParserFactory;
public class JAXPTest
{
public static void main(String[] args) throws Exception
{
Thread.currentThread().setContextClassLoader(null);
SAXParserFactory.newInstance();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Don't set context class loader to null.
Release Regression From : 5.0u5
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
- duplicates
-
JDK-6369399 (cl) REGRESSION: NPE exception throws when invoked from a JNI callback thread
- Closed
- relates to
-
JDK-6419145 JAXP fails to fall back properly when a non-standard class loader delegation is used
- Resolved