Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Shared Library - Class Not Found

 
James Ward
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Web Archive .war, which i have successfully installed in websphere using the Admin Console.
The JSP pages in the .war use some classes from external jars.
How should i make these external jars available to the web archive Jsp pages ?
I am using websphere version 5.
I have also tried putting the path to these external jars in Shared Library, and then using this Shared Library in the .war - Libraries. But i still get class not found exception. Any ideas ?
 
Roland Barcia
author
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are these shared libraries used by different applications or different modules within the same EAR??
 
James Ward
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These shared libraries will be only used by two web application (The JSPs in my .war import the java packages in shared library).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34371
345
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can put them in the WEB-INF/lib directory. Also, make sure they are checked as java jar dependencies in the properties. If they are only in the build path, they could be found at compile time, but not runtime.
 
James Ward
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not want to put them in WEB-INF/lib, if i do so they will become part of individual .war files. I want the external jars to be available in the classpath for my .wars.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34371
345
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are these external jars located? Why don't you want to place them in the EAR or WAR?
If you really want to use an external jar, you can point to it directly in the build path. But it's risky since you have to make sure it is in the server's classpath when deploying.
 
James Ward
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i ensure jars are in the servers classpath ?
The way to do it is by using Shared Library - but it does not work for me....
I do not want to make these jars part of .wars because then i will have to place them in many (each) .wars. Many .wars are using these same external jars.
 
James Ward
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.. i think i solved the problem in some way.
I placed all the common external jars in <WebsphereHome>/AppServer/lib/ext directory. The include statements in JSP files in the .war were able to find these jars...
But, my earlier approach of using shared libraries through Admin Console should have worked too, but it didn't !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic