freemarker.template.TemplateException: Error reading included file start_script.ftl - freemarker

My application running in tomcat 6. I have integrated freemarker template with Spring MVC.
I have "abct.ftl" under "freemarker/pages" and "xyz.ftl" under "freemarker/pages
/formal". I am including "abc.ftl" in "xyz.ftl" using "<#include
"../abc.ftl"/>".
This is working fine on MACH and LINUX but its giving below error on windows 7. I did search
for this error in google and tried many things but nothing helped fixing this issue.
The exception stack trace is given below:
freemarker.template.TemplateException: Error reading included file abc.ftl
at freemarker.core.Include.accept(Include.java:167)
Caused by: java.io.FileNotFoundException: Template abc.ftl not found.
Please help me fixing this issue.
Thanks

Thanks everyone for helping me on this issue.
I have found the solution to this problem so wanted to share it with you guys.
I went through the following documentation on freemarker site and found the solution:
http://freemarker.org/docs/pgui_config_templateloading.html#autoid_41[freemarker.org]
As suggested in this documentation, I replaced <#include "../abc.ftl"/> with <#include "/pages/abc.ftl"/>.
Freemarker documentation says, “FreeMarker always normalizes the paths before passing them to the template loader, so the paths do not contain/../ and such, and are relative to the imaginary template root directory.”
The template root directory is the one that we specify in templateLoaderPath:
property name="templateLoaderPath" value="classpath:/freemarker"
I tested this fix on Windows, Linux, Mach and its working everywhere.

Related

What is the GlobalIdentity and how do I set it in the FileNet web service?

I'm trying to upload a document into filenet via CEWS, but I'm getting this error:
“The unexpected exception is chained to this exception. Message was: com.filenet.apiimpl.core.GlobalIdentity incompatible with com.filenet.apiimpl.core.RepositoryIdentity“
Our Filenet people don't seem to know what that means. They've provided working code that basically looks the same as mine (but which I can't compile directly at the moment because it references parts of their project I don't have.)
So is the GlobalIdentity something I need to pass in through the web service? If so, how? If not, where is it configured?
Ok I finally spotted my mistake.
I had incorrectly set crt.TargetSpecification.classId to the name of the repository I was trying to use rather than to the correct classId.

in kendoui.web.2013.2.716 requiring kendo.culture.xx-XX.min.js produces an invalid request for kendo.core.min.js

I have just upgraded from kendoui.web.2013.1.514 to kendoui.web.2013.2.716 and have noticed that in the parts of the code where I require (through require.js) a certain kendo.culture.xx-XX.min.js file that also an unsuccessful request for kendo.core.min.js happens and I get an error in the console.
This did not happen with kendoui.web.2013.1.514 and I think this part inside the kendo.culture.xx-XX.min.js files might be to blame:
("function"==typeof define&&define.amd?define:function(e,n){return n()})(["../kendo.core.min"]
Also this reference to kendo.core appears to only be present in the minified versions. Note that I already have kendo.web.min.js fully loaded and the app works fine even with the invalid request so is this a bug?
If you are using the bundles (i.e. kendo.web.min.js) then you shouldn't use RequireJS to load them or any culture files.
I'm sorry that the documentation didn't mention it, I just added a section to explain this.

GCM: java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender

I have been trying to get Google Cloud Messaging to work in eclipse. I was able to compile the example given on their demo webpage and run that without any errors; however, when I try to create my own example using jersey I get the run time error "java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender" when the following code tries to create a sender.
#POST
#Path("/send")
public Response sendMessage() throws IOException
{
Sender sender = new Sender("api_key");
Message message = new Message.Builder().build();
sender.send(message, DataStore.getDevices(), 5);
return Response.status(200).entity("Success").build();
}
Note: I have replaced my real api key with api_key. I know it works because I was able to get the demo working by running the ant commands explained in the tutorial. Also just to be specific in case of ambiguity, the error I am getting is server side, and has nothing to do with the android device.
Things I have already tried:
I have included the gcm-server.jar in my WEB-INF/lib folder and under project properties I have included it in the build path.
I have also tried, as mentioned on other sites, to include json_simple-1.1.jar the same way I included gcm-server.jar. I don't see how this would effect this error but I saw this listed as an answer in a few different places.
(Solution) Deleted the tomcat server and created a new one. I probably could have just cleaned the project instead and had the same results.
Demo tutorial link: http://developer.android.com/guide/google/gcm/demo.html.
I just found a solution to my problem. In frustration I deleted the old Tomcat server from eclipse and created a new one. When I ran the project again there weren't any problems at all. When I first set up the project I had included the jar files in WEB-INF/lib and later, after reading a lot of posts on the internet, added gcm-server.jar to the build path. It appears that this action would have fixed it but for some reason unknown to me there were some left over files on the server from before the change. I should have tried cleaning my project but I didn't even think about that being the issue. Anyway, I hope that this helps someone because I've sort of condensed all of the information I could find on the internet into this post, as well as included my own dilemma and solution to it.

Spring security login error

I just implemented a simple login functionality using spring it how ever worked with the eclipse in built browser but gives the following error in chrome and firefox.
HTTP Status 404 - /SpringLogin/welcome.jsp;jsessionid=8332D4F3D4709DCA37C87F30F1EA03D5
The requested resource (/SpringLogin/welcome.jsp;jsessionid=BEE789093FF79CB6B67F8DA368E8B3E4) is not available.
can you please tell me why it is happening?
PS: I have two projects SpringLogin and both of them had same project names and both had similar packages. Then neither of the projects worked properly and gave the above error. How ever after I created another project with a different name and using different package names, it worked like magic. I am guessing here that it may have been the problem. But what is the logical answer that'll explain what happened there?
you don't have being calling the correct URL
it seems that the context /SpringLogin/ does not exists anymore.
Try /welcome.jsp or if you changed the name of application - try /newappname/welcome.jsp

Making sense of core taglibs migrating to Websphere 7

I am migrating an ADF application to run in Websphere 7.
Basically I am moving to jstl 1.2
I have created a new project and I am now at the point where I can run jsps.
I started getting errors with the taglibs. Then I found out that I have to replace all my c taglib declarations with the new uri of java.sun.com/jsp/jstl/core instead of java.sun.com/jstl/core
I did this to every one of my jsp files. Now when I publish and attempt to run it I get this error.
[Servlet Error]-[/index.jsp]: com.ibm.ws.jsp.JspCoreException: /index.jsp(742,56) /included.jsp(4,58) JSPG0240E: Attempt to redefine the prefix "c" to "http://java.sun.com/jstl/core", when it was already defined as "http://java.sun.com/jsp/jstl/core" in the current scope.
Now each page has the new uri. Why would it try to redefine it to the old uri?
Turns out the new stuff is very specific in regards to syntax
Notice this if you don't have spaces between the "#" and the "taglib" part of the text it blows up!
Also you have to have the space between the "c" and the end of the tag "%>"
If you don't do this it causes big ol stupid errors that say nothing about how to fix the issue.
I also have this problem at WAS v8. and fix it by:
Admin Console -> Application servers -> (serverName) -> Web
container -> Custom properties :
com.ibm.wsspi.jsp.allowtaglibprefixredefinition=true
PM38186: JSPG0240E: ATTEMPT TO REDEFINE THE PREFIX WHEN IT WAS ALREADY DEFINED IN CURRENT SCOPE ERROR IN WEBSPHERE APPLICATION SERVER 7
This fixed my problem!! My taglib imports were all the same so I still dont know the root cause of the problem in my environment (WebSphere 7 running in RAD 8.0.3). It shouldn't complain if the imports all point to the same namespace. This fix basically tells the server to ignore the error rather than preventing the error occurring.
I'll post back if I find more info.

Resources