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 35460 - Ant targets cannot be run when web/jspparser module is enabled
Summary: Ant targets cannot be run when web/jspparser module is enabled
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@projects
URL:
Keywords:
: 37205 (view as bug list)
Depends on: 35756
Blocks:
  Show dependency tree
 
Reported: 2003-08-18 09:11 UTC by Vitezslav Stejskal
Modified: 2005-07-15 07:49 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Ant's build script used to reproduce the problem (203 bytes, text/plain)
2003-08-18 15:50 UTC, Vitezslav Stejskal
Details
ide.log file produced with -J-Dorg.apache.tools.ant.module=0 (45.21 KB, text/plain)
2003-08-18 15:51 UTC, Vitezslav Stejskal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vitezslav Stejskal 2003-08-18 09:11:52 UTC
I've created Ant's build target from template
available on Output node, assigned some Ant's
script and selected target for building and
cleaning. However, when invoking the build or
clean command from build target's popup menu
nothing happens and following message is shown in
output window:

XML parser factory has not been configured
correctly: Provider
org.apache.crimson.jaxp.SAXParserFactoryImpl not found

IMO it has something to do with classloader
problems described in issue #35383.
Comment 1 Jesse Glick 2003-08-18 13:47:16 UTC
I am still unable to reproduce this bug. Please check (1) whether it
is Windows-specific, since I use Linux (ask QA for help if you don't
have a Linux box handy); (2) whether the same bug occurs for you in
trunk dev builds, which uses the same Ant code.

Also confirm that you are using a fresh build of the projects branch
from a clean checkout of sources (no stale external/*.jar lying around
etc.) with a fresh user directory and a newly created trivial Ant
script like

<project default="all">
    <target name="all">
        <echo>hello world</echo>
    </target>
</project>

Also run with

-J-Dorg.apache.tools.ant.module=0

and attach your complete ide.log after this error occurs.
Comment 2 Vitezslav Stejskal 2003-08-18 15:49:45 UTC
It seems to be Windows independent (tzezula reproduced the same
problem on Linux). I got fresh copy of ant module sources from cvs
(delete ant; cvs co -r prj40_prototype ant) and built it, used empty
userdir and slightly modified ant script (I will attach it as well as
the ide.log produced with -J-Dorg.apache.tools.ant.module=0). Running
the script still reports the same problem in output window:

Building TEST
Target TEST.
XML parser factory has not been configured correctly: Provider
org.apache.crimson.jaxp.SAXParserFactoryImpl not found
Compilation finished. Errors: 0, warnings: 0.

Comment 3 Vitezslav Stejskal 2003-08-18 15:50:21 UTC
Created attachment 11346 [details]
Ant's build script used to reproduce the problem
Comment 4 Vitezslav Stejskal 2003-08-18 15:51:30 UTC
Created attachment 11347 [details]
ide.log file produced with -J-Dorg.apache.tools.ant.module=0
Comment 5 Vitezslav Stejskal 2003-08-18 15:53:19 UTC
The ide.log contains bunch of non-related exceptions fired during the
IDE shutdown, IMO you can safely ignore them.

I will check the trunk build whether it suffers from this problem too.
Comment 6 Jesse Glick 2003-08-18 16:36:18 UTC
Well I still cannot reproduce on my machine - Linux 2.4.18 with Java
1.4.2 (FCS). I checked out fresh ant sources from the prj branch, then
built NB (cd nbbuild; ant), then ran ant tryme (using new
testuserdir); created new build target on Output node, selected
/tmp/build.xml (the script you attached), confirmed 'all' as the
target for Build and Clean, right-clicked the new build target node in
the Projects tab, chose Build, and got as expected:

Building foo
Target foo.
all:
hello world

BUILD SUCCESSFUL

Total time: 0 seconds
Compilation finished. Errors: 0, warnings: 0.

My checkout of other projects-branch modules is not clean, though I
keep it fairly up to date; maybe that is related, I will try with a
fresh checkout of everything.

Anything else you can tell me to help you? Have some people in QA been
able to reproduce this too?
Comment 7 Marek Grummich 2003-08-18 16:57:43 UTC
Build 20030818000, j2sdk1.4.2-build28, Linux RedHat 9 (2.4.20-8)

Hi, I reproduced a described behaviour (bug).

I've got a following content of Output window:
Building SecondBuildTarget
Target SecondBuildTarget.
XML parser factory has not been configured correctly: Provider
org.apache.crimson.jaxp.SAXParserFactoryImpl not found
Compilation finished. Errors: 0, warnings: 0.

Comment 8 Vitezslav Stejskal 2003-08-18 17:20:44 UTC
Hmm, strange, the trunk build works fine on my machine. So, it seems
to be projects build specific. Can there be something broken in
build.xml/build.properties like some missing modules in the build
(e.g. lib/* modules)? I'll try to sync build.xml and build.properties
with trunk.
Comment 9 Jesse Glick 2003-08-18 17:27:09 UTC
I can reproduce it now, after updating my projects build sources
(clean checkout), so maybe it is related to some other module that has
changed recently... will try to look into it.
Comment 10 Jesse Glick 2003-08-18 18:08:07 UTC
Occurs only when web modules are enabled. I suspect web/jspparser:

[org.netbeans.core.modules #3] WARNING: Class-Path value
../../ant/lib/ant.jar from
/space/src/projects/nb_all/nbbuild/netbeans/modules/eager/jsp-parser.jar
is illegal according to the Java Extension Mechanism: must be relative
and not move up directories
Comment 11 Jesse Glick 2003-08-18 18:18:39 UTC
BridgeImpl is loaded from the "aux" class loader which inherits from
the NB system loader and thus it is accidentally referring to the copy
of Ant loaded in the jsp-parser module. This copy of Ant is broken
since it is trying to directly load Crimson, which it is not permitted
to. (Using JAXP normally works fine, but now the context class loader
is that of Ant - i.e. jsp-parser - which cannot access Crimson.)

Solution will probably be to use *three* loaders: "main" as now,
"bridge" delegating to main and adding bridge.jar and the Ant module,
"aux" delegating to bridge and adding the rest of ant/nblib/*.jar and
the NB system loader.

Anyway the web/jspparser module is strongly advised to cease using
this illegal Class-Path reference.
Comment 12 Jesse Glick 2003-08-18 18:32:46 UTC
Fixed in AuxClassLoader.java 1.2.10.2 by just delegating to ant.jar
before NB JARs. This is fine and correct for loading Ant classes and
the bridge; potentially problematic for custom task definitions, since
they would then see Ant's versions of random libraries in place of
NB's, if there is a difference.
Comment 13 Jan Becicka 2003-08-29 08:47:04 UTC
Verified
Comment 14 Jesse Glick 2003-11-14 11:56:18 UTC
*** Issue 37205 has been marked as a duplicate of this issue. ***
Comment 15 Jesse Glick 2003-11-14 12:03:20 UTC
Need merge of fix from prj40_prototype.
Comment 16 Jesse Glick 2003-11-14 12:18:42 UTC
Other changes were merged recently from prj40_prototype in web/*
modules, causing this bug to reappear in the trunk.

committed   * Up-To-Date  1.62        ant/manifest.mf
committed   * Up-To-Date  1.3        
ant/src/org/apache/tools/ant/module/bridge/AuxClassLoader.java
Comment 17 bhartsb 2003-11-14 17:04:10 UTC
This is all greek to me.  I am totally new to Netbeans, but 
encountered this problem (re: duplicate 27230), so what do I do to 
fix it???
Comment 18 Jesse Glick 2003-11-14 17:12:43 UTC
bhartsb - just wait for the next dev build, which should incorporate
this fix.
Comment 19 bhartsb 2003-11-14 17:18:51 UTC
When does this happen and what do I have to do to get it?
Comment 20 Jesse Glick 2003-11-14 17:33:47 UTC
bhartsb - dev builds are generally made daily and are available from
netbeans.org download. This bug only first appeared in a dev build so
if you didn't have one already, you should not have seen it. Issue
#27230 is also completely unrelated to this bug so I am not sure what
you are talking about.
Comment 21 bhartsb 2003-11-14 17:53:25 UTC
Correction 37230 which Marek Grummich marked as a duplicate of 37205 
which you marked as a duplicate of this.  

Per dev builds, as someone new to Netbeans, I don't have a frame of 
reference  or context to know what a dev build is per say.  

All I know is that my current version of Netbeans 3.5.1 was 
downloaded from Sun and was prepackaged with the J2SDK 1.4.2.  I 
needed this version to work with the JAXB stuff which I'm also 
completely new to.  I'm trying to compile the JAXB sample "create 
marshal".

So, what am I going to have to do to get the newest Dev build???

  (An aside, I'm really wanting to get past compile issues and get 
back to learning JAXB and XML Schema.  Its like I only wanted to do 
one little thing, read and write some objects from XML files, and one 
thing leads to another and another and another.)
Comment 22 Jesse Glick 2003-11-14 18:39:15 UTC
Issue #37230 is not related. You don't have a dev build, you have 3.5
(or 3.5.1), so you are not seeing this bug. Don't pay attention to it.
Comment 23 Marian Mirilovic 2005-07-15 07:49:53 UTC
closed