[JBoss JIRA] (GTNPORTAL-2790) Potential NPE with Tomcat 7 in developing mode
by Trong Tran (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-2790?page=com.atlassian.jira.pl... ]
Trong Tran updated GTNPORTAL-2790:
----------------------------------
Description:
In tomcat 7, the wars does not locate at "appBase" which is not unpacked.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51294
But in ServletResourceResolver.isModified, we used ServletContext.getRealPath to get absolute path's file resource which will return NULL. Due to the WAR was not upacked.
We should use URLConnection.getLastModified instead of use getRealPath and File api
Step to reproduce:
- Set upackWARs="false" in Host in conf/server.xml
- Start bin/gatein-dev.sh run
And go to home page, the NPE occurs:
java.lang.NullPointerException
at java.io.File.<init>(File.java:222)
at org.exoplatform.resolver.ServletResourceResolver.isModified(ServletResourceResolver.java:77)
at org.exoplatform.webui.core.lifecycle.Lifecycle.renderTemplate(Lifecycle.java:106)
at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processRender(UIPortalApplicationLifecycle.java:124)
...............
was:
In tomcat 7, the wars does not locate at "appBase" which is not unpacked.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51294
But in ServletResourceResolver.isModified, we used ServletContext.getRealPath to get absolute path's file resource which will return NULL. Due to the WAR was not upacked.
We should use URLConnection.getLastModified instead of use getRealPath and File api
Step to reproduce:
- Replace upackWARs="false" in Host in conf/server.xml
- Start bin/gatein-dev.sh run
And go to home page, the NPE occurs:
java.lang.NullPointerException
at java.io.File.<init>(File.java:222)
at org.exoplatform.resolver.ServletResourceResolver.isModified(ServletResourceResolver.java:77)
at org.exoplatform.webui.core.lifecycle.Lifecycle.renderTemplate(Lifecycle.java:106)
at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processRender(UIPortalApplicationLifecycle.java:124)
...............
> Potential NPE with Tomcat 7 in developing mode
> ----------------------------------------------
>
> Key: GTNPORTAL-2790
> URL: https://issues.jboss.org/browse/GTNPORTAL-2790
> Project: GateIn Portal
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 3.5.0.Final
> Reporter: Hai Nguyen
> Assignee: Hai Nguyen
> Attachments: portal.xml
>
>
> In tomcat 7, the wars does not locate at "appBase" which is not unpacked.
> https://issues.apache.org/bugzilla/show_bug.cgi?id=51294
> But in ServletResourceResolver.isModified, we used ServletContext.getRealPath to get absolute path's file resource which will return NULL. Due to the WAR was not upacked.
> We should use URLConnection.getLastModified instead of use getRealPath and File api
> Step to reproduce:
> - Set upackWARs="false" in Host in conf/server.xml
> - Start bin/gatein-dev.sh run
> And go to home page, the NPE occurs:
> java.lang.NullPointerException
> at java.io.File.<init>(File.java:222)
> at org.exoplatform.resolver.ServletResourceResolver.isModified(ServletResourceResolver.java:77)
> at org.exoplatform.webui.core.lifecycle.Lifecycle.renderTemplate(Lifecycle.java:106)
> at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processRender(UIPortalApplicationLifecycle.java:124)
> ...............
--
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
12 years, 10 months
[JBoss JIRA] (GTNPORTAL-2790) Potential NPE with Tomcat 7 in developing mode
by Hai Nguyen (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-2790?page=com.atlassian.jira.pl... ]
Hai Nguyen updated GTNPORTAL-2790:
----------------------------------
Description:
In tomcat 7, the wars does not locate at "appBase" which is not unpacked.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51294
But in ServletResourceResolver.isModified, we used ServletContext.getRealPath to get absolute path's file resource which will return NULL. Due to the WAR was not upacked.
We should use URLConnection.getLastModified instead of use getRealPath and File api
Step to reproduce:
- Replace upackWARs="false" in Host in conf/server.xml
- Start bin/gatein-dev.sh run
And go to home page, the NPE occurs:
java.lang.NullPointerException
at java.io.File.<init>(File.java:222)
at org.exoplatform.resolver.ServletResourceResolver.isModified(ServletResourceResolver.java:77)
at org.exoplatform.webui.core.lifecycle.Lifecycle.renderTemplate(Lifecycle.java:106)
at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processRender(UIPortalApplicationLifecycle.java:124)
...............
was:
In tomcat 7, the wars does not locate at "appBase" which is not unpacked.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51294
But in ServletResourceResolver.isModified, we used ServletContext.getRealPath to get absolute path's file resource which will return NULL. Due to the WAR was not upacked.
We should use URLConnection.getLastModified instead of use getRealPath and File api
Step to reproduce:
- Move webapps/portal.war to wars/portal.war
- Replace docBase to '${catalina.home}/wars/portal.war' in conf/Catalina/localhost/portal.xml
- Start bin/gatein-dev.sh run
And go to home page, the NPE occurs:
java.lang.NullPointerException
at java.io.File.<init>(File.java:222)
at org.exoplatform.resolver.ServletResourceResolver.isModified(ServletResourceResolver.java:77)
at org.exoplatform.webui.core.lifecycle.Lifecycle.renderTemplate(Lifecycle.java:106)
at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processRender(UIPortalApplicationLifecycle.java:124)
...............
> Potential NPE with Tomcat 7 in developing mode
> ----------------------------------------------
>
> Key: GTNPORTAL-2790
> URL: https://issues.jboss.org/browse/GTNPORTAL-2790
> Project: GateIn Portal
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 3.5.0.Final
> Reporter: Hai Nguyen
> Assignee: Hai Nguyen
> Attachments: portal.xml
>
>
> In tomcat 7, the wars does not locate at "appBase" which is not unpacked.
> https://issues.apache.org/bugzilla/show_bug.cgi?id=51294
> But in ServletResourceResolver.isModified, we used ServletContext.getRealPath to get absolute path's file resource which will return NULL. Due to the WAR was not upacked.
> We should use URLConnection.getLastModified instead of use getRealPath and File api
> Step to reproduce:
> - Replace upackWARs="false" in Host in conf/server.xml
> - Start bin/gatein-dev.sh run
> And go to home page, the NPE occurs:
> java.lang.NullPointerException
> at java.io.File.<init>(File.java:222)
> at org.exoplatform.resolver.ServletResourceResolver.isModified(ServletResourceResolver.java:77)
> at org.exoplatform.webui.core.lifecycle.Lifecycle.renderTemplate(Lifecycle.java:106)
> at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processRender(UIPortalApplicationLifecycle.java:124)
> ...............
--
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
12 years, 10 months