This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Websphere and the fly likes Shared Library - Class Not Found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Shared Library - Class Not Found" Watch "Shared Library - Class Not Found" New topic
Author

Shared Library - Class Not Found

James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263
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

Joined: Apr 15, 2004
Posts: 181
Are these shared libraries used by different applications or different modules within the same EAR??


Roland Barcia: IBM Distinguished Engineer, CTO Mobile for Lab Services
James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30085
    
149

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30085
    
149

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

Joined: Apr 27, 2003
Posts: 263
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

Joined: Apr 27, 2003
Posts: 263
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 !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Shared Library - Class Not Found
 
Similar Threads
JBoss JSP compilation
application packaging for wehsphere 7-application and framework classes referred in both EJB and Web
migrating from Jboss4.0 to websphere 6.0
libraries not found!
Server.ResourceUnavailable error with Flex LCDS v3