This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 17358 - xerces.jar in the jre/ext directory prevents NB startup
Summary: xerces.jar in the jre/ext directory prevents NB startup
Status: CLOSED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 14237 17278 17727 18627 18693 18786 18966 19395 19663 25349 29396 29776 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-11-07 04:16 UTC by kokaku
Modified: 2008-12-22 16:45 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kokaku 2001-11-07 04:16:59 UTC
On my system, the JRE java.exe is the 1st in the path. 
There is a [JDK_HOME]/jre/lib/ext directory containing 3rd party JARs.

One of these was the v1.4.3 xerces.jar. When this file was in the ext dir, NB 
failed to startup with the following exception...
javax.xml.parsers.FactoryConfigurationError: org.netbeans.core.xml.NbSAXParserFa
ctoryImpl
        at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:
157)
        at org.openide.xml.XMLUtil.createXMLReader(XMLUtil.java:69)
        at org.openide.xml.XMLUtil.createXMLReader(XMLUtil.java:43)
        at org.openide.loaders.XMLDataObject.<clinit>(XMLDataObject.java:935)
        at org.netbeans.core.NbTheme.parseTheme(NbTheme.java:110)
        at org.netbeans.core.NbTheme.<init>(NbTheme.java:90)
        at org.netbeans.core.Main.run(Main.java:118)
        at org.openide.TopManager.initializeTopManager(TopManager.java:120)
        at org.openide.TopManager.getDefault(TopManager.java:81)
        at org.netbeans.core.Main.main(Main.java:325)
        at org.netbeans.core.TopThreadGroup.run(TopThreadGroup.java:90)
        at java.lang.Thread.run(Thread.java:484)

Once I figured out that the xerces.jar was causing the problem, I thought it 
might be a version issue. I copied the NB xerces.jar from [NB_HOME]/lib/ext 
into the jre/ext dir and restarted. No luck - same exception.

Given the convenience of the Java extensions mechanism and the prevalence of 
the Apache XML tools, I think this is a potential configuration issue.

Ideally, NB should work with whatever version of xerces.jar is in the user's 
ext directory (w/in reason of course - I don't expect an NB expecting a version 
1.x.x to work with a version 2.y.y). Barring that, I do not know if there is 
some way to prevent the JVM from loading a JAR in the extensions directory (so 
that the user can preserve their settings but NB can suppress it in favor of 
its own) but that would be a good solution (if the user could unload classes 
already loaded so that NB doesn't get hung-up).
Comment 1 _ ttran 2001-11-07 07:52:20 UTC
*** Issue 17278 has been marked as a duplicate of this issue. ***
Comment 2 Jesse Glick 2001-11-07 09:31:10 UTC
Sorry, if you place any JAR in jre/lib/ext/ it affects every Java
program you run, in this case detrimentally. (Extensions take
precedence over items in the user classpath.) NB is not designed to
run with an arbitrary version of any of its libraries, this would make
it impossible to test. Please delete the extension if you want to run
NB.

I don't know why it would fail if you *copy* xerces.jar (maybe someone
knowledgeable about the XML parser system could answer) but apparently
it does.

It has been suggested that NB explicitly exclude JRE extensions from
its classpath when starting, which would also improve startup
performance a bit. Unfortunately doing so, while possible, requires
making small VM-specific hacks (i.e. you have to know something about
the JDK implementation). We might do it anyway in the future.
Comment 3 Jesse Glick 2002-07-10 02:59:11 UTC
Some investigation (trial & error as well as examining sources)
reveals that the error is due to a bug in Xerces fixed in 1.4.4 (and
2.x). With 1.4.4 and later, the IDE will generally work even if there
is some extra copy in jre/lib/ext/ (though if in doubt try removing
it). 1.4.3 and earlier have a serious problem in their JAXP
implementation: if the parser is specified by class name in a system
property, only the classloader used for JAXP is searched for the
parser. When you place JAXP (part of Xerces 1.x) in the JRE extension
classloader, it does not look in the application classloader, where NB
has its own parser factory.

So no change in NB seems necessary or desirable. If you do not put an
old and broken JAXP implementation in your boot classpath so as to
override the working impl in NB's classpath, there will be no problem.
Comment 4 Jesse Glick 2002-07-10 03:01:41 UTC
*** Issue 18693 has been marked as a duplicate of this issue. ***
Comment 5 Jesse Glick 2002-07-10 03:03:10 UTC
*** Issue 19395 has been marked as a duplicate of this issue. ***
Comment 6 Jesse Glick 2002-07-10 03:04:25 UTC
*** Issue 18966 has been marked as a duplicate of this issue. ***
Comment 7 Jesse Glick 2002-07-10 03:05:00 UTC
*** Issue 18786 has been marked as a duplicate of this issue. ***
Comment 8 Jesse Glick 2002-07-10 03:05:41 UTC
*** Issue 18627 has been marked as a duplicate of this issue. ***
Comment 9 Jesse Glick 2002-07-10 03:08:19 UTC
*** Issue 17727 has been marked as a duplicate of this issue. ***
Comment 10 Jesse Glick 2002-07-10 03:09:35 UTC
*** Issue 25349 has been marked as a duplicate of this issue. ***
Comment 11 Jesse Glick 2002-07-10 03:11:11 UTC
*** Issue 19663 has been marked as a duplicate of this issue. ***
Comment 12 Jesse Glick 2002-07-10 03:14:31 UTC
Note: *not* a duplicate of issue #11020.
Comment 13 _ ttran 2002-07-10 09:51:47 UTC
*** Issue 25349 has been marked as a duplicate of this issue. ***
Comment 14 Petr Nejedly 2002-07-11 16:16:24 UTC
*** Issue 14237 has been marked as a duplicate of this issue. ***
Comment 15 Marek Grummich 2002-07-19 16:27:43 UTC
Target milestone was changed from not determined to TBD
Comment 16 Patrick Keegan 2002-08-08 19:42:18 UTC
proposed release note:

Description: If you have version 1.4.3 or earlier of xerxes.jar in 
your [JDK_HOME]/jre/lib/ext directory, the IDE does not start up.

Workaround: Remove the copy of xerxes.jar in your 
[JDK_HOME]/jre/lib/ext directory or replace it with a later version.
Comment 17 Jesse Glick 2002-08-09 22:38:00 UTC
1. The note should recommend that the user delete the JAR entirely,
not upgrade it.

2. "xerces" is the name used by the Apache project, though "xerxes" is
the conventional spelling for the historical king. :-)
Comment 18 Patrick Keegan 2002-08-12 16:24:49 UTC
relnote changes done and done
Comment 19 pzajac 2002-12-09 09:43:13 UTC
*** Issue 29396 has been marked as a duplicate of this issue. ***
Comment 20 pzajac 2003-01-06 09:10:14 UTC
*** Issue 29776 has been marked as a duplicate of this issue. ***
Comment 21 Patrick Keegan 2004-03-03 22:45:42 UTC
removing RELNOTE keyword as this does not seem to afflict people anymore
Comment 22 Jesse Glick 2004-03-03 22:57:48 UTC
I haven't tried, but AFAIK this bug should not surface in NB 3.6
anyway since we rely on JDK 1.4 and no longer use the special JAXP
factory in core nor have Xerces on the main IDE classpath. Also the
Xerces 1.4.3- versions that seemed to have caused the bug are long
obsolete now.