Deployment of WAR in Virgo [message #993411] |
Mon, 24 December 2012 09:54 |
Sameer Pokarna Messages: 1 Registered: December 2012 |
Junior Member |
|
|
Hi All,
I have a WAR file that I am trying to deploy in Virgo with embedded Tomcat. This web application uses Spring dependency injection, and then instantiates a DBCP bean, and uses Hibernate/JPA for persistence. My WAR file is completely independent, and embeds all the dependent JARs in the WAR file itself.
When this is deployed in standalone tomcat, it works.
However, when I try to deploy in Virgo with embedded Tomcat, I get ClassNotfoundException for the Spring and then Hibernate classes, which I workaround by importing the specific packages form my WAR manifest.
However, if I do this, Virgo looks for all the dependent JAR files like DBCP jars outside my WAR file, which fails. Is there a way to deploy the complete WAR without looking for any dependent libraries outside the web archive?
Regards,
Sameer
|
|
|
Re: Deployment of WAR in Virgo [message #993707 is a reply to message #993411] |
Tue, 25 December 2012 07:37 |
Tin N/A Messages: 46 Registered: December 2010 |
Member |
|
|
Sameer Pokarna wrote on Mon, 24 December 2012 10:54
When this is deployed in standalone tomcat, it works.
However, when I try to deploy in Virgo with embedded Tomcat, I get ClassNotfoundException for the Spring and then Hibernate classes, which I workaround by importing the specific packages form my WAR manifest.
However, if I do this, Virgo looks for all the dependent JAR files like DBCP jars outside my WAR file, which fails. Is there a way to deploy the complete WAR without looking for any dependent libraries outside the web archive?
I thought WARs should be deployable in Virgo without requiring any changes. But if they're not, it should work if you add all the JARs contained in your web application to the Bundle-ClassPath manifest header. Look here. The paths should be relative to the root of your WAR, so it would contain a value similar to:
WEB-INF/classes,WEB-INF/lib/hibernate.jar,etc.
However, as the OSGi page referenced above states, you're really not gaining anything by forcing your WAR to conform to OSGi environment like that - do externalize your JARs, if for no other reason then to do away with the need for all of your applications to deploy their own copy of the same JARs.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03899 seconds