on 07-01-2020 12:35 PM - last edited on 01-26-2024 5:19 PM by brianbernard
Hi
I`m download crystal sdk for java
I try export report to format PDF
In my computer didn't installed software SAP or RAS
My code
`
import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument;
import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;import java.io.File;
public class ReportTest {
public static void main(String[] args) throws ReportSDKException {
final String IMPORT_FILE = "rcapireport.rpt";
final String EXPORT_FILE = "myExportedReport.pdf";
ClassLoader classLoader = new ReportTest().getClass().getClassLoader();
File file = new File(classLoader.getResource(IMPORT_FILE).getFile());
ReportClientDocument clientDoc = new ReportClientDocument();clientDoc.open(file, 0);}
}
`
and I have ERROR
Exception in thread "main" com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: org/apache/log4j/Logger---- Error code:-2147467259 Error code name:failed at com.businessobjects.sdk.erom.jrc.ReportAgentFactory.createAgent(SourceFile:54) at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.<init>(SourceFile:703) at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:662) at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:632) at com.crystaldecisions.sdk.occa.report.application.ClientDocument.if(SourceFile:504) at com.crystaldecisions.sdk.occa.report.application.ClientDocument.open(SourceFile:669) at ReportTest.main(ReportTest.java:41) Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger at com.businessobjects.reports.sdk.JRCCommunicationAdapter.<clinit>(SourceFile:190) at com.businessobjects.sdk.erom.jrc.a.<init>(SourceFile:43) at com.businessobjects.sdk.erom.jrc.ReportAgentFactory.createAgent(SourceFile:46) ... 6 more Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ... 9 more Process finished with exit code 1
Please, help
Tell me, what I need change or add to maven something?
It says you don't have the log4j library. Try this:
https://mvnrepository.com/artifact/org.apache.log4j/org.apache.log4j/1.2.13.v200706111418
<!-- https://mvnrepository.com/artifact/org.apache.log4j/org.apache.log4j -->
<dependency>
<groupId>org.apache.log4j</groupId>
<artifactId>org.apache.log4j</artifactId>
<version>1.2.13.v200706111418</version>
</dependency>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ran into this problem as well, and as far as I can tell, the Crystal Reports Java Runtime uses a very outdated version of log4j. I couldn't even find a version of log4j that had the particular classpath it was looking for, but Apache has a log4j 1.x compatibility library, and on first blush the below artifact works for me:
https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-1.2-api
Note that I only had this problem upgrading from 12.2.225 to 12.2.228, and before I was just using plain log4j 1.2. Not sure what changed between the versions but something broke and a dependency is not being met in their standard library distribution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.