本文介绍了Eclipse中Debug模式下的Apache Ofbiz中的TemplateNotFound异常(Ubuntu)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在调试模式下使用标题为在。我在Windows和Ubuntu上重复了相同的过程。在Windows中,forbiz运行良好,没有问题,我可以使用浏览器在。但是当我遵循相同的指南并尝试从Ubuntu(16.0.4)运行ofbiz时,我得到了从$ code> RequestHandler.java 在第989行抛出的TemplateNotfound异常。是堆栈跟踪

I configure apache ofbiz in debug mode using the second method titled Debugging (or running) OFBiz inside Eclipse from this guide. I have repeated the same procedure on windows and Ubuntu. In windows, ofbiz runs fine without problems and I can use it from browser on https://localhost:8443/ordermgr/control/main. But when I follow the same guide and try to run ofbiz from Ubuntu (16.0.4), I get the TemplateNotfound exception which is thrown from RequestHandler.java at line 989. Here is the stack trace

Communication error with the client while processing the request: /webtools/control/ServiceList
org.apache.ofbiz.webapp.control.RequestHandlerException: Error in the response writer/output stream: freemarker.template.TemplateNotFoundException: Template not found for name "component://widget/templates/HtmlScreenMacroLibrary.ftl".
The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = org.apache.ofbiz.base.util.template.FreeMarkerWorker$FlexibleTemplateLoader@38cfbab5, loader2 = StringTemplateLoader(Map { })). (Template not found for name "component://widget/templates/HtmlScreenMacroLibrary.ftl".
The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = org.apache.ofbiz.base.util.template.FreeMarkerWorker$FlexibleTemplateLoader@38cfbab5, loader2 = StringTemplateLoader(Map { })).)
    at org.apache.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:989) ~[ofbiz.jar:?]
    at org.apache.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:649) ~[ofbiz.jar:?]
    at org.apache.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:210) [ofbiz.jar:?]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [javax.servlet-api-3.1.0.jar:3.1.0]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.0.36.jar:8.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:209) [ofbiz.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.ofbiz.webapp.control.ControlFilter.doFilter(ControlFilter.java:156) [ofbiz.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) [tomcat-catalina-8.0.37.jar:8.0.37]
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100) [tomcat-coyote-8.0.37.jar:8.0.37]
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687) [tomcat-coyote-8.0.37.jar:8.0.37]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) [tomcat-coyote-8.0.37.jar:8.0.37]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) [tomcat-coyote-8.0.37.jar:8.0.37]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util-8.0.37.jar:8.0.37]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "component://widget/templates/HtmlScreenMacroLibrary.ftl".
The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = org.apache.ofbiz.base.util.template.FreeMarkerWorker$FlexibleTemplateLoader@38cfbab5, loader2 = StringTemplateLoader(Map { })).
    at freemarker.template.Configuration.getTemplate(Configuration.java:2430) ~[freemarker-2.3.24-incubating.jar:2.3.24]
    at freemarker.template.Configuration.getTemplate(Configuration.java:2232) ~[freemarker-2.3.24-incubating.jar:2.3.24]
    at org.apache.ofbiz.base.util.template.FreeMarkerWorker.getTemplate(FreeMarkerWorker.java:259) ~[ofbiz.jar:?]
    at org.apache.ofbiz.base.util.template.FreeMarkerWorker.getTemplate(FreeMarkerWorker.java:253) ~[ofbiz.jar:?]
    at org.apache.ofbiz.widget.renderer.macro.MacroScreenRenderer.<init>(MacroScreenRenderer.java:84) ~[ofbiz.jar:?]
    at org.apache.ofbiz.widget.renderer.macro.MacroScreenViewHandler.loadRenderers(MacroScreenViewHandler.java:113) ~[ofbiz.jar:?]
    at org.apache.ofbiz.widget.renderer.macro.MacroScreenViewHandler.render(MacroScreenViewHandler.java:152) ~[ofbiz.jar:?]
    at org.apache.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:985) ~[ofbiz.jar:?]
    ... 31 more

任何想法为什么我在Ubuntu中收到此错误?

Any ideas why I get this error in Ubuntu?

推荐答案

我不知道究竟是什么问题,但是我从与eclipse工作区不同的位置打开ofbiz项目,并且包含目录名称与项目不同名称。我做了以下工作让它工作

I am not sure what exactly the problem was but I was opening the ofbiz project from a different location than eclipse workspace and containing directory name was different than project name. I did the following to get it working


  1. 从eclipse中删除项目

  2. 移动项目目录到工作空间

  3. 将项目目录重命名为匹配项目名称(ofbiz)

  4. 从eclipse打开

  5. 遵循进行调试/按照我的问题

    中提到的一切运行,所有的突然工作

  1. Deleted the project from eclipse
  2. Moved the project directory to workspace
  3. Renamed the project directory to match project name (ofbiz)
  4. Opened it from eclipse
  5. Followed the guide to debug/run as mentioned in my question
    and all was suddenly working

这篇关于Eclipse中Debug模式下的Apache Ofbiz中的TemplateNotFound异常(Ubuntu)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-01 13:59