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 179510 - Avoid service loading while parsing libraries
Summary: Avoid service loading while parsing libraries
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF Editor (show other bugs)
Version: 6.x
Hardware: PC All
: P3 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
: 179536 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-01-14 09:09 UTC by Petr Hejl
Modified: 2010-01-24 08:39 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch (1.84 KB, patch)
2010-01-14 09:09 UTC, Petr Hejl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2010-01-14 09:09:17 UTC
Created attachment 93292 [details]
patch

There is issue with parsing facelets libraries - the parsing code (com.sun.faces.*) may request some services and this can lead to attempt to load jars which are not on classpath causing CNFE.

I think the patch is self-explaining.
Comment 1 Marek Fukala 2010-01-14 09:44:11 UTC
What is the exact case when the problem occures?
Comment 2 Petr Hejl 2010-01-14 12:26:18 UTC
I've just updated the workspace and the issue is gone.

Exact case was:
1) server plugin (WebLogic) provides Java EE API classes (jars)
2) one of the jars provides DocumentBuilderFactory (registered via META-INF/services), however this implementation depends on other jars which are not part of the API and we don't want these on project CP
3) DbfFactory.getFactory in ConfigManager.ParseTask needs DocumentBuilderFactory and unfortunately the server one is going to be instantiated
4) boom - CNFE because such DocumentBuilderFactory needs much more files on CP that the APIs

Perhaps it was "fixed" by another DocumentBuilderFactory instantiated in step 3.

I'll post stacktrace if it will happen again (was 100% reproducible before update).
Comment 3 Marek Fukala 2010-01-15 10:07:25 UTC
*** Bug 179536 has been marked as a duplicate of this bug. ***
Comment 4 Marek Fukala 2010-01-19 08:17:05 UTC
I have applied the fix as an attempt to fix ClassCastExceptions from the mojarra itself which likely have the same cause - classes loaded by two independent classloaders.

web-main#38e8d11b972f
Comment 5 Marek Fukala 2010-01-20 03:23:37 UTC
The fix has been transplanted to the release68_fixes branch as a fix of issue #178231 which was marked as 68patch_candidate.

release68_fixes#4bd0c321efe3

I am sorry for the cofusion I caused to you Petre.
Comment 6 Quality Engineering 2010-01-24 08:39:50 UTC
Integrated into 'main-golden', will be available in build *201001240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/38e8d11b972f
User: Marek Fukala <mfukala@netbeans.org>
Log: #179510 -  Avoid service loading while parsing libraries