使用BIPublisher创建文件时拒绝访问

时间:2016-02-25 11:12:18

标签: java oracle windows-10 bi-publisher

好吧,我将我的开发电脑从Windows 7升级到Windows 10.当我尝试运行以前正在运行的应用程序时,它会产生一个奇怪的错误。

我使用BIPublisher.FOprocessor生成pdf用于报告。 我使用jdk7和Netbeans8.0.2 IDE,我的Web应用程序在Apache Tomcat 7.0.27上运行

当我尝试生成pdf

        //Now process the XSLFO template against the XML data      
        // Instantiate the FOprocessor      
        FOProcessor processor = new FOProcessor();
        // set CFG input file     
        processor.setConfig(sourceFileLocation + "xdo.cfg");
        // set XML input file     
        processor.setData(sourceOutputFileLocation + inputXMLFile);
        // set XSL input file      
        processor.setTemplate(sourceOutputFileLocation + inputXSLFile);

        // set the output format 
        if (fOutputFormat.equalsIgnoreCase(".pdf")) {
            processor.setOutputFormat(FOProcessor.FORMAT_PDF);
        } else if (fOutputFormat.equalsIgnoreCase(".html")) {
            processor.setOutputFormat(FOProcessor.FORMAT_HTML);
        } else if (fOutputFormat.equalsIgnoreCase(".xls")) {
            processor.setOutputFormat(FOProcessor.FORMAT_EXCEL);
        } else if (fOutputFormat.equalsIgnoreCase(".rtf")) {
            processor.setOutputFormat(FOProcessor.FORMAT_RTF);
        } else {
            processor.setOutputFormat(FOProcessor.FORMAT_PDF);
            outputFile = Fname + rInt + ".pdf";
        }

        //set output file      
        processor.setOutput(outputLocation + outputFile);
        processor.generate(); //HERE IS THE EXCEPTION

我收到以下异常

WARNING: oracle.xdo.XDOIOException: java.io.IOException: Access is denied
    at oracle.xdo.template.FOProcessor.getTmpFOFile(FOProcessor.java:2003)
    at oracle.xdo.template.FOProcessor.createFO(FOProcessor.java:1971)
    at oracle.xdo.template.FOProcessor.generate(FOProcessor.java:1117)
    at admin.reports.XMLpublisher.foProcessorEngine(XMLpublisher.java:97)
    at admin.reports.XMLpublisher.XMLout_CreateDocument(XMLpublisher.java:371)
    at admin.db.TR.DownloadAttendeeLunchList.getReport(DownloadAttendeeLunchList.java:101)
    at admin.db.TR.DownloadAttendeeLunchList.processRequest(DownloadAttendeeLunchList.java:42)
    at admin.db.TR.DownloadAttendeeLunchList.doGet(DownloadAttendeeLunchList.java:128)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at com.opcat.gzip.GZIPFilter.doFilter(GZIPFilter.java:36)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Access is denied
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createTempFile(File.java:2001)
    at oracle.xdo.common.tmp.TmpFile.createTmpFile(TmpFile.java:85)
    at oracle.xdo.template.FOProcessor.getTmpFOFile(FOProcessor.java:1999)
    ... 28 more

Feb 25, 2016 1:02:57 PM oracle.xdo.template.FOProcessor 
SEVERE: End Memory: max=2709MB, total=872MB, free=117MB

到目前为止,我尝试了很多解决方案,但都没有效果:

  1. 授予输出目录
  2. 权限
  3. 将输出目录移离根目录(c:)
  4. 以管理员身份运行我的Tomcat
  5. 将用户的完全权限授予我的本地驱动器
  6. 我没有想法。谁知道这里的问题是什么?显然,代码不是问题,因为它在Windows 7中运行正常,而windows server 2008则部署了我的生产环境。

1 个答案:

答案 0 :(得分:0)

问题是我必须使用提升的命令运行Netbeans IDE才能以完全权限部署我的应用程序。

在$ NETBEANS_INSTALLATION_PATH \ bin \ netbeans64.exe>属性>兼容性>更改所有用户的设置 - >勾选选项azure site create $SITENAME --location $LOCATION --hostname $HOSTNAME -s $SUBSCRIPTIONID

enter image description here