You are viewing a plain text version of this content. The canonical link for it is here.
Posted to portalapps-dev@portals.apache.org by "David Graff (JIRA)" <ji...@apache.org> on 2012/05/17 15:13:09 UTC

[jira] [Created] (APA-48) WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat

David Graff created APA-48:
------------------------------

             Summary: WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat
                 Key: APA-48
                 URL: https://issues.apache.org/jira/browse/APA-48
             Project: Portals Apps
          Issue Type: Bug
          Components: apa-webcontent
    Affects Versions: apa-webcontent-1.2
            Reporter: David Graff
            Assignee: David Sean Taylor
            Priority: Blocker
             Fix For: apa-webcontent-1.3


While testing an application configuration when packaged as a non-expanded WAR file the DefaultHttpReverseProxyServlet dies with a NullPointerException when calling WebResourceUtils.getResourcesAsFiles(String, ClassLoader, Object).

The reason for this is that when packaged in a WAR file and not expanded, Tomcat provides a WARDirContext which returns null when requesting "getRealPath"

Would it be possible to change this around such that the code is not dealing with files specifically and dealing with them as references & streams?

This configuration issue is a blocker for my current product.

If possible could the ServletContext.getResource/getResourceAsStream be used to determine the resource location and load it that way when "/WEB-INF/" is the start of the path?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (APA-48) WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat

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

Woonsan Ko reassigned APA-48:
-----------------------------

    Assignee: Woonsan Ko  (was: David Sean Taylor)
    
> WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat
> --------------------------------------------------------------------------------------------------
>
>                 Key: APA-48
>                 URL: https://issues.apache.org/jira/browse/APA-48
>             Project: Portals Apps
>          Issue Type: Bug
>          Components: apa-webcontent
>    Affects Versions: apa-webcontent-1.2
>            Reporter: David Graff
>            Assignee: Woonsan Ko
>            Priority: Blocker
>             Fix For: apa-webcontent-1.3
>
>
> While testing an application configuration when packaged as a non-expanded WAR file the DefaultHttpReverseProxyServlet dies with a NullPointerException when calling WebResourceUtils.getResourcesAsFiles(String, ClassLoader, Object).
> The reason for this is that when packaged in a WAR file and not expanded, Tomcat provides a WARDirContext which returns null when requesting "getRealPath"
> Would it be possible to change this around such that the code is not dealing with files specifically and dealing with them as references & streams?
> This configuration issue is a blocker for my current product.
> If possible could the ServletContext.getResource/getResourceAsStream be used to determine the resource location and load it that way when "/WEB-INF/" is the start of the path?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (APA-48) WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat

Posted by "Woonsan Ko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APA-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13279045#comment-13279045 ] 

Woonsan Ko commented on APA-48:
-------------------------------

Hi David,

I've just committed the expected change in r1340195.
If it is really urgent, I'd rather check out the trunk to build a snapshot version as follows. Maybe you can test it with this snapshot dependency in your project.

  $ svn checkout https://svn.apache.org/repos/asf/portals/applications/webcontent/trunk webcontent
  $ cd webcontent
  $ mvn install

By the way, the ReverseProxyServlet cannot use glob style configurations any more in non-expanded war deployment.* So, you will need to change the 'reverseproxy.configuration' init param not to use glob pattern; instead you need to use only one static resource path. e.g., /WEB-INF/conf/reverseproxy.properties

Regards,

Woonsan

* This is a limitation now which we need to improve in the end.
                
> WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat
> --------------------------------------------------------------------------------------------------
>
>                 Key: APA-48
>                 URL: https://issues.apache.org/jira/browse/APA-48
>             Project: Portals Apps
>          Issue Type: Bug
>          Components: apa-webcontent
>    Affects Versions: apa-webcontent-1.2
>            Reporter: David Graff
>            Assignee: David Sean Taylor
>            Priority: Blocker
>             Fix For: apa-webcontent-1.3
>
>
> While testing an application configuration when packaged as a non-expanded WAR file the DefaultHttpReverseProxyServlet dies with a NullPointerException when calling WebResourceUtils.getResourcesAsFiles(String, ClassLoader, Object).
> The reason for this is that when packaged in a WAR file and not expanded, Tomcat provides a WARDirContext which returns null when requesting "getRealPath"
> Would it be possible to change this around such that the code is not dealing with files specifically and dealing with them as references & streams?
> This configuration issue is a blocker for my current product.
> If possible could the ServletContext.getResource/getResourceAsStream be used to determine the resource location and load it that way when "/WEB-INF/" is the start of the path?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (APA-48) WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat

Posted by "David Graff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APA-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13283669#comment-13283669 ] 

David Graff commented on APA-48:
--------------------------------

Woonsan, Sorry I have not had a chance to try this as yet. I was busy on another project and a handful of other things.  When I return to work on Tuesday I will attempt to try this version out.

Thank you again for the quick turn around on this.
                
> WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat
> --------------------------------------------------------------------------------------------------
>
>                 Key: APA-48
>                 URL: https://issues.apache.org/jira/browse/APA-48
>             Project: Portals Apps
>          Issue Type: Bug
>          Components: apa-webcontent
>    Affects Versions: apa-webcontent-1.2
>            Reporter: David Graff
>            Assignee: Woonsan Ko
>            Priority: Blocker
>             Fix For: apa-webcontent-1.3
>
>
> While testing an application configuration when packaged as a non-expanded WAR file the DefaultHttpReverseProxyServlet dies with a NullPointerException when calling WebResourceUtils.getResourcesAsFiles(String, ClassLoader, Object).
> The reason for this is that when packaged in a WAR file and not expanded, Tomcat provides a WARDirContext which returns null when requesting "getRealPath"
> Would it be possible to change this around such that the code is not dealing with files specifically and dealing with them as references & streams?
> This configuration issue is a blocker for my current product.
> If possible could the ServletContext.getResource/getResourceAsStream be used to determine the resource location and load it that way when "/WEB-INF/" is the start of the path?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (APA-48) WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat

Posted by "Woonsan Ko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APA-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278872#comment-13278872 ] 

Woonsan Ko commented on APA-48:
-------------------------------

Thanks for reporting this!
Actually I already considered the case of non-expanded war file, but I think I missed one thing. WebResourceUtils#getResourceAsFile() can return null in that case, so, #getResourcesAsFiles() should have considered that by returning null, too.
It's already checking null and read stream in that case.
So, I think it should be good enough by checking null in #getResourceAsFile() method.
                
> WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat
> --------------------------------------------------------------------------------------------------
>
>                 Key: APA-48
>                 URL: https://issues.apache.org/jira/browse/APA-48
>             Project: Portals Apps
>          Issue Type: Bug
>          Components: apa-webcontent
>    Affects Versions: apa-webcontent-1.2
>            Reporter: David Graff
>            Assignee: David Sean Taylor
>            Priority: Blocker
>             Fix For: apa-webcontent-1.3
>
>
> While testing an application configuration when packaged as a non-expanded WAR file the DefaultHttpReverseProxyServlet dies with a NullPointerException when calling WebResourceUtils.getResourcesAsFiles(String, ClassLoader, Object).
> The reason for this is that when packaged in a WAR file and not expanded, Tomcat provides a WARDirContext which returns null when requesting "getRealPath"
> Would it be possible to change this around such that the code is not dealing with files specifically and dealing with them as references & streams?
> This configuration issue is a blocker for my current product.
> If possible could the ServletContext.getResource/getResourceAsStream be used to determine the resource location and load it that way when "/WEB-INF/" is the start of the path?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (APA-48) WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat

Posted by "Woonsan Ko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APA-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13283518#comment-13283518 ] 

Woonsan Ko commented on APA-48:
-------------------------------

Hi David,

Did you have a chance to try my suggestion?

Regards, 
Woonsan
                
> WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat
> --------------------------------------------------------------------------------------------------
>
>                 Key: APA-48
>                 URL: https://issues.apache.org/jira/browse/APA-48
>             Project: Portals Apps
>          Issue Type: Bug
>          Components: apa-webcontent
>    Affects Versions: apa-webcontent-1.2
>            Reporter: David Graff
>            Assignee: Woonsan Ko
>            Priority: Blocker
>             Fix For: apa-webcontent-1.3
>
>
> While testing an application configuration when packaged as a non-expanded WAR file the DefaultHttpReverseProxyServlet dies with a NullPointerException when calling WebResourceUtils.getResourcesAsFiles(String, ClassLoader, Object).
> The reason for this is that when packaged in a WAR file and not expanded, Tomcat provides a WARDirContext which returns null when requesting "getRealPath"
> Would it be possible to change this around such that the code is not dealing with files specifically and dealing with them as references & streams?
> This configuration issue is a blocker for my current product.
> If possible could the ServletContext.getResource/getResourceAsStream be used to determine the resource location and load it that way when "/WEB-INF/" is the start of the path?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (APA-48) WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat

Posted by "David Graff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APA-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278978#comment-13278978 ] 

David Graff commented on APA-48:
--------------------------------

Any idea on how fast we can get this fixed/released?
                
> WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat
> --------------------------------------------------------------------------------------------------
>
>                 Key: APA-48
>                 URL: https://issues.apache.org/jira/browse/APA-48
>             Project: Portals Apps
>          Issue Type: Bug
>          Components: apa-webcontent
>    Affects Versions: apa-webcontent-1.2
>            Reporter: David Graff
>            Assignee: David Sean Taylor
>            Priority: Blocker
>             Fix For: apa-webcontent-1.3
>
>
> While testing an application configuration when packaged as a non-expanded WAR file the DefaultHttpReverseProxyServlet dies with a NullPointerException when calling WebResourceUtils.getResourcesAsFiles(String, ClassLoader, Object).
> The reason for this is that when packaged in a WAR file and not expanded, Tomcat provides a WARDirContext which returns null when requesting "getRealPath"
> Would it be possible to change this around such that the code is not dealing with files specifically and dealing with them as references & streams?
> This configuration issue is a blocker for my current product.
> If possible could the ServletContext.getResource/getResourceAsStream be used to determine the resource location and load it that way when "/WEB-INF/" is the start of the path?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (APA-48) WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat

Posted by "David Graff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APA-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13284781#comment-13284781 ] 

David Graff commented on APA-48:
--------------------------------

Woonsan, Thank you again for committing this change.

We only have a single proxy configuration we're dealing with so the caveat you mentioned is acceptable.

I have reviewed the code and it works as expected!

Thanks
                
> WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat
> --------------------------------------------------------------------------------------------------
>
>                 Key: APA-48
>                 URL: https://issues.apache.org/jira/browse/APA-48
>             Project: Portals Apps
>          Issue Type: Bug
>          Components: apa-webcontent
>    Affects Versions: apa-webcontent-1.2
>            Reporter: David Graff
>            Assignee: Woonsan Ko
>            Priority: Blocker
>             Fix For: apa-webcontent-1.3
>
>
> While testing an application configuration when packaged as a non-expanded WAR file the DefaultHttpReverseProxyServlet dies with a NullPointerException when calling WebResourceUtils.getResourcesAsFiles(String, ClassLoader, Object).
> The reason for this is that when packaged in a WAR file and not expanded, Tomcat provides a WARDirContext which returns null when requesting "getRealPath"
> Would it be possible to change this around such that the code is not dealing with files specifically and dealing with them as references & streams?
> This configuration issue is a blocker for my current product.
> If possible could the ServletContext.getResource/getResourceAsStream be used to determine the resource location and load it that way when "/WEB-INF/" is the start of the path?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (APA-48) WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat

Posted by "Woonsan Ko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APA-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13284978#comment-13284978 ] 

Woonsan Ko commented on APA-48:
-------------------------------

Thanks for the feedback, David!
I'll keep this issue open until I fix this more properly with supporting multiple configuration paths pattern as spring framework does.

Cheers,

Woonsan
                
> WebResourceUtils bombs with NPX if application is packaged as a non-expanded WAR file under Tomcat
> --------------------------------------------------------------------------------------------------
>
>                 Key: APA-48
>                 URL: https://issues.apache.org/jira/browse/APA-48
>             Project: Portals Apps
>          Issue Type: Bug
>          Components: apa-webcontent
>    Affects Versions: apa-webcontent-1.2
>            Reporter: David Graff
>            Assignee: Woonsan Ko
>            Priority: Blocker
>             Fix For: apa-webcontent-1.3
>
>
> While testing an application configuration when packaged as a non-expanded WAR file the DefaultHttpReverseProxyServlet dies with a NullPointerException when calling WebResourceUtils.getResourcesAsFiles(String, ClassLoader, Object).
> The reason for this is that when packaged in a WAR file and not expanded, Tomcat provides a WARDirContext which returns null when requesting "getRealPath"
> Would it be possible to change this around such that the code is not dealing with files specifically and dealing with them as references & streams?
> This configuration issue is a blocker for my current product.
> If possible could the ServletContext.getResource/getResourceAsStream be used to determine the resource location and load it that way when "/WEB-INF/" is the start of the path?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira