OFBIZ bug_ControlServlet.java:233:ERROR
错误日志:
[java] 2014-09-26 10:12:17,031 (http-bio-0.0.0.0-8443-exec-5) [ ControlServlet.java:233:ERROR] [java] ---- exception report ---------------------------------------------------------- [java] Error in request handler: [java] Exception: org.ofbiz.widget.screen.ScreenRenderException [java] Message: Error rendering screen [component://common/widget/CommonScreens.xml#login]: java.lang.IllegalArgumentException: Could not find screen with name [main-decorator] in class resource [component://practice/widget/PracticeScreens.xml] (Could not find screen with name [main-decorator] in class resource [component://practice/widget/PracticeScreens.xml]) [java] ---- cause --------------------------------------------------------------------- [java] Exception: java.lang.IllegalArgumentException [java] Message: Could not find screen with name [main-decorator] in class resource [component://practice/widget/PracticeScreens.xml] [java] ---- stack trace --------------------------------------------------------------- [java] java.lang.IllegalArgumentException: Could not find screen with name [main-decorator] in class resource [component://practice/widget/PracticeScreens.xml] [java] org.ofbiz.widget.screen.ScreenFactory.getScreenFromLocation(ScreenFactory.java:103) [java] org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:195) [java] org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString(ModelScreenWidget.java:585) [java] org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:104) [java] org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:191) [java] org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) [java] org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:135) [java] org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:97) [java] org.ofbiz.widget.screen.ScreenWidgetViewHandler.render(ScreenWidgetViewHandler.java:101) [java] org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:868) [java] org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:582) [java] org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:224) [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:620) [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [java] org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:337) [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [java] org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [java] org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [java] org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [java] org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [java] org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [java] org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [java] org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) [java] org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [java] org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) [java] org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) [java] org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) [java] java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [java] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [java] org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [java] java.lang.Thread.run(Thread.java:662) [java] --------------------------------------------------------------------------------
解决问题:在practice/widget/PracticeScreens.xml中添加如下配置即可
<screen name="main-decorator"> <section> <actions> <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> <property-map resource="PracticeUiLabels" map-name="uiLabelMap" global="true"/> <set field="layoutSettings.companyName" from-field="uiLabelMap.PracticeCompanyName" global="true"/> <set field="layoutSettings.label1" from-field="uiLabelMap.PracticeApplication" global="true"/> <set field="layoutSettings.label1" from-field="uiLabelMap.PracticeApplication" global="true"/> <set field="activeApp" value="practice" global="true"/> <set field="applicationMenuName" value="PracticeAppBar" global="true"/> <set field="applicationMenuLocation" value="component://practice/widget/PracticeMenus.xml" global="true"/> </actions> <widgets> <include-screen name="GlobalDecorator" location="component://common/widget/CommonScreens.xml"/> </widgets> </section> </screen>