4

When using Domino Designer 8.5.3, I have a bunch of custom classes added using the Java design element. I want to use a 3rd party JAR in my custom classes in the same way you would when using external JARs in xPages SSJS, via Package Explorer:

WebContent-->WEB-INF-->lib

However my custom classes aren't picking the JAR up.

Is this a known limitation or have I got my configuration screwed up somewhere?

lee_mcmullen
  • 2,801
  • 32
  • 39

2 Answers2

10

They are after you do:

Project -> Properties -> Java Build Path -> Libraries -> Add JARS...

update:

Frantisek Kossuth tells us about a nice shortcut in his comment:

in Package Explorer view (Java perspective, or add this view to XPages/Domino Designer perspective), simply right click JAR file and use "Build Path/Add to Build Path" menu

Panu Haaramo
  • 2,932
  • 19
  • 41
  • Hi Paul. Yes that solves the issue of the Java class picking up the JAR in Designer. However when the code then runs via the xpage through the browser, a NoClassDefFoundError is thrown. – lee_mcmullen Jan 22 '13 at 18:40
  • I often have to clean the project or rebuild when that kind of errors appear. – Panu Haaramo Jan 22 '13 at 18:50
  • Yes that was my thinking too so have done a clean and a rebuild but still no luck. – lee_mcmullen Jan 22 '13 at 18:53
  • Some suggestions here: http://lotusandjava.blogspot.fi/2012/10/xpage-javalangnoclassdeffounderror.html – Panu Haaramo Jan 22 '13 at 18:58
  • Thanks Panu. I created a fresh NSF and tried what you suggested which then worked fine. Led me to think there must be an issue with the NSF I was working on. Removed my replica and pulled a fresh one. Tried what you suggested and it worked. Frustrating! Thanks for your help. – lee_mcmullen Jan 22 '13 at 19:04
  • If you use these jar files often it would best to add them to the jvm/ext directory on your server directly. Because adding Jar files to a notes designer increases build times enormously for some reason. – jjtbsomhorst Jan 22 '13 at 20:51
  • 3
    If you are in Package Explorer view (Java perspective, or add this view to XPages/Domino Designer perspective), simply right click JAR file and use "Build Path/Add to Build Path" menu. – Frantisek Kossuth Jan 23 '13 at 11:55
1

I had a similar problem (Accessing methods from imported jars in managed beans). It seems you need to import them in your machine/server's file system.

Community
  • 1
  • 1
Brian Moore
  • 137
  • 2
  • 8