简体   繁体   English

在ReportClientDocument.open()调用中获取错误java.lang.AbstractMethodError

[英]Getting error java.lang.AbstractMethodError on ReportClientDocument.open() call

I am trying to autopost a crystal report in PDF formate. 我正在尝试以PDF格式自动发布水晶报表。 I am using IDE: IntelliJ Gradle 我正在使用IDE:IntelliJ Gradle

 public void runApprovedSupplierSiteReport(){
    // final Config config = ConfigFactory.instance(Config.class);

     //CrystalUtil.setupJdbcJndi(Config.getDatabaseServer(), Config.getDatabaseUsername(), Config.getDatabasePassword(), Config.getDatabaseJdbcDriver(), Config.getDatabaseJdbcUrl());

    final List<String> paramNames = Config.getMatches(APPROVED_SUPPLIER_SITE_PARAM_REGEX);
    final Map<String, String> params = new HashMap<>();
    for (final String name : paramNames) {
        final String value = Config.getPqp_Report_ApprovedSupplierSite_Param_$0_Value(name);
        params.put(name, value);
    }

    final ReportClientDocument reportDoc = new ReportClientDocument();
    try {
        // export PDF
        final String report = Config.getPqp_Report_ApprovedSupplierSite_Rpt();
        reportDoc.open(report, OpenReportOptions._openAsReadOnly);
        CrystalUtil.setParamFields(reportDoc, params);
        final InputStream is = reportDoc.getPrintOutputController().export(ReportExportFormat.PDF);

        //
        final Session session = CmisUtil.createSession(Config.getPdmsAtomPubUrl(), Config.getPdmsUser(), Config.getPdmsPassword(), Config.getPdmsRepositoryId());
        final Map<String, Object> properties = DocumentManager.getDocumentProperties(
                DocType.SUPPLIER_REPORTS,
                DocGroup.MQPSD,
                SUPPLIER_REPORT_DOC_NUMBER,
                SUPPLIER_REPORT_NAME,
                new Date());

        final String prefix = ConfigUtil.getEnvironmentPrefix(Config.getTwsEnvironmentCode());
        final String docName = prefix + String.format(DocFormat.SUPPLIER_REPORTS, PdmsUtil.getDateAsString(new Date()));
        final Document document = CmisUtil.createDocument(
                session,
                docName + ".pdf",
                "",
                docName,
                DocClass.REPORTS,
                MediaType.PDF.toString(),
                is,
                -1,
                properties);
        Monitor.getLogger().info("<- PDMS report=" + report + " id=" + document.getId() + " versionSeriesId=" + document.getVersionSeriesId());

    } catch (final ReportSDKException e) {
        String err = e.getMessage();
        Monitor.getLogger().error("runApprovedSupplierSiteReport() " + e.getMessage());
        logger.error("runApprovedSupplierSiteReport()", e);
    } catch (final CmisBaseException e) {
        Monitor.getLogger().error("runApprovedSupplierSiteReport() " + e.getErrorContent());
        logger.error("runApprovedSupplierSiteReport()", e);
    } finally {
        CrystalUtil.closeQuietly(reportDoc);
    }
}

In above code snippet at line reportDoc.open(report, OpenReportOptions._openAsReadOnly); 在上面的代码段中,行reportDoc.open(report, OpenReportOptions._openAsReadOnly); I got following error : 我收到以下错误:

java.lang.AbstractMethodError: com.businessobjects.reports.sdk.JRCCommunicationAdapter.setProductLocale(Ljava/util/Locale;)V

at com.crystaldecisions.proxy.remoteagent.z.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ReportAppSession.int(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ReportAppSession.initialize(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ClientDocument.new(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.new(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ClientDocument.open(Unknown Source)
at com.crystaldecisions.reports.sdk.ReportClientDocument.open(SourceFile:80)
at com.processstream.pepsico.pqp.tws.ows.PqpOwsJob.runApprovedSupplierSiteReport(PqpOwsJob.java:264)
at com.processstream.pepsico.pqp.tws.ows.PqpOwsJobTest.runApprovedSupplierSiteReport_1(PqpOwsJobTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

I have checked for all abstract classes but all the methods are defined. 我已经检查了所有抽象类,但是定义了所有方法。 Please let me know if anybody can help me in solving this error. 请让我知道是否有人可以帮助我解决此错误。

void com.businessobjects.reports.sdk.JRCCommunicationAdapter.setProductLocale(Locale)

This method is concrete in the version of the library you used to compile your code, so your IDE was happy to compile a call reference to it. 此方法在用于编译代码的库版本中是具体的,因此您的IDE乐于编译对此代码的调用引用。

The library present in the deployment location is a different version in which this method is abstract. 部署位置中存在的库是此方法抽象的不同版本。

This is described in the Javadoc for AbstractMethodError : Javadoc中针对AbstractMethodError对此进行了描述:

Thrown when an application tries to call an abstract method. 当应用程序尝试调用抽象方法时抛出。 Normally, this error is caught by the compiler; 通常,此错误由编译器捕获; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled. 如果自上次编译当前执行的方法以来某个类的定义发生了不兼容的更改,则仅在运行时会发生此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM