You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2013/04/09 21:18:15 UTC

[jira] [Commented] (SLING-2819) NPE in ResourceResolverImpl.mangleNamespaces when attempting to map http://example.com

    [ https://issues.apache.org/jira/browse/SLING-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13626973#comment-13626973 ] 

Carsten Ziegeler commented on SLING-2819:
-----------------------------------------

As the used url does not have a path, it's fine that in line 524 uri.getPath() returns null. Not 100% sure, but I guess we should just check this
                
> NPE in ResourceResolverImpl.mangleNamespaces when attempting to map http://example.com
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-2819
>                 URL: https://issues.apache.org/jira/browse/SLING-2819
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: Resource Resolver 1.0.4
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>
> The following JSP script (used as foo.jsp in the below example) throws an NPE with the current launchpad/builder which uses org.apache.sling.resourceresolver 1.0.5.SNAPSHOT:
> <%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0"%>
> <sling:defineObjects/>
> <%= resource.getResourceResolver().map(request, "http://example.com") %>
> Full failure scenario:
> export P=8080
> curl -u admin:admin -Fsling:resourceType=foo http://localhost:$P/tmp/foo
> curl -u admin:admin -XMKCOL http://localhost:$P/apps/foo
> curl -u admin:admin -T foo.jsp http://localhost:$P/apps/foo/foo.jsp
> curl -u admin:admin http://localhost:$P/tmp/foo.html
> The last request causes java.lang.NullPointerException
> 	at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.mangleNamespaces(ResourceResolverImpl.java:969)
> 	at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.map(ResourceResolverImpl.java:524)
> 	at org.apache.jsp.apps.foo.foo_jsp._jspService(foo_jsp.java:90)
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira