Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding lib jar files for a project in WSAD

 
John King
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can add a new lib jar file in the .classpath xml file manually.
Is there a way to do it through GUI in WSAD?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bring up the "properties" menu for the project (context menu -- left mouse button) and look on the "libraries" tab.
Kyle
 
Hartmut Ludwig
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Kyle,
I have a related question. I am new to WSAD and wonder how it would be possible to incorporate the externally linked jarfiles from this lib-tab into the actual EAR-File.
Everytime I construct the ear it only contains the code I have written, but not the necessary files from the external jars. If i deploy it it won't work - only if I put the linked jars into the classpath of the webapp. But this is not the propper solution, is it?
In more general terms: We have some base classes which will be used by the ejb as well as the client application or some servlets (in the webapp). I would like to export those files only once as a separate jar instead of incorporating it into the ejb and the clientapp.
Can you tell me how this is done?
TNX in advance...
Hartmut
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hartmut,
In VERY general terms, what you want can't be done if you want to only have the files in one place and then have them used by many EARs. That goes against the J2EE spec, which insists that EARs be self-contained.
However, if you just want to include utility Java code in one or several EARs generated by WSAD, this is easy. This article by Tim Deboer provides a tool that makes that possible.
Kyle
 
Hartmut Ludwig
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, Kyle, for your quick reply which was very helpful for me. I did not test it so far, but I guess I got it now.
BTW I did not want to share the utility-classes between different EARs, but between different components of one EAR. And since we permanently develop the utility classes as well as the EAR components, the article of Tim deBoer seems to provide a good solution for us.
Thanx again. Great to have you here on the ranch...
Hartmut
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic