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.
LayIndex can find the layer file included in another jar After I modified the wrapper module visualweb/woodstock/components to point to a layer from the jar (webui-jsf-dt.jar) it's wrapping, the LayerIndex task failed on find the layer file with NPE. See the attached file for the full console out of build #3944.
Created attachment 50925 [details] Console output from Build 3944 on Hudson
Currently, layer entry has been removed from the wrapper module visualweb/woodstock/components in order to pass the build. But this breaks the palette in Visual Web project - there is no woodstock components shown in the palette.
Updating Summary field and re-assigning to Jesse. Maybe Summary field value "LayerIndex cannot find layer file referenced from another jar" may sound more appropriate. I would say (without seeing any stack trace) it is failing on line 122. If this issue would be accepted as a defect, the solution may require change of single pass through nested for-loops on lines 101-130 into two passes mode (just my $0.02).
The layer should be kept in the same JAR as the manifest entry referring to it. Please fix your module build accordingly.
Can you explain why please ? We have a use case for it because woodstock components are binary integrated into visual web. It makes sense for the layer file and palette resources to live as part of woodstock repository. Also its seems to be supported in the IDE and everything works fine at design time and run time. This problem manifests only on hudson. any other ideas to fix this issue are welcome. Thanks
This could be easily fixed in: nbbuild/antsrc/org/netbeans/nbbuild/LayerIndex.java by looking for the layer files in the jars referred to in the module jar's Manifest file's Class-Path attribute.
I would rather maintain the existing requirement that all layers are in the module JARs. There may be other things broken otherwise. As Tor suggested already: if you receive a binary JAR with a layer included, your module's build script should remove the layer from that JAR and include it in your module's JAR. This is quite straightforward with Ant.
BTW: if you have a long list of palette entries coming from some external source, maintaining a layer.xml by hand is probably not the best idea anyway. Consider using the API introduced in issue #26338 to load such entries dynamically from some more easily maintained index.