Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting classpath in WAS 5.0

 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I am trying to workout a simple Struts application using WSAD 5.1.0 + WAS 5.0. I was able to run the application in Tomcat, but when i tried the same in the WAS Test Enviroment using WSAD it throws java.lang.NoClassDefFoundError: org/apache/commons/dbcp/BasicDataSource. I restarted the Server after adding commons-dbcp-1.1.jar in the project classpath but the same exception occured.. Could anyone tell me where to add this jar file ? I thought WAS will take all the jar files in the project classpath, but its not happening. i am very new to WAS.. would appretiate if anyone could give me an url where i can study the in and out of WAS. I tried redbooks and ibm site but could not find the basic stuffs anywhere..



Thanks in advance,
Rajeev.
 
Ed Wallen
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition to adding it to your project classpath, you need to add the jar to your Web application's manifest file. Here's what this means in WSAD: right click on the web project and select "Properites". Next, select "Java Jar Dependencies". Make sure that the new Jar that you added to your application is checked (all checked jar entries get added to the Manifest.mf).

-Ed
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ed,

Thanks for ur reply..

I just verified the "Java Jar Dependencies" on my project. I could not find any entries there Could u tell me how to add the jar to the manifest file ?

Thanks,
Rajeev
 
Ed Wallen
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Rajeev,

Go back to your "Java JAR Dependencies" and see if you have an "Enterprise application project name" associated with your web project other than the default (this is a drop down on that screen). If not (or if it is associated with the Default EAR), you need to go to your J2EE project's application.xml and add your web project as a web module. Then go back to your "Java JAR Dependencies" and check all .jar files that you want to be included in your manifest.

-Ed
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic