Problem is that you have to isolate such JARs if they are also provided by JBoss
If you meant with 2. the location in a lib directory of JBoss you might get the wrong class in such case.
So I would recommend to add a class-loader scope to jboss.xml in your ear and include the jar's.
I suppose you use AS4/5/6/ and not AS7.
Thanks a lot wolf-dieter..
We are using JBoss 6.1.
Dont you think including all jars to the ear will increase the ear size.
If we dont include the jars, then in all env ( qa, preprod, prod), we have to copy these jars to some location and give referemce to that.
So what's the best practice?
As I mentioned I suppose you run into class-loading problems if you add libraries to the common lib directory.
Set a independent classpath like java-app is not possible inside the JEE server (if you meant that by 'some localtion').
If it is only one application there is no difference whether you deploy inside or outside the EAR.
If you have more than one EAR uses the same libraries you might add all that JBoss not provide to the lib directory.
With i.e. hibernate is won't work, so this must be packed inside the EAR. A better solution might be to change the application and use the provided hibernate if possible.