This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 11, 2012, 10:39 AM
13 Posts

java library problem

  • Category: Other
  • Platform: Not Applicable
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 8
 I am using pdfbox to generate PDF files. First run was to put the library inside the NSF, but any design operation on the application was too slow to live with, so I moved the library to the jvm/lib/ext directory on both designer client and server.
 
After that it worked for a couple of months, but yesterday I found that some OSGI modules did not load. Studying the error-log.xml I found: 
org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. 
 
A little research into the latest server changes revealed that pdfbox-app included a version of org.apache.commons.logging. So I downloaded a new pdfbox which did not include org.apache.commons.logging. The new library have been tested in eclipse and everything worked when I used the domino server version of org.apache.commons.logging.
 
Then the new libraries was copied to the server ( /opt/ibm/lotus/notes/85030/linux/jvm/lib/ext ). Server now starts and works with the troubled OSGI modules, but when invoking the pdf generation code I get the following error message:
java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory 
 
I tried copying the org.apache.commons.logging library from /opt/ibm/lotus/notes/85030/linux/osgi/rcp/eclipse/plugins, but then I was back to square one with the first error message.
 
Then I tried moving the library from /opt/ibm/lotus/notes/85030/linux/osgi/rcp/eclipse/plugins to  /opt/ibm/lotus/notes/85030/linux/jvm/lib/ext, but then the OSGI would not start at all.
 
Any tips would be appreciated. 
 
Johnny 
Sep 11, 2012, 8:56 PM
366 Posts
Re: java library problem
 Which PDFBOX jar are you adding? The FULL 9 meg app or just PDFBOX.jar ?
 
How are you calling the classes?  From SSJS in an XPage or from a Java Code Element called from SSJS ? 
 
If you are calling the classes from an XPage then the jar's have to go in the ibm\lotus\domino\xsp folder on the designer client and server. 
 
If calling from an agent or jave code element then the jar's go in the ext\lib folder 
 
 
Sep 12, 2012, 7:26 AM
13 Posts
Re: java library problem
 First run (which initiated the org.apache.commons.logging problem): pdfbox-app-1.7.0.jar
 Second run: pdfbox-1.7.1.jar and fontbox-1.7.1.jar
 
I have written a couple of higher level wrappers in java, so I call the java wrappers from SSJS.
 
pdfbox-app-1.7.0.jar included a version of org.apache.commons.logging, while the new ones do not include this library. IBM distributes one version that resides in osgi/..../plugins directory. If 2 are installed, they seem to conflict when invoked (even when they are identical). The osgi/.../plugins will not find the org.apache.commons.logging if it is installed in lib/ext and vice versa.
Sep 12, 2012, 1:44 PM
366 Posts
Re: java library problem
 Ok, I'll do some testing later today.  
 
So you are calling your Java wrappers that are implemented as POJO's or Java Code elements? 
 
 I have added some rather large .jar files to the nsf directly and did not suffer from the designer performance you were referencing.  
 
Have you bumped the amount of memory DDE uses beyond the 256 default ? 
 
 
Sep 12, 2012, 6:32 PM
13 Posts
Re: java library problem
 That's great.
 
The Java wrappers are POJO's. In some cases the documents are populated from SSJS, but mostly I pass document unids to an even higher level POJO and do the work in Java. That way I can test the entire code in Eclipse with a more convenient debugger.
 
The performance was reduced with ODFDOM installed, but unusable with both ODFDOM and PDFBOX.
 
The DDE memory have been adjusted to 768M or 1024M. I run it in a Virtualbox VM on Ubuntu. My guess is that the performance reduction is due to network traffic when refreshing / rebuilding the application after a save. Also upgrading the application on remote servers is an incredibly slow process.
 
The server is not state of the art. There's only one user. The plan is to upgrade in january, which might help.
 
 
 Johnny
Sep 13, 2012, 8:48 PM
366 Posts
Re: java library problem
 Ok.  I dropped the pdfbox-app-171 jar into the Notes/jvm/lib/ext folder.
 
All the code ran fine and I'm not seeing any conflict with the osgi loader. 
 
It may be because I'm not calling any other code that uses commons logger, but at the moment everything seems to be jelled just fine. 
 
 
Sep 14, 2012, 7:11 AM
13 Posts
Re: java library problem
 Yes, my experience too. Sorry for lack of precision in my description earlier.
 
The reason it took some time for me to identify the problem was that everything seemed to work fine. The problem was detected when I tried to use a XPage that needed this OSGI module (Domino webDav). The server error-log pointed to org.apache.commons.logging error, then the second org.apache.commons.logging could be located inside pdfbox-app.
Sep 14, 2012, 2:50 PM
366 Posts
Re: java library problem
 So what if you use the PDFBOX jar without the commons logging and add the common loggings jars to the nsf itself.
 
As that uses a separate class loader that should allow the pdfbox to resolve the class but not conflict with the osgi one when it wants to load. 
 
I will try this over the weekend to see if it at least the class is resolvable.  Kind of kludgy, but might work.
Sep 17, 2012, 12:44 PM
13 Posts
Re: java library problem
 Tried to add the logging to the nsf. Could not resolve it.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal