You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Vidar S. Ramdal (JIRA)" <ji...@apache.org> on 2009/11/11 11:10:39 UTC

[jira] Created: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Scripts loaded by Bundle Resource Provider are not found in script resolution
-----------------------------------------------------------------------------

                 Key: SLING-1181
                 URL: https://issues.apache.org/jira/browse/SLING-1181
             Project: Sling
          Issue Type: Bug
            Reporter: Vidar S. Ramdal
            Priority: Critical


When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.

I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.

To reproduce:
1. Run a fresh Sling build
2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
    "BundleResource script, <%=currentNode.path%>"
3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
   "WebDAV-uploaded script, <%=currentNode.path%>"
4. Create a node /test, with sling:resourceType=someResourceType
5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
8. Browse to http://localhost:8080/test.bundleresource

Expected result:
- The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"

Actual result:
- 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Vidar S. Ramdal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776410#action_12776410 ] 

Vidar S. Ramdal commented on SLING-1181:
----------------------------------------

OK, the first bad build I have contains revisions 833013 to 833280.

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Updated: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

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

Felix Meschberger updated SLING-1181:
-------------------------------------

          Component/s: JCR
    Affects Version/s: JCR Resource 2.0.8

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.8
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>             Fix For: JCR Resource 2.0.8
>
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Vidar S. Ramdal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776478#action_12776478 ] 

Vidar S. Ramdal commented on SLING-1181:
----------------------------------------

Re Ian's last comment: "I also get a 403 trying http://localhost:8080/testnode.webdav but not http://localhost:8080/testnode.json (in fact I get a 403 for anything ending in webdav) "

To clarify, the webdav.esp script is NOT included in the test bundle, so without manually creating and uploading the webdav.esp script you will allways get 403 for requests ending in .webdav.
Only bundleresource.esp is included in the bundle.

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776480#action_12776480 ] 

Ian Boston commented on SLING-1181:
-----------------------------------

x43543-2:tmp ieb$ curl http://localhost:8080/apps/someResourceType/bundleresource.esp
This is the node at <%=currentNode.path%>x43543-2:tmp ieb$ 
x43543-2:tmp ieb$ 


So yes a direct url to the resource resolves, but it does not appear on the list, indicating that registration is not complete.

}x43543-2:tmp ieb$ curl http://localhost:8080/apps.tidy.5.json
{
  "jcr:created": "Wed Nov 11 2009 14:00:23 GMT+0000",
  "jcr:primaryType": "sling:Folder",
  "sling": {
    "jcr:created": "Wed Nov 11 2009 14:00:23 GMT+0000",
    "jcr:primaryType": "sling:Folder",

............
    }
  },
  "someResourceType": {
  },
}


>From this it looks like the BundleResourceProvider is partially registered and has not registered the full path to the resource, or is not listing its children (the resolution of ServletResources relies on the listing of children at each layer)

This is confirmed by browsing with a webdav client that does not see someResourceType or bundleresource.esp

I think I have a better idea where the problem is now.



> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776598#action_12776598 ] 

Ian Boston commented on SLING-1181:
-----------------------------------

I believe I might have a fix, now getting the following, but need to do some more testing.

