1

I'm using pdfbox-app-2.0.25.jar file for pdf generation and it is working fine in eclipse but while integrating it to Siebel, getting error

Error invoking service 'BTFLY B2B FTPV CAF Generation Service', method 'UserNameDesignation.doInvokeMethod' at step 'PDF Generation - FTPV'.(SBL-BPR-00162)--Class name incorrect or does not extend SiebelBusinessService : airtel/in/b2bcaf/FirstTimePhysicalVerification-- JVM Exception:java.lang.NoClassDefFoundError: org/apache/pdfbox/pdmodel/font/PDFont(SBL-EAI-05010)

I had compiled all my jar file into JAVASE-1.6 and added required class paths.

Here is the list of libraries imported in my class

import com.siebel.data.SiebelPropertySet;
import com.siebel.eai.SiebelBusinessService;
import com.siebel.eai.SiebelBusinessServiceException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import java.io.File;
import java.util.Date;
import java.util.HashMap;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.apache.pdfbox.pdmodel.PDDocument;   
import org.apache.pdfbox.pdmodel.PDPage;   
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode;
import org.apache.pdfbox.pdmodel.font.PDType1Font;
  • `and added required class paths` no you didn't, or Siebel ignores it, that's what it means. You need pdfbox and fontbox jar files in the classpath. Of the same version. – Tilman Hausherr Feb 15 '22 at 10:34
  • @TilmanHausherr I added PDFBox standalone jar file named pdfbox-app-2.0.25.jar on apache pdfbox website [link](https://pdfbox.apache.org/download.html). It already has pdfbox and fontbox jar inbulit in it. – ADITYA SHARMA Feb 15 '22 at 12:09
  • That is fine too. Btw re classpath, some operating systems use ";" and some use ":" (important if you're using "java -cp "). – Tilman Hausherr Feb 15 '22 at 12:59
  • @TilmanHausherr Multiple jars are added in class path they are working fine but for this particular jar getting the error – ADITYA SHARMA Feb 16 '22 at 05:06
  • Then it's time to try desperate things: 1) update / reinstall java 2) download the PDFBox jar files again. (also make sure no other versions are in the classpath) 3) try on a different system 4) check your META-INF/MANIFEST.MF file if it mentions pdfbox – Tilman Hausherr Feb 16 '22 at 12:29
  • 1
    Seems there was some issue with the class path entry. Modified it and it's now fixed. Thanks – ADITYA SHARMA Mar 04 '22 at 09:55
  • Does this answer your question? [What causes and what are the differences between NoClassDefFoundError and ClassNotFoundException?](https://stackoverflow.com/questions/1457863/what-causes-and-what-are-the-differences-between-noclassdeffounderror-and-classn) – Danubian Sailor May 27 '22 at 12:21

0 Answers0