PdfNET SDK with Glassfish: java.lang.UnsatisfiedLinkError: pdftron.PDF.PDFDoc.PDFDocCreate([B)J

475 views
Skip to first unread message

Julien Garcia Gonzalez

unread,
Sep 17, 2013, 11:01:23 AM9/17/13
to pdfne...@googlegroups.com
Hi,

I'm trying to use PdfNET Sdk in java application. I got some problem with multiple instanciation onf the library in the classloader, so I put the PdfNet.Initialize() in and otherEJB. The initialize is call in the @PostConstruct of the EJB.
But when I run the other EJB that need PDFNet SDK, I got that error: java.lang.UnsatisfiedLinkError: pdftron.PDF.PDFDoc.PDFDocCreate([B)J.

How can I use the PdfNET Sdk with java and Glassfish.

Thanks in advance,

Julien

Vincent Ycasas

unread,
Sep 17, 2013, 7:28:54 PM9/17/13
to pdfne...@googlegroups.com
You will need to make sure that the Java application can locate the PDFNetC library (PDFNetC.dll, libPDFNetC.so, or libPDFNetC.dylib). The easiest solution is to place the library in the following locations:
1. On Windows, place PDFNetC.dll to %WINDIR%\System32 or %WINDIR%\SysWOW64
2. On Linux, place libPDFNetC.so to /usr/lib
3. On Mac, place libPDFNetC.dylib to /Library/Java/Extensions.

Please keep in mind that you will need the same architecture of PDFNetC with the architecture of Java you are using. For example, 64-bit Java will only load 64-bit PDFNetC.

Julien Garcia Gonzalez

unread,
Sep 18, 2013, 9:44:03 AM9/18/13
to pdfne...@googlegroups.com
I've check in the classloader and I can see that my library is loaded. But I continue to receive that Error.

The strange thing i that, when I call directly in the ejb that need the library the PDFNet.Initialize(), it's working the first time but when I redeploy, it's not working anymore because it says that the native library is already loaded. So if I ignore the loading (but i'm sure that the lib is in the classloader). I got the error shown in the subject of this thread.

Regards
Reply all
Reply to author
Forward
0 new messages