x43543-2:resource ieb$ curl http://localhost:8080/apps.tidy.5.json
{
  "jcr:created": "Wed Nov 11 2009 17:43:30 GMT+0000",
  "jcr:primaryType": "sling:Folder",
  "someResourceType": {
    "bundleresource.esp": {
    }
  },
  "sling": {
    "jcr:created": "Wed Nov 11 2009 17:43:30 GMT+0000",
    "jcr:primaryType": "sling:Folder",
    "servlet": {
      "jcr:created": "Wed Nov 11 2009 17:43:30 GMT+0000",
      "jcr:primaryType": "sling:Folder",
      "default": {




> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Assigned: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

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

Ian Boston reassigned SLING-1181:
---------------------------------

    Assignee: Ian Boston

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Updated: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

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

Vidar S. Ramdal updated SLING-1181:
-----------------------------------

    Attachment: SLING-1181-test-bundle-source-and-jar.zip

Uploaded testcase bundle for use in step #2

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Closed: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

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

Vidar S. Ramdal closed SLING-1181.
----------------------------------


The problem is solved, so closing this issue. Thanks!

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>             Fix For: JCR Resource 2.0.8
>
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776906#action_12776906 ] 

Ian Boston commented on SLING-1181:
-----------------------------------

Sorry, my fault, 835298 rebased my local git repo but stupidly omitted to dcommit back to svn.


> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>             Fix For: JCR Resource 2.0.8
>
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Vidar S. Ramdal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776676#action_12776676 ] 

Vidar S. Ramdal commented on SLING-1181:
----------------------------------------

Ian, are you sure this got committed? I'm still seeing the error, and r834886 seems to be from fmeschbe, and unrelated to this issue (see https://issues.apache.org/jira/browse/SLING-1183?focusedCommentId=12776460&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12776460)

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>             Fix For: JCR Resource 2.0.8
>
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Resolved: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

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

Ian Boston resolved SLING-1181.
-------------------------------

       Resolution: Fixed
    Fix Version/s: JCR Resource 2.0.8

Fixed in r834886

ResourceProviders that are registered in an existing tree of ResourceProviders are now capable of listing all the resources that they manage. Previously only leaf ResourceProviderEntries would list all their resources.


> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>             Fix For: JCR Resource 2.0.8
>
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Vidar S. Ramdal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776476#action_12776476 ] 

Vidar S. Ramdal commented on SLING-1181:
----------------------------------------

I get the same result as you do for http://localhost:8080/apps.tidy.5.json.
However, I do get the source code for the bundleresource.esp file at http://localhost:8080/apps/someResourceType/bundleresource.esp, indicating that the file is loaded in some way.
Can you reproduce that?

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776522#action_12776522 ] 

Ian Boston commented on SLING-1181:
-----------------------------------

When a ResourceProvider was added in the old system it would be consukted if the path started with the path where the resource provider was added. BundleResourceProviders are added with /apps meaning anything starting with /apps is given to that resource provider, as well as any others eg /apps/sling/default/servlet/GET

In the new system the assumption (incorrectly was made that we only consulted providers at the end of a path.

Hence is 1 provider P1 was added at /apps 
and another P2 added at /apps/sling
and we searched for a resource  at /apps/sling/testing only P2 would be consulted, but P1 handles /apps/sling/testing

We need to add all providers at 
/apps 
/apps/sling
/apps/sling/testing

eg P1 *and* P2 to get the completed list


Or at least I think thats whats happening since we are not getting the BundleResourceProvider consulted when listing children.

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776473#action_12776473 ] 

Ian Boston commented on SLING-1181:
-----------------------------------

When Install the bundle it does not install the file. (http://localhost:8080/apps.tidy.5.json does not show any trace of the Servlet)

When I upload the esp file using webdav, it is reported by the resolver, eg
curl -XMKCOL http://admin:admin@localhost:8080/apps/testtype
cat << EOF > sel.esp
This is the node at <%=currentNode.path%>
EOF
curl -F"sel.esp=@sel.esp;type=text/plain" http://admin:admin@localhost:8080/apps/testtype
curl http://localhost:8080/apps/testtype.tidy.2.json
curl -Fsling:resourceType=testtype http://admin:admin@localhost:8080/testnode
curl http://localhost:8080/testnode.json
curl http://localhost:8080/testnode.sel
curl http://localhost:8080/testnode.sel.html


The last 3 lines give 
</html>x43543-2:tmp ieb$ curl http://localhost:8080/testnode.json
{"sling:resourceType":"testtype","jcr:primaryType":"nt:unstructured"}x43543-2:tmp ieb$ 
x43543-2:tmp ieb$ curl http://localhost:8080/testnode.sel
This is the node at /testnode
x43543-2:tmp ieb$ curl http://localhost:8080/testnode.sel.html
This is the node at /testnode
x43543-2:tmp ieb$ 


So, AFAICT, the resolution of Servlets under apps is working correctly,

What does not appear to be working is the loading of content, so a

mvn clean install
mvn org.apache.sling:maven-sling-plugin:install

generates 

11.11.2009 14:50:06.319 *INFO* [FelixDispatchQueue] org.apache.sling.bundleresource.impl Service [Provider of bundle based resources,94] ServiceEvent UNREGISTERING
11.11.2009 14:50:06.321 *INFO* [FelixDispatchQueue] SlingBundleResourceTestBundle BundleEvent STOPPED
11.11.2009 14:50:06.321 *INFO* [FelixDispatchQueue] SlingBundleResourceTestBundle BundleEvent UNRESOLVED
11.11.2009 14:50:06.321 *INFO* [FelixDispatchQueue] SlingBundleResourceTestBundle BundleEvent UPDATED
11.11.2009 14:50:06.321 *INFO* [FelixDispatchQueue] org.apache.felix.framework FrameworkEvent PACKAGES REFRESHED
11.11.2009 14:50:06.321 *INFO* [FelixDispatchQueue] SlingBundleResourceTestBundle BundleEvent RESOLVED
11.11.2009 14:50:06.325 *INFO* [FelixDispatchQueue] org.apache.sling.bundleresource.impl Service [Provider of bundle based resources,95] ServiceEvent REGISTERED
11.11.2009 14:50:06.325 *INFO* [FelixDispatchQueue] SlingBundleResourceTestBundle BundleEvent STARTED
11.11.2009 14:50:08.326 *INFO* [FelixDispatchQueue] org.apache.sling.bundleresource.impl Service [Provider of bundle based resources,95] ServiceEvent UNREGISTERING
11.11.2009 14:50:08.326 *INFO* [FelixDispatchQueue] SlingBundleResourceTestBundle BundleEvent STOPPED
11.11.2009 14:50:08.326 *INFO* [FelixDispatchQueue] SlingBundleResourceTestBundle BundleEvent RESOLVED
11.11.2009 14:50:08.329 *INFO* [FelixDispatchQueue] org.apache.sling.bundleresource.impl Service [Provider of bundle based resources,96] ServiceEvent REGISTERED
11.11.2009 14:50:08.329 *INFO* [FelixDispatchQueue] SlingBundleResourceTestBundle BundleEvent STARTED
11.11.2009 14:50:08.330 *INFO* [FelixDispatchQueue] org.apache.felix.framework FrameworkEvent PACKAGES REFRESHED


Indicating that the bundle content didnt get installed.

I will investigate further.

> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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


[jira] Commented: (SLING-1181) Scripts loaded by Bundle Resource Provider are not found in script resolution

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776475#action_12776475 ] 

Ian Boston commented on SLING-1181:
-----------------------------------

At the moment, I cant reproduce the problem in the way its been reported, although I can reproduce a problem with the Test Bundle being supplied.


I also get a 403 trying http://localhost:8080/testnode.webdav but not http://localhost:8080/testnode.json (in fact I get a 403 for anything ending in webdav) 

x43543-2:tmp ieb$ curl http://admin:admin@localhost:8080/testnode.webdav
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<h1>Forbidden (403)</h1>
<p>The requested URL /testnode.webdav resulted in an error in org.apache.sling.servlets.get.DefaultGetServlet.</p>
<hr>
<address>ApacheSling/2.0 (Java HotSpot(TM) Client VM 1.5.0_20; Mac OS X 10.5.8 i386)</address>
</body>
</html>


x43543-2:tmp ieb$ curl http://admin:admin@localhost:8080/testnode.json
{"sling:resourceType":"testtype","jcr:primaryType":"nt:unstructured"}x43543-2:tmp ieb$ 
x43543-2:tmp ieb$ 




> Scripts loaded by Bundle Resource Provider are not found in script resolution
> -----------------------------------------------------------------------------
>
>                 Key: SLING-1181
>                 URL: https://issues.apache.org/jira/browse/SLING-1181
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Vidar S. Ramdal
>            Assignee: Ian Boston
>            Priority: Critical
>         Attachments: SLING-1181-test-bundle-source-and-jar.zip
>
>
> When a script file is loaded as a bundle resource (using Sling-Bundle-Resources directive), it is not picked up during script resolution.
> The bundle resource IS listed at /system/console/bundleresources, and the script source is available at its URL under /apps.
> I can reproduce this problem using the latest trunk build (rev #834413), but not in builds prior to rev#825679. I will try to narrow it down, to find the actual change causing this.
> To reproduce:
> 1. Run a fresh Sling build
> 2. Upload a bundle with a <Sling-Bundle-Resources>/apps</Sling-Bundle-Resources> directive, containing a file at /apps/someResourceType/bundleresource.esp. The script file could contain the code:
>     "BundleResource script, <%=currentNode.path%>"
> 3. Using WebDAV, create a script at /apps/someResourceType/webdav.esp. The script file could contain the code:
>    "WebDAV-uploaded script, <%=currentNode.path%>"
> 4. Create a node /test, with sling:resourceType=someResourceType
> 5. Browse to http://localhost:8080/apps/someResourceType/bundleresource.esp, and assert that the source code of the script file is displayed
> 6. Browse to http://localhost:8080/system/console/bundleresources, and assert that the /apps resource is listed
> 7. Browse to http://localhost:8080/test.webdav, and assert that the WebDAV-uploaded script is used to render the node (displaying "WebDAV-uploaded script, /test")
> 8. Browse to http://localhost:8080/test.bundleresource
> Expected result:
> - The bundleresource-provided script is used to render the node, displaying "BundleResource script, /test"
> Actual result:
> - 403 Forbidden

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