Reputation: 2439
This seems like an elementary question, but I want to make sure that we're doing things right.
We're making webapps using Spring MVC and serving them using WebLogic. Where should jars be placed in this setup?
We have talked about placing business logic into jars that would live in the server classpath and app-specific jars would be packaged into the WAR files that get deployed. We know that if we redeploy a jar in the server classpath we have to bounce the server. Is there a way to avoid this?
Upvotes: 3
Views: 815
Reputation: 2895
If it is just a single web app per server, just shove 'em in WEB-INF/lib. Otherwise, the shared j2ee libraries discussed here provide flexibility and are easy to use & deploy in WLS.
http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/libraries.htm#g1092115
Upvotes: 0
Reputation: 308938
I've seen other SO questions that reported issues with JARs on the server classpath:
I think it's better to keep your WAR as a single, independent unit.
Upvotes: 0
Reputation: 16360
There are a couple of options, depending on your situation:
If you will only have one WAR, or you don't need to code across multiple WAR files, then you can package the business logic in with the WARs.
On the other hand, if you want to share code across multiple WAR files, then you would bundle the WARs into an EAR, and bundle the shared business logic code in one or more JAR files stored in that EAR.
I would generally avoid using the server classpath, since you are likely to run into classloading issues, and you don't want to bounce the production server just to update code.
Upvotes: 3