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 51945 - [JDK 1.4] Cannot create a Java App Project if XML modules are disabled - XMLUtil.write fails to find xerces impl
Summary: [JDK 1.4] Cannot create a Java App Project if XML modules are disabled - XMLU...
Status: CLOSED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: JDK_SPECIFIC
: 52857 54549 55337 58159 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-30 15:56 UTC by _ mihmax
Modified: 2011-06-09 09:51 UTC (History)
3 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 _ mihmax 2004-11-30 15:56:16 UTC
If you disable all the XML modules
(or even if you leave XML text editor on),

then you won't be able to create a Java
Application Project.

Error (in blue) sais 
"Unsupported DOM implementation!
java.lang.ClassNotFoundException:
org.apache.xml.serialize.XMLSerializer"

IMHO, it's because J2SEProjects module doesn't
declare dependency upon Xerces integration library
(where this class belongs),
and Xerces integration lib is off if you disable
XML modules.

P2 because it's (IMHO) highly impacting.
Getting from "why?" to "oh! I solved it!" took me
a lot.
Comment 1 Jesse Glick 2004-12-01 17:35:02 UTC
Working for me in a dev build. Just turned off all XML modules then
created a new Java app with no problems.
Comment 2 _ mihmax 2004-12-01 18:22:01 UTC
So Jesse,
it won't be fixed in 4.0?
Comment 3 Jesse Glick 2004-12-01 18:28:58 UTC
WORKSFORME means just what it says - could not observe any bug when
attempting to reproduce. If you can reproduce the bug (from scratch,
with precise instructions) in 4.0 but *not* in 4.1, then it is
FIXED/4.1, and as a priority bug is a possible candidate for a
backport before the 4.0 release, if there is a well-understood and
safe fix.

Milan would be nice if you could double-check this as well.
Comment 4 Milan Kubec 2004-12-02 13:32:35 UTC
Not reproducible for me either. Tested on RC2.
Comment 5 _ mihmax 2004-12-08 19:33:56 UTC
Tested on RC2.
RC2 needs more modules being shut down, still J2SE projects module
doesn't depend on Xerces intergation module, though it should.

Reproduce:
1. Start RC2
2. Go to Tools -> Options
3. In Options window open IDE Configuration -> System -> Modules
4. Switch off the following modules
- All XML modules (also swithes off some Web modules)
- Tomcat 5 Server
5. Try to create new Java Application project

Fails
Comment 6 Jesse Glick 2004-12-09 18:59:53 UTC
Can reproduce with new instructions. To be expected under JDK 1.5+,
since Xerces is repackaged under the "com.sun." prefix, and
XMLUtilImpl does not deal with that. Under JDK 1.4, Xerces is not
included in the JRE, so this serializer cannot be used, but perhaps
org.apache.xalan.serialize.SerializerToXML will be usable. Should
evaluate whether it is possible to make XMLUtil.write work reliably
(incl. namespaces) on JDK 1.4 and 1.5+ w/o the xerces lib module. If
it really isn't, then ant/project will need to declare a (runtime
only) dep on the xerces module.
Comment 7 Jesse Glick 2004-12-09 19:01:45 UTC
Note that it would anyway be desirable to have a solution not
requiring the xerces module, since many unit tests directly or
indirectly call XMLUtil.write and it is a pain to always be adding
xerces.jar (and the org.w3c.dom.ranges.* JAR needed to complete it
under JDK 1.4!) to the test runtime classpath.
Comment 8 Antonin Nebuzelsky 2005-02-08 14:17:51 UTC
Jesse, what are we going to do with this P2 in 4.1? Waive it?
Comment 9 Antonin Nebuzelsky 2005-02-08 19:49:34 UTC
Hrebejku, Jesse will not be available for a few weeks. Can you or
someone from projects/stavbicka decide what we can do about this in
4.1? Please, comment here or assign to someone who could comment. Diky.
Comment 10 Petr Hrebejk 2005-02-09 09:15:01 UTC
Another waiver for 4.1 I think.
Comment 11 _ rkubacki 2005-02-17 12:22:59 UTC
*** Issue 52857 has been marked as a duplicate of this issue. ***
Comment 12 Jan Chalupa 2005-02-22 20:02:43 UTC
*** Issue 55337 has been marked as a duplicate of this issue. ***
Comment 13 Jan Chalupa 2005-03-10 17:34:28 UTC
Jesse, is there anything we can do here? A candidate for waiver?
Comment 14 Martin Roskanin 2005-03-11 09:37:07 UTC
*** Issue 54549 has been marked as a duplicate of this issue. ***
Comment 15 Jesse Glick 2005-03-11 23:06:58 UTC
I can and will fix for JDK 1.5+, but not for JDK 1.4. The problem is that there
is *no library* included in JDK 1.4 (at least, Sun's version) which is able to
correctly serialize a DOM document with namespaces. JAXP does not do it
correctly. JAXP might do it correctly in JDK 1.5+, but there at least Xerces is
available in the JDK (packaged under a special name) and we can use Xerces'
serializer, which seems to be of good quality. (Xalan's serializer, used by
JAXP, is not.)

So for JDK 1.5+ it will not matter, but for now under JDK 1.4 you cannot disable
the Xerces module. The IDE could prevent you from doing so, with some additional
mess, but since this is an obsolete platform I do not want to waste time working
around it.
Comment 16 Jesse Glick 2005-03-14 16:12:49 UTC
Fixing for JDK 1.5+ only, leaving open for JDK 1.4.

committed     Up-To-Date  1.14        openide/src/org/openide/xml/XMLUtilImpl.java
Comment 17 Martin Roskanin 2005-04-21 14:00:38 UTC
*** Issue 58159 has been marked as a duplicate of this issue. ***
Comment 18 Jesse Glick 2005-08-09 01:25:03 UTC
I filed #6308026 for namespace ser problems in JDK 1.4.
Comment 19 Jesse Glick 2005-08-09 01:43:13 UTC
I filed #6308037 for the problem creating new projects. That part is fixable on
our side, at least, by using JAXP rather than Xerces serialization (in JDK 1.5+
only).
Comment 20 Jesse Glick 2005-08-09 01:44:04 UTC
Oops, ignore that last comment, wrong issue.
Comment 21 Jesse Glick 2006-03-20 16:29:22 UTC
No JDK 1.4 workarounds in trunk.
Comment 22 Marian Mirilovic 2011-06-09 09:51:22 UTC
v/c