Lately I had pulled a new project to work on, a XPages application with a few external jar files.
When I tried to build the application it produced a lot of errors. The most annoying error was that classes could not found, and these classes are inside the external jar.
When I looked inside the application view in the Domino Designer I found the external Jars in the Jars section under code as Jar design element.
In the build path there was a reference to these external jars, but the path was changed to WebContent/WEB-INF/lib/external.jar.
In the package explorer the lib directory under WebContent/WEB-INF was present but empty.
So the Domino Designer magically moves the external jar files under the hood to the correct location. Nice but it gave me a very strange feeling and lots of errors, because it could go wrong.
Get it working
I have removed all the references of the external jar file from the build path. Moved all the external jars in the Package Explorer from the jars section to the correct location, WebContent/WEB-INF/lib/. That location is the correct place where a Java server is looking for external jars, anyway so why not put them there immediately.
Build the application and gone where all the errors.
As I move more and more over to the J2EE world I get used to the real Eclipse and his perspectives and views. I ‘live’ in the package explorer and have not the luxury of an Application view with design elements. In Domino Designer I hardly use the Application view, everything I do on XPages development I do in the Package Explorer. More what you is what you get 😉
If you want to look around to other technologies and Java/J2Eee/Vaadin is your choice, get use to the Package Explorer and abandon the use of the Application View.
The same apply of the Java classes as for the jar files, put them directly on the right location in a directory under WebContent/WEB-INF/ and make this directory a source folder.
4 thoughts on “Try to avoid the use of Jars design element”
For the same reasons I’ve avoided using the Java design element as well.
Yeah me too. In this application the Java element behaves. But at the first signs I will move them to correct location 😉
I have completely different experience … on all our Xpages projects we encounter Package Explorer to loose ‘src’ and ‘lib’ (jars) folder settings. Time to time it looses the settings and breaks a project. Its reason why we moved it to JARs and all JAVA sources to JAVA resources in Designer. But its just a one issue amount the many, many bugs Designer has. Its most buggy development IDE I have on my computer now. Horrible experience … and nobody will fix it 🙁
I agree about the buggy Designer. The Java and Jars design element is just a trick to please the Developers who are used to have design elements like forms and views. But who are using forms and view nowadays 😉
I experienced the same about loosing the src folder, but I think it has to do with buggy Designer.
I am happy to use a real Eclipse version, 4.5, for a day job and only for some XPages I have to fire up my VM for Windows and DDE.