Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Rajendra.

Asked: August 28, 2018 - 7:09 am UTC

Last updated: August 28, 2018 - 10:33 am UTC

Version: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

Viewed 1000+ times

You Asked

Hi,
I am trying to add specific text to a pdf file using the apache pdfbox utility.

I have loaded following jars on to DB using following command.

loadjava -verbose -u user/pwd@ccoadev -jarasresource -genmissing -grant public -resolve pdfbox-2.0.11.jar

likewise I have loaded the following jars.

1. commons-logging-1.2.jar
2.fontbox-2.0.11.jar
3.pdfbox-debugger-2.0.11.jar
4.pdfbox-tools-2.0.11.jar

-> I am trying to load the source java file(Watermark.java) and getting the following error.

----------------
[occoadev@db43 pdfbox]$ loadjava -user user/pwd -grant public -resolve /dbstage/dba/edw/temp/24aug/pdfbox/Watermark.java
errors   : source com/colorcon/pdf/pdfbox/Watermark
    ORA-29534: referenced object BPSI.org/apache/pdfbox/pdmodel/PDDocument could not be resolved
The following operations failed
    source com/colorcon/pdf/pdfbox/Watermark: resolution
exiting  : Failures occurred during processing
[occoadev@db43 pdfbox]$ 


--------------------

BPSI :- this is the custom schema we use.

-----Structure of jars in the dba_objects table--

BPSI pdfbox-2.0.11.jar  4466217  JAVA RESOURCE
BPSI pdfbox-tools-2.0.11.jar  4466219  JAVA RESOURCE
BPSI pdfbox-debugger-2.0.11.jar      4466220  JAVA RESOURCE
BPSI pdfbox-app-2.0.11.jar  4466531  JAVA RESOURCE


-----------------------------------------------------


Kindly let me know if I am missing any step or loading the jars incorrectly.

Thanks,
Raj



and Chris said...

It sounds like you're missing some dependencies. Verify that you've loaded jars for all the classes this relies on.

You can find a guide for resolving the dependencies at:

https://docs.oracle.com/en/database/oracle/oracle-database/18/jjdev/preparing-Java-class-methods.html#GUID-F17E6450-17E3-49EE-9258-EF5E01748198

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Rajendra Jena, September 12, 2018 - 6:36 am UTC

Thank you Chris.

We were missing dependencies in the the order in which we were loading the jars.

The jar files should be loaded in the following order to avoid any dependency errors.


loadjava -user bpsi/bpsi_ccoadev@ccoadev -thin -resolve fontbox-2.0.11.jar
loadjava -user bpsi/bpsi_ccoadev@ccoadev -thin -resolve pdfbox-app-2.0.11.jar
loadjava -user bpsi/bpsi_ccoadev@ccoadev -thin -resolve pdfbox-2.0.11.jar
loadjava -resolve -user bpsi/bpsi_ccoadev@ccoadev -thin Watermark.java


Thank you for your response on this.

Thanks,
Raj

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library