从Eclipse(Ubuntu)调试模式下的Apache Ofbiz中的TemplateNotFound异常

时间:2017-01-24 17:33:20

标签: eclipse ubuntu ofbiz

我使用第二种方法在调试模式下配置apache ofbiz,该方法在this guide中标题为在Eclipse内部调试(或运行)OFBiz 。我在Windows和Ubuntu上重复了相同的过程。在Windows中,ofbiz运行正常没有问题,我可以在https://localhost:8443/ordermgr/control/main上的浏览器中使用它。但是,当我按照相同的指南并尝试从Ubuntu(16.0.4)运行ofbiz时,我得到了从RequestHandler.java在第989行抛出的TemplateNotfound异常。这是堆栈跟踪

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中出现此错误的任何想法?

1 个答案:

答案 0 :(得分:2)

我不确定究竟是什么问题但是我从一个不同于eclipse工作区的位置打开了ofbiz项目,并且包含的​​目录名与项目名不同。我做了以下工作以使其正常工作

  1. 从eclipse
  2. 删除了该项目
  3. 将项目目录移至工作区
  4. 重命名项目目录以匹配项目名称(ofbiz)
  5. 从eclipse打开它
  6. 跟随the guide调试/运行,如我的问题所述 所有人都突然工作了