Skip to main content



      Home
Home » Eclipse Projects » Virgo » Deployment of WAR in Virgo(Class loading issues while deploying WAR file in VIRGO)
Deployment of WAR in Virgo [message #993411] Mon, 24 December 2012 04:54 Go to next message
Eclipse UserFriend
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 02:37 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Deployment of WAR in Virgo [message #993847 is a reply to message #993707] Tue, 25 December 2012 13:01 Go to previous message
Eclipse UserFriend
try to configure WABHeaders=defaulted
more info you can find here
Previous Topic:jdbc code in mysql
Next Topic:Virgo 3.6.0 Released
Goto Forum:
  


Current Time: Wed Jul 23 13:26:28 EDT 2025

Powered by FUDForum. Page generated in 0.05115 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top