Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:54 Go to next message
Sameer Pokarna is currently offline Sameer PokarnaFriend
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 Go to previous messageGo to next message
Tin N/A is currently offline Tin N/AFriend
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.
Re: Deployment of WAR in Virgo [message #993847 is a reply to message #993707] Tue, 25 December 2012 18:01 Go to previous message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 244
Registered: October 2010
Senior Member
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: Thu Nov 27 23:37:06 GMT 2014

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

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