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 158934 - ".PatchedPublicProcessor not found" error when building standalone NBM project from IDE
Summary: ".PatchedPublicProcessor not found" error when building standalone NBM projec...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-21 16:55 UTC by rmichalsky
Modified: 2009-02-24 20:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Ant output from failed build from IDE (24.74 KB, text/plain)
2009-02-21 16:58 UTC, rmichalsky
Details
Ant output from successful build from command line (19.64 KB, text/plain)
2009-02-21 16:58 UTC, rmichalsky
Details
NBM project (5.89 KB, application/x-compressed)
2009-02-21 17:01 UTC, rmichalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rmichalsky 2009-02-21 16:55:39 UTC
When trying to build new standalone NBM project for the 1st time from IDE, error occurs:

error: Bad service configuration file, or exception thrown while constructing Processor object:
javax.annotation.processing.Processor: Provider org.netbeans.modules.openide.modules.PatchedPublicProcessor not found

Build from command line succeeds. NBM project uses cluster.path, but I've seen it before with 6.5 project as well.
Comment 1 rmichalsky 2009-02-21 16:58:14 UTC
Created attachment 77215 [details]
Ant output from failed build from IDE
Comment 2 rmichalsky 2009-02-21 16:58:51 UTC
Created attachment 77216 [details]
Ant output from successful build from command line
Comment 3 rmichalsky 2009-02-21 17:01:38 UTC
Created attachment 77217 [details]
NBM project
Comment 4 Jesse Glick 2009-02-21 19:12:46 UTC
It only happens when you run the IDE under JDK 5, and can be easily worked around by adding openide.modules to your
module's deps.

I could have sworn I fixed this exact same problem months ago. I will have to look up the fix and see why it is not working.
Comment 5 Jesse Glick 2009-02-21 21:02:24 UTC
Don't know, after hours of debugging I'm stumped. The sun.misc.Service loading is broken (finds processor definitions
but cannot load them). In the context of Service.LazyIterator.hasNext, loader.parent is an AntClassLoader, which extends
j.l.ClassLoader and overrides just findResources (not getResources), and the impl of CL.gR:

new sun.misc.CompoundEnumeration(new java.util.Enumeration[] {
    loader.parent.parent.getResources(prefix + service.getName()),
    loader.parent.findResources(prefix + service.getName())
}).hasMoreElements()

returns false, yet

loader.parent.getResources(prefix + service.getName()).hasMoreElements()

returns true (the elements are the definition of the PatchedPublicProcessor in org-openide-modules.jar, and
ServiceProviderProcesses in org-openide-util.jar). I cannot get the debugger the explain the discrepancy to me.

The faulty CompoundEnumeration's first element is another CE, as expected, yet this one's second element is that coming
from AppClassLoader - which ought not be consulted, since loader.parent.parent is a MainClassLoader (defined in the Ant
integration module) which as of #b67c171c7f6a sets its parent to be the JRE's ExtClassLoader, not AppClassLoader,
specifically to avoid this kind of problem. Of course if you ask for loader.parent.parent.gR directly, the result is fine.
Comment 6 Jesse Glick 2009-02-21 21:13:07 UTC
Ah, I see... AntClassLoader defines a 'parent' instance field unrelated to ClassLoader.parent.
Comment 7 Jesse Glick 2009-02-21 21:53:02 UTC
Finally found a bug in Ant: https://issues.apache.org/bugzilla/show_bug.cgi?id=46752

Working around: core-main #5e61e8466590
Comment 8 rmichalsky 2009-02-23 08:19:28 UTC
Thanks a lot. From some reason it appeared in almost all projects using cluster.path on my computer, that would be a
blocker.
Comment 9 Jesse Glick 2009-02-23 17:47:56 UTC
Probably because you were creating artificial modules that lacked (possibly transitive) dependencies on
openide.{util,modules}.
Comment 10 Quality Engineering 2009-02-24 20:09:41 UTC
Integrated into 'main-golden', will be available in build *200902241401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5e61e8466590
User: Jesse Glick <jglick@netbeans.org>
Log: #158934: an Ant bug causes 269 processing errors building a module with few deps from the IDE in JDK 5.