Ok. I spent some time debugging this and the problem was happening because the BundleResourceProvider.listChildren(parent) method was trying to get the list of children directly from the parent resource when the parent was a BundleResource. However, in this case, the parent resource was loaded from a different bundle than the bundle the provider was operating on.
I added a check to make sure the parent resource is in the same bundle as what the provider is working with before using the parentResource.listChildren() shortcut. I filed SLING-1733 for tracking the problem and attached a proposed patch for review. Please let me know if you see anything wrong with the patch. If there are no objections, I will apply the patch in the next few days. Regards, Eric On Mon, Sep 6, 2010 at 11:56 AM, Felix Meschberger <fmesc...@gmail.com>wrote: > Hi, > > I would say, your use case is perfectly valid and really should work. > > If not, we would have to analyze where in the listChildren > implementation the problem lies. > > At least we would have to have an issue to track this. > > Regards > Felix > > On 06.09.2010 19:48, Eric Norman wrote: > > Hi All, > > > > This seems kind of similar to* > > SLING-1672<https://issues.apache.org/jira/browse/SLING-1672> > > * which has been marked as resolved. However, with the latest trunk > code, I > > am still running into some difficulties when multiple bundles are > providing > > Sling-Bundle-Resources with the same path. I would assume that the > children > > of all the providers at the same path should be merged together? > Currently, > > it seems that the first parent resource found wins, and listing the > children > > only return the scripts in that bundle. The scripts provided by the > other > > bundles are not visible. Obviously, this makes it difficult to have > modular > > bundles if all the scripts need to be inside the same bundle to be found. > > . > > For example: > > > > Bundle 1 contains these scripts: > > /libs/sling/servlet/default/script1.html.esp > > /libs/sling/servlet/default/script2.html.esp > > > > And the resource is provided as: > > <Sling-Bundle-Resources> > > /libs/sling/servlet/default > > </Sling-Bundle-Resources> > > > > Bundle 2 contains these scripts: > > /libs/sling/servlet/default/script2.html.esp > > /libs/sling/servlet/default/script3.html.esp > > > > And the resource is provided as: > > <Sling-Bundle-Resources> > > /libs/sling/servlet/default > > </Sling-Bundle-Resources> > > > > > > With both bundles installed, you either see the scripts from bundle1 or > the > > scripts from bundle2 but not both. > > > > Thoughts? > > > > Regards, > > Eric > > >