0
我必須使用開放式辦公API生成報告,報告窗口工作正常,但在linux下面我添加OOo的配置代碼BootstrapException同時生成報告使用開放式辦公API
就會產生像
java.lang.Exception: com.sun.star.comp.helper.BootstrapException
2011-04-21 14:21:27,919 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.docpopulate.util.DocumentWriter.createDoc(DocumentWriter.java:82)
2011-04-21 14:21:27,919 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.docpopulate.util.DocumentWriter.populateTemplateData(DocumentWriter.java:526)
2011-04-21 14:21:27,919 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.reports.CRMReportServlet.getReportDataBytes(CRMReportServlet.java:111)
2011-04-21 14:21:27,919 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.reports.CRMReportServlet.doWebAction(CRMReportServlet.java:34)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.base.BaseWsServelt.doGet(BaseWsServelt.java:34)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
2011-04-21 14:21:27,920 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
2011-04-21 14:21:27,921 ERROR [STDERR] (http-0.0.0.0-20150-2) at java.lang.Thread.run(Thread.java:619)
2011-04-21 14:21:27,922 ERROR [STDERR] (http-0.0.0.0-20150-2) Caused by: com.sun.star.comp.helper.BootstrapException
2011-04-21 14:21:27,922 ERROR [STDERR] (http-0.0.0.0-20150-2) at ooo.connector.BootstrapConnector.connect(BootstrapConnector.java:129)
2011-04-21 14:21:27,922 ERROR [STDERR] (http-0.0.0.0-20150-2) at ooo.connector.BootstrapSocketConnector.connect(BootstrapSocketConnector.java:68)
2011-04-21 14:21:27,922 ERROR [STDERR] (http-0.0.0.0-20150-2) at ooo.connector.BootstrapSocketConnector.connect(BootstrapSocketConnector.java:45)
2011-04-21 14:21:27,922 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.docpopulate.util.DocumentWriter.createDoc(DocumentWriter.java:74)
2011-04-21 14:21:27,922 ERROR [STDERR] (http-0.0.0.0-20150-2) ... 26 more
2011-04-21 14:21:27,922 ERROR [STDERR] (http-0.0.0.0-20150-2) java.io.FileNotFoundException: (No such file or directory)
2011-04-21 14:21:27,923 ERROR [STDERR] (http-0.0.0.0-20150-2) at java.io.FileInputStream.open(Native Method)
2011-04-21 14:21:27,923 ERROR [STDERR] (http-0.0.0.0-20150-2) at java.io.FileInputStream.<init>(FileInputStream.java:106)
2011-04-21 14:21:27,923 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.docpopulate.util.Utility.getBytesFromFile(Utility.java:35)
2011-04-21 14:21:27,923 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.reports.CRMReportServlet.getReportDataBytes(CRMReportServlet.java:114)
2011-04-21 14:21:27,923 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.reports.CRMReportServlet.doWebAction(CRMReportServlet.java:34)
2011-04-21 14:21:27,923 ERROR [STDERR] (http-0.0.0.0-20150-2) at com.cc.crm.web.base.BaseWsServelt.doGet(BaseWsServelt.java:34)
2011-04-21 14:21:27,923 ERROR [STDERR] (http-0.0.0.0-20150-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
2011-04-21 14:21:27,924 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
2011-04-21 14:21:27,925 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2011-04-21 14:21:27,925 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2011-04-21 14:21:27,925 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
2011-04-21 14:21:27,925 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2011-04-21 14:21:27,925 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
2011-04-21 14:21:27,925 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
2011-04-21 14:21:27,925 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
2011-04-21 14:21:27,925 ERROR [STDERR] (http-0.0.0.0-20150-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
2011-04-21 14:21:27,925 ERROR [STDERR] (http-0.0.0.0-20150-2) at java.lang.Thread.run(Thread.java:619)
錯誤如果(背景== NULL){ 嘗試 {
List oooOptions = OOoServer.getDefaultOOoOptions();
oooOptions.add("-nofirststartwizard");
OOoServer oooServer = new OOoServer(commonBundle.getString("OPEN_OFFICE_PATH"), oooOptions);
// Connect to OOo
BootstrapSocketConnector bootstrapSocketConnector = new BootstrapSocketConnector(oooServer);
context = bootstrapSocketConnector.connect();
//DocumentPopulateConfig
//context = BootstrapSocketConnector.bootstrap(commonBundle.getString("OPEN_OFFICE_PATH"));
}
catch (BootstrapException e)
{
throw new java.lang.Exception(e);
}
}
難道這是一個權限問題?您可以提供一些代碼來重現問題。 – u2ix 2011-04-21 13:29:56
它可能在窗口而不是在Linux中工作? – chetan 2011-04-21 13:33:48
顯然這是可能的。 – 2011-04-21 14:13:57