0

I dropped in an external jar file using the new jar design element of Notes 9.

I tried referencing it from a managed bean, and was able to compile. In runtime, I get a NoClassDefFoundError when I try to use the methods in the jar.

I have refreshed, cleaned, and rebuilded. Version 9 server and designer.

I remember in the past with 8.5.3 there was lots of issues getting the build path correct, but I thought that the new jar design element was supposed to take care of the issues. Most of the research I have found is from the days of 8.5.3 and earlier.

Any advice would be appreciated. (I am purposely not tagging java on this question since I think only XPagers would understand what to advise here)

Steve Zavocki
  • 1,840
  • 4
  • 21
  • 35
  • Strange behavior. Just to exclude it: if you put the JARs into the server /program/jvm/lib/ext folder and restart the server - does this solve the issue? – Oliver Busse Aug 18 '14 at 21:14
  • Oliver, I am guessing that it would work if I did that, but its very hard to get done in my environment even in Unit/Dev. I will be frequently replacing the jar (sometimes 3x in a day) so it has to be easy, and I thought the jar design element would make it easy. – Steve Zavocki Aug 18 '14 at 22:23

3 Answers3

1

2 steps to fix a potential issue:

  1. Remove the database from designer. Delete the workspace project (only the project not the entire workspace!)

  2. Add the database back. Check in the Java build path (right click in the navigator view on the database) that the Jar directory is included

Sometimes step 2 alone does the job, so start with that first.

stwissel
  • 20,110
  • 6
  • 54
  • 101
1

As I remember early R9 versions have had issues with Java/JAR design elements. Put your JARs into WEB-INF folder (Project Browser view), that is my preferred way to use them.

Are JAR files in WebContent/WEB-INF/lib available to Java design elements in Domino Designer?

Community
  • 1
  • 1
Frantisek Kossuth
  • 3,524
  • 2
  • 23
  • 42
0

The solution that Stephan posted worked for my first attempt yesterday, so I am leaving it as the accepted answer. Today, I had to change the package name and the issue cropped up again.

This time nothing that Stephan or Frantisek suggested work to fix the NoClassDefFoundError exception. After trying everything, I came across this blog post. (A big thanks to Panu Haaramo who posted it in the comments in the answer of the SO that Frantisek's links to)

http://lotusandjava.blogspot.fi/2012/10/xpage-javalangnoclassdeffounderror.html

Renaming the jar caused the runtime engine to find the class file properly. Try this as well, as the solutions above to fix this problem. It is certainly an easy fix.

Steve Zavocki
  • 1,840
  • 4
  • 21
  • 35