You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Eric Norman (JIRA)" <ji...@apache.org> on 2010/09/07 00:11:32 UTC

[jira] Created: (SLING-1733) BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path

BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path
--------------------------------------------------------------------------------------------------------------

                 Key: SLING-1733
                 URL: https://issues.apache.org/jira/browse/SLING-1733
             Project: Sling
          Issue Type: Bug
          Components: Extensions
    Affects Versions: Extensions Bundleresource 2.0.4
            Reporter: Eric Norman
            Assignee: Eric Norman
             Fix For: Extensions Bundleresource 2.0.6


If multiple bundles are providing Sling-Bundle-Resources with the same path, the resources from the second bundle are not accessible. 
.
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. 


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1733) BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906708#action_12906708 ] 

Felix Meschberger commented on SLING-1733:
------------------------------------------

Patch looks good for me with one comment for simplification: Instead of getting the bundleId to compare, you can simply compare the bundle cache objects to only use the parent bundle resource iff they are managed by the same BundleCache instance.

      	if (((BundleResource)parent).getBundle() == this.bundle) {
               return ((BundleResource) parent).listChildren();
       	}

> BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1733
>                 URL: https://issues.apache.org/jira/browse/SLING-1733
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Bundleresource 2.0.4
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>             Fix For: Extensions Bundleresource 2.0.6
>
>         Attachments: SLING-1733.patch
>
>
> If multiple bundles are providing Sling-Bundle-Resources with the same path, the resources from the second bundle are not accessible. 
> .
> 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. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-1733) BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Norman updated SLING-1733:
-------------------------------

    Attachment: SLING-1733.patch

SLING-1733.patch is a proposed patch for review.

> BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1733
>                 URL: https://issues.apache.org/jira/browse/SLING-1733
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Bundleresource 2.0.4
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>             Fix For: Extensions Bundleresource 2.0.6
>
>         Attachments: SLING-1733.patch
>
>
> If multiple bundles are providing Sling-Bundle-Resources with the same path, the resources from the second bundle are not accessible. 
> .
> 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. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1733) BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906608#action_12906608 ] 

Eric Norman commented on SLING-1733:
------------------------------------

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.

The attached patch fixes it for me. 

> BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1733
>                 URL: https://issues.apache.org/jira/browse/SLING-1733
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Bundleresource 2.0.4
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>             Fix For: Extensions Bundleresource 2.0.6
>
>         Attachments: SLING-1733.patch
>
>
> If multiple bundles are providing Sling-Bundle-Resources with the same path, the resources from the second bundle are not accessible. 
> .
> 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. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (SLING-1733) BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Norman reopened SLING-1733:
--------------------------------


re-opening to fix a ClassCastException

> BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1733
>                 URL: https://issues.apache.org/jira/browse/SLING-1733
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Bundleresource 2.0.4
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>             Fix For: Extensions Bundleresource 2.0.6
>
>         Attachments: SLING-1733.patch
>
>
> If multiple bundles are providing Sling-Bundle-Resources with the same path, the resources from the second bundle are not accessible. 
> .
> 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. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1733) BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path

Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906930#action_12906930 ] 

Justin Edelson commented on SLING-1733:
---------------------------------------

this needs a test added to BundleContentTest. Should just be a matter of adding bundle resources to test-services-war

> BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1733
>                 URL: https://issues.apache.org/jira/browse/SLING-1733
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Bundleresource 2.0.4
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>             Fix For: Extensions Bundleresource 2.0.6
>
>         Attachments: SLING-1733.patch
>
>
> If multiple bundles are providing Sling-Bundle-Resources with the same path, the resources from the second bundle are not accessible. 
> .
> 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. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-1733) BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Norman resolved SLING-1733.
--------------------------------

    Resolution: Fixed

fixed in r995316

> BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1733
>                 URL: https://issues.apache.org/jira/browse/SLING-1733
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Bundleresource 2.0.4
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>             Fix For: Extensions Bundleresource 2.0.6
>
>         Attachments: SLING-1733.patch
>
>
> If multiple bundles are providing Sling-Bundle-Resources with the same path, the resources from the second bundle are not accessible. 
> .
> 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. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-1733) BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Norman resolved SLING-1733.
--------------------------------

    Resolution: Fixed

fixed in r993606.

> BundleResourceProvider fails to find resources when multiple bundles have the same Sling-Bundle-Resources path
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1733
>                 URL: https://issues.apache.org/jira/browse/SLING-1733
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Bundleresource 2.0.4
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>             Fix For: Extensions Bundleresource 2.0.6
>
>         Attachments: SLING-1733.patch
>
>
> If multiple bundles are providing Sling-Bundle-Resources with the same path, the resources from the second bundle are not accessible. 
> .
> 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. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.