This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
What is the difference between adding jars of a build path of a project in eclipse and putting it in JBoss server/default/lib.
One more question I have that in a "Dynamic Web Project" say I want to use mysql jdbc I need to put that driver jar file in lib directory under web-apps directory.In case of a console application if I include that jar in project classpath it works.I want to know what is the difference between these two ?
1) JARS in the Eclipse build path will go into the WEB-INF/lib directory of your app.
2) JARs in the WEB-INF/lib directory are automatically added to your apps classpath by the application server. For a console app, you have to add those JARs to the classpath yourself. But in both cases, the JARs are in the classpath.
Thanks Peter for replying.But I was using a CSV api deployed as java-csv.jar in a EJB project.I added this jar in Eclipse build path.No compile time error I got.But while running it was throwing NoClassDefFoundError.Then I put that jar in JBoss where I deployed my application, inside server/default/lib then it worked.
Ah, but an EJB project is different from a Dynamic Web Project. If the EJB is a standalone project (no EAR project), then you have to manually provide any dependencies. If the EJB project is part of an EAR project, then the EAR project should provide the dependencies in the EAR's lib directory.