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!










share|improve this question






















  • 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










  • 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















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!










share|improve this question






















  • 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










  • 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













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!










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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. 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










  • 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












  • @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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Feedback on college project

Futebolista

Albești (Vaslui)