• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Shared Library - Class Not Found

 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
author
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic