3

Is it possible to have standard war deployment, which can be deployed on tomcat and also can be build as OSGi bundle and deployed with other bundles in OSGi container tomcat(i think virgo)?

Dimitrii
  • 116
  • 2
  • 10

2 Answers2

2

Yes, there's a good deal of interoperability between WARs and WABs. Apache Aries and WebSphere Application Server will convert WARs to WABs on deployment. This is a good way to get up and running, but it's a better practice to use proper WABs in which you build in the OSGi metadata yourself. The extra OSGi headers won't interfere with the deployment in a normal Tomcat container, so the WAB has the greatest flexibility.

For your build, you have a number of options. For example, the maven bundle plugin can be configured to build WABs, or you can use Eclipse PDE's tooling support for OSGi metadata.

Holly Cummins
  • 10,767
  • 3
  • 23
  • 25
  • 1
    I tried to deploy Jenkins as an unaltered WAR file into gemini-web. It worked, but it was amazingly slow: literally 10 minutes from initial install to serving the first HTTP request! So yeah, WABs are the way to go... – Neil Bartlett Jun 25 '12 at 11:24
  • Thank you, my primary goal is to have the option to "decorate" the war as OSGi bundle if this is possible, using some custom maven build. – Dimitrii Jun 25 '12 at 12:51
0

Pax-Url-War provides this functionality to containers like Apache Karaf. In brief, this allows you to import an URL like war:file:///path/to/myapp.war and Pax will wrap it as an OSGi bundle, optionally changing the URL root and other parameters on the fly.

Chris Dolan
  • 8,905
  • 2
  • 35
  • 73