JBoss Community

Re: How to use external jars not contained in JBoss

created by Ales Justin in JBoss Microcontainer - View the full discussion

Thanks for your info, but unfortunately I must admit that I don't get it.  Is there any documentation available that explains this to non JBoss cracks?

I also read your mail on http://community.jboss.org/message/7542#7542 but I did not find the documentation you mentioned about configuring the deployer, I did not find any doc about custom deployers at all.

 

So after a few hours of internet searching: Could you please give me some more jump start on this?

 

Is there any doc available on how to do this for JBoss 5.1?

Unfortunately the community docs are poor wrt this issue, but support ... ;-)

But let's try to make this work anyway.

Is it correct that I have to derive from PathUrlIntegrationDeployer?

How do I connect/configure the deployer with the ear? I have no clue what files I have to put to the deployers directory and how to name them.

Yeah, or any UrlIntegrationDeployer (including it) would do -- depends on what you need.

 

I suggest you first read this article about VDF: http://java.dzone.com/articles/jboss-microcontainer-virtual-deployment-framework

to get a better feel for how deployers actually work -- if you haven't already.

 

Each deployer checks every deployment, sub-deployment, sub-sub-deployment, ..

So, when you write your own "integration" deployer, make sure you short circuit asap,

only applying integration logic to (sub*)deployments that really need it.

 

The logic of adding external lib is already written in the UrlIntDeployer, you just need to fill in the blanks.

Then simply deploy this new deployer in deployers/ dir as we do for some our JBoss deployers -- see *-jboss-beans.xml files.

Deployer is nothing than a MC bean, and the MC kernel will pick it up automagically. ;-)

 

What this UrlIntDeployer does it simply alters spec defined classpath with additional resources; e.g. your ext lib.

So, when constructing deployment's classloader we use this classpath, not really bothering where the resources come from.

 

If the resources are already shared by some parent classloader or common classloading domain,

and your classloader's lookup first delegates to them (e.g. plain cl behavior or non-web behavior),

you should also be fine with no dup classes loaded aka can easily be shared.

 

HTH?

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community