Struts Tiles Freemarker InvalidReferenceException pointing to Struts2 error.ftl as cause
up vote
0
down vote
favorite
I'm implementing a new Struts 2 action and now I'm getting the following exception:
Error executing FreeMarker template: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> rootloc.URI [in template "org/apache/struts2/dispatcher/error.ftl" at line 86, column 15]
Struts Tiles tries to show our custom error page but during that process encounters above exception. It somehow can't set a property within the error.ftl which is delivered by the Struts framework itself. Hence the error page is not shown.
I have checked the error.ftl and the problem seems to occur somewhere around here (reference: https://github.com/apache/struts/blob/master/core/src/main/resources/org/apache/struts2/dispatcher/error.ftl):
<tr>
<td><strong>File</strong>:</td>
<td>${rootloc.URI}</td>
</tr>
Did anyone encounter this or a similar problem? I have no idea how to fix this because the error occurs within a Struts 2 component and I have no chance of debugging. I'm using Struts Version 2.3.36.
Thanks in advance!
java exception struts2 freemarker
add a comment |
up vote
0
down vote
favorite
I'm implementing a new Struts 2 action and now I'm getting the following exception:
Error executing FreeMarker template: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> rootloc.URI [in template "org/apache/struts2/dispatcher/error.ftl" at line 86, column 15]
Struts Tiles tries to show our custom error page but during that process encounters above exception. It somehow can't set a property within the error.ftl which is delivered by the Struts framework itself. Hence the error page is not shown.
I have checked the error.ftl and the problem seems to occur somewhere around here (reference: https://github.com/apache/struts/blob/master/core/src/main/resources/org/apache/struts2/dispatcher/error.ftl):
<tr>
<td><strong>File</strong>:</td>
<td>${rootloc.URI}</td>
</tr>
Did anyone encounter this or a similar problem? I have no idea how to fix this because the error occurs within a Struts 2 component and I have no chance of debugging. I'm using Struts Version 2.3.36.
Thanks in advance!
java exception struts2 freemarker
Debugging your code is very similar to debugging 3rd party code. Anyway, from the source code what seems to happen is that the template wants to print the file name for the exception. ButLocationUtils.getLocale(exception)returns acom.opensymphony.xwork2.util.location.LocationwheregetURI()returnsnull. I guess the template should expect that, as the LocationAPIallows that. But it doesn't, so it fails at thatnull. If you can modify the template it's easy to fix. Otherwise it's a good starting point for a bug report.
– ddekany
Nov 19 at 22:48
@ddekany thanks, I'll see if I can somehow modify the template. Otherwise I'll prepare a bug report
– Konrad Kar
Nov 20 at 8:30
Regarding fixing the template, there's something like${rootloc.URI}in it, and that need to be replaced with${rootloc.URI!'Unknown'}.
– ddekany
Nov 20 at 17:32
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm implementing a new Struts 2 action and now I'm getting the following exception:
Error executing FreeMarker template: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> rootloc.URI [in template "org/apache/struts2/dispatcher/error.ftl" at line 86, column 15]
Struts Tiles tries to show our custom error page but during that process encounters above exception. It somehow can't set a property within the error.ftl which is delivered by the Struts framework itself. Hence the error page is not shown.
I have checked the error.ftl and the problem seems to occur somewhere around here (reference: https://github.com/apache/struts/blob/master/core/src/main/resources/org/apache/struts2/dispatcher/error.ftl):
<tr>
<td><strong>File</strong>:</td>
<td>${rootloc.URI}</td>
</tr>
Did anyone encounter this or a similar problem? I have no idea how to fix this because the error occurs within a Struts 2 component and I have no chance of debugging. I'm using Struts Version 2.3.36.
Thanks in advance!
java exception struts2 freemarker
I'm implementing a new Struts 2 action and now I'm getting the following exception:
Error executing FreeMarker template: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> rootloc.URI [in template "org/apache/struts2/dispatcher/error.ftl" at line 86, column 15]
Struts Tiles tries to show our custom error page but during that process encounters above exception. It somehow can't set a property within the error.ftl which is delivered by the Struts framework itself. Hence the error page is not shown.
I have checked the error.ftl and the problem seems to occur somewhere around here (reference: https://github.com/apache/struts/blob/master/core/src/main/resources/org/apache/struts2/dispatcher/error.ftl):
<tr>
<td><strong>File</strong>:</td>
<td>${rootloc.URI}</td>
</tr>
Did anyone encounter this or a similar problem? I have no idea how to fix this because the error occurs within a Struts 2 component and I have no chance of debugging. I'm using Struts Version 2.3.36.
Thanks in advance!
java exception struts2 freemarker
java exception struts2 freemarker
asked Nov 19 at 16:41
Konrad Kar
14
14
Debugging your code is very similar to debugging 3rd party code. Anyway, from the source code what seems to happen is that the template wants to print the file name for the exception. ButLocationUtils.getLocale(exception)returns acom.opensymphony.xwork2.util.location.LocationwheregetURI()returnsnull. I guess the template should expect that, as the LocationAPIallows that. But it doesn't, so it fails at thatnull. If you can modify the template it's easy to fix. Otherwise it's a good starting point for a bug report.
– ddekany
Nov 19 at 22:48
@ddekany thanks, I'll see if I can somehow modify the template. Otherwise I'll prepare a bug report
– Konrad Kar
Nov 20 at 8:30
Regarding fixing the template, there's something like${rootloc.URI}in it, and that need to be replaced with${rootloc.URI!'Unknown'}.
– ddekany
Nov 20 at 17:32
add a comment |
Debugging your code is very similar to debugging 3rd party code. Anyway, from the source code what seems to happen is that the template wants to print the file name for the exception. ButLocationUtils.getLocale(exception)returns acom.opensymphony.xwork2.util.location.LocationwheregetURI()returnsnull. I guess the template should expect that, as the LocationAPIallows that. But it doesn't, so it fails at thatnull. If you can modify the template it's easy to fix. Otherwise it's a good starting point for a bug report.
– ddekany
Nov 19 at 22:48
@ddekany thanks, I'll see if I can somehow modify the template. Otherwise I'll prepare a bug report
– Konrad Kar
Nov 20 at 8:30
Regarding fixing the template, there's something like${rootloc.URI}in it, and that need to be replaced with${rootloc.URI!'Unknown'}.
– ddekany
Nov 20 at 17:32
Debugging your code is very similar to debugging 3rd party code. Anyway, from the source code what seems to happen is that the template wants to print the file name for the exception. But
LocationUtils.getLocale(exception) returns a com.opensymphony.xwork2.util.location.Location where getURI() returns null. I guess the template should expect that, as the Location API allows that. But it doesn't, so it fails at that null. If you can modify the template it's easy to fix. Otherwise it's a good starting point for a bug report.– ddekany
Nov 19 at 22:48
Debugging your code is very similar to debugging 3rd party code. Anyway, from the source code what seems to happen is that the template wants to print the file name for the exception. But
LocationUtils.getLocale(exception) returns a com.opensymphony.xwork2.util.location.Location where getURI() returns null. I guess the template should expect that, as the Location API allows that. But it doesn't, so it fails at that null. If you can modify the template it's easy to fix. Otherwise it's a good starting point for a bug report.– ddekany
Nov 19 at 22:48
@ddekany thanks, I'll see if I can somehow modify the template. Otherwise I'll prepare a bug report
– Konrad Kar
Nov 20 at 8:30
@ddekany thanks, I'll see if I can somehow modify the template. Otherwise I'll prepare a bug report
– Konrad Kar
Nov 20 at 8:30
Regarding fixing the template, there's something like
${rootloc.URI} in it, and that need to be replaced with ${rootloc.URI!'Unknown'}.– ddekany
Nov 20 at 17:32
Regarding fixing the template, there's something like
${rootloc.URI} in it, and that need to be replaced with ${rootloc.URI!'Unknown'}.– ddekany
Nov 20 at 17:32
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379127%2fstruts-tiles-freemarker-invalidreferenceexception-pointing-to-struts2-error-ftl%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Debugging your code is very similar to debugging 3rd party code. Anyway, from the source code what seems to happen is that the template wants to print the file name for the exception. But
LocationUtils.getLocale(exception)returns acom.opensymphony.xwork2.util.location.LocationwheregetURI()returnsnull. I guess the template should expect that, as the LocationAPIallows that. But it doesn't, so it fails at thatnull. If you can modify the template it's easy to fix. Otherwise it's a good starting point for a bug report.– ddekany
Nov 19 at 22:48
@ddekany thanks, I'll see if I can somehow modify the template. Otherwise I'll prepare a bug report
– Konrad Kar
Nov 20 at 8:30
Regarding fixing the template, there's something like
${rootloc.URI}in it, and that need to be replaced with${rootloc.URI!'Unknown'}.– ddekany
Nov 20 at 17:32