• 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

eclipse ganymede - how to redirect non ejb library jars to lib

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my eclipse(ganymede) im trying to deploy my application in jboss. Specified all my ejb projects(I have a modularized project setup) in my ear project's J2EE module dependencies and they get added to the deploy folder properly along with an entry in application.xml, but how do i redirect my library(utility) project jars to a different location(say 'lib') in my jboss server. I see that my library(util) project jars are identified properly as utility jars by eclipse. There is even a check for the jars as 'to lib dir' in the 'J2EE module dependencies' screen, but that doesn't seem to do anything while deploying. I mean all the jars irrespective of being ejb module or utility are put to the .ear in the jboss deploy folder.

Please help..
Thanks
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure what you are asking when you say " do i redirect my library(utility) project jars to a different location(say 'lib') in my jboss server." Are you saying that you want this library to be placed within a lib directory within your EAR, or are you saying that you want this library to be placed in jboss_home/server/default/lib or jboss_home/common/lib? If you want it to be placed in jboss_home/server/default/lib or jboss_home/common/lib, then Eclipse will not do that. (Or maybe it can - try adding a script that copies the file there to the builders for your project. Of course, you will have to restart the app server to get it to recognize the library file.)
 
akhil achuthan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for replying Peter ...

I am ok with copying the library jars to jboss_home/server/default/lib, or to a folder like APP-INF/lib within my deployable .ear file. I believe eclipse should be capable of dealing with the second option, but how. As mentioned the ear project's 'J2ee module dependencies' has an option by which it asks if the jars are to be copied to a lib directory, but even when i select it these jars are taken to the .ear directly and not to any lib folder.

And for the first option of copying the jar to the jboss_home/server/default/lib, which file handles the build that eclipse performs on the projects. I mean when i give publish on my server, I see that eclipse is building all my projects. Which file(or at least which package) is responsible for this operation.

Thanks
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just now tried this. I created an EAR project and added an external library and checked the "in lib dir" checkbox. Then I exported the EAR file (File | Export | Java EE | EAR File.) The resulting EAR file had the external JAR in the lib directory. I then added my EAR project to my JBoss AS server and did a full publish. Once again the external JAR was placed in the lib directory.

I am using Eclipse 3.4.2 with JBoss Tools 3.0 (Development Updates from June 5).
 
akhil achuthan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My eclipse version is 3.4.0. I will try with 3.4.2. May be some bug with 3.4.0 that does not allow me to select the 'in lib dir'.

Moreover the file org.eclipse.wst.common.component in my ear project has all my ejb and non-ejb projects entries. All the project entriy tag in this file have the following format

----
<dependent-module archiveName="SnmpAdapter.jar" deploy-path="/" handle="module:/resource/SnmpAdapter/SnmpAdapter">
<dependency-type>uses</dependency-type>
</dependent-module>
----

i changed the 'deploy-path' tag from '/'to '/lib' in the file and saw that eclipse now shows the 'in lib dir' for that project as selected.

I also tried changing the dependency-type from 'uses' to 'consumes' with the deploy-path as '/lib/SnmpAdapter.jar'. Now I have a folder named lib within my ear, with SnmpAdapter.jar in it with the proper contents. The only problem with this approach is that the content within the lib is not an archive, but a folder named SnmpAdapter.jar. Anyway the contents are well and proper within it.. Any idea what this dependency-type is and is there any more types available?


Thanks for the info Peter.
reply
    Bookmark Topic Watch Topic
  • New Topic