Deploying a WAR at startup

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Deploying a WAR at startup

carl.hall-2
I have a WAR (activemqweb.war) that is included in my Sling standalone build but Felix doesn't see it when it loads other bundles.  Is this something in Felix or does Sling influence what files are loaded?

Reply | Threaded
Open this post in threaded view
|

RE: Deploying a WAR at startup

Edelson, Justin-3
Sling's BootstrapInstaller doesn't support WAR files yet. I'm 90% of the
way done with the patch to add this; just running into some broken
tests.

You can install/start bundles at runtime via the web console (or the
sling:install Maven goal).

Note that even when this patch is applied, it doesn't necessarily mean
that a standard WAR file will work, just that if a WAR file is a valid
bundle, it will be installed and started.

Justin

-----Original Message-----
From: Carl F. Hall [mailto:[hidden email]]
Sent: Tuesday, October 20, 2009 10:10 AM
To: [hidden email]
Subject: Deploying a WAR at startup

I have a WAR (activemqweb.war) that is included in my Sling standalone
build but Felix doesn't see it when it loads other bundles.  Is this
something in Felix or does Sling influence what files are loaded?

Reply | Threaded
Open this post in threaded view
|

Re: Deploying a WAR at startup

carl.hall-2
In reply to this post by carl.hall-2
I've added Pax Web Extender to my build and have maven generating the proper manifest for my WAR.  I'm definitely able to install it using the web console but need to include it in my build.

My bundle is an interesting case.  It wraps the ActiveMQ web console WAR, so that it can add the proper manifest.  Maven needs the project type to be WAR so that it can overlay the ActiveMQ WAR though the bundle is both an OSGi bundle and a WAR.

Let me know if there's anything I can help with to get your patch merged in.


----- "Justin Edelson" <[hidden email]> wrote:

> Sling's BootstrapInstaller doesn't support WAR files yet. I'm 90% of
> the
> way done with the patch to add this; just running into some broken
> tests.
>
> You can install/start bundles at runtime via the web console (or the
> sling:install Maven goal).
>
> Note that even when this patch is applied, it doesn't necessarily
> mean
> that a standard WAR file will work, just that if a WAR file is a
> valid
> bundle, it will be installed and started.
>
> Justin
>
> -----Original Message-----
> From: Carl F. Hall [mailto:[hidden email]]
> Sent: Tuesday, October 20, 2009 10:10 AM
> To: [hidden email]
> Subject: Deploying a WAR at startup
>
> I have a WAR (activemqweb.war) that is included in my Sling
> standalone
> build but Felix doesn't see it when it loads other bundles.  Is this
> something in Felix or does Sling influence what files are loaded?

Reply | Threaded
Open this post in threaded view
|

Re: Deploying a WAR at startup

carl.hall-2
For the meantime, I've added a couple of ant tasks to my maven build that copies the war to a jar and installs it to my maven repo.  This jar copy of the war is included in my build and is working fine.


----- "carl hall" <[hidden email]> wrote:

> I've added Pax Web Extender to my build and have maven generating the
> proper manifest for my WAR.  I'm definitely able to install it using
> the web console but need to include it in my build.
>
> My bundle is an interesting case.  It wraps the ActiveMQ web console
> WAR, so that it can add the proper manifest.  Maven needs the project
> type to be WAR so that it can overlay the ActiveMQ WAR though the
> bundle is both an OSGi bundle and a WAR.
>
> Let me know if there's anything I can help with to get your patch
> merged in.
>
>
> ----- "Justin Edelson" <[hidden email]> wrote:
>
> > Sling's BootstrapInstaller doesn't support WAR files yet. I'm 90% of
> > the
> > way done with the patch to add this; just running into some broken
> > tests.
> >
> > You can install/start bundles at runtime via the web console (or the
> > sling:install Maven goal).
> >
> > Note that even when this patch is applied, it doesn't necessarily
> > mean
> > that a standard WAR file will work, just that if a WAR file is a
> > valid
> > bundle, it will be installed and started.
> >
> > Justin
> >
> > -----Original Message-----
> > From: Carl F. Hall [mailto:[hidden email]]
> > Sent: Tuesday, October 20, 2009 10:10 AM
> > To: [hidden email]
> > Subject: Deploying a WAR at startup
> >
> > I have a WAR (activemqweb.war) that is included in my Sling
> > standalone
> > build but Felix doesn't see it when it loads other bundles.  Is this
> > something in Felix or does Sling influence what files are loaded?

Reply | Threaded
Open this post in threaded view
|

Re: Deploying a WAR at startup

Edelson, Justin-3
I'm surprised that works, but I'm not really familiar with the pax web  
extender. In any case, I've submitted the patch. The issue is  
SLING-1157.

Justin

On Oct 20, 2009, at 5:31 PM, "Carl F. Hall" <[hidden email]>  
wrote:

> For the meantime, I've added a couple of ant tasks to my maven build  
> that copies the war to a jar and installs it to my maven repo.  This  
> jar copy of the war is included in my build and is working fine.
>
>
> ----- "carl hall" <[hidden email]> wrote:
>
>> I've added Pax Web Extender to my build and have maven generating the
>> proper manifest for my WAR.  I'm definitely able to install it using
>> the web console but need to include it in my build.
>>
>> My bundle is an interesting case.  It wraps the ActiveMQ web console
>> WAR, so that it can add the proper manifest.  Maven needs the project
>> type to be WAR so that it can overlay the ActiveMQ WAR though the
>> bundle is both an OSGi bundle and a WAR.
>>
>> Let me know if there's anything I can help with to get your patch
>> merged in.
>>
>>
>> ----- "Justin Edelson" <[hidden email]> wrote:
>>
>>> Sling's BootstrapInstaller doesn't support WAR files yet. I'm 90% of
>>> the
>>> way done with the patch to add this; just running into some broken
>>> tests.
>>>
>>> You can install/start bundles at runtime via the web console (or the
>>> sling:install Maven goal).
>>>
>>> Note that even when this patch is applied, it doesn't necessarily
>>> mean
>>> that a standard WAR file will work, just that if a WAR file is a
>>> valid
>>> bundle, it will be installed and started.
>>>
>>> Justin
>>>
>>> -----Original Message-----
>>> From: Carl F. Hall [mailto:[hidden email]]
>>> Sent: Tuesday, October 20, 2009 10:10 AM
>>> To: [hidden email]
>>> Subject: Deploying a WAR at startup
>>>
>>> I have a WAR (activemqweb.war) that is included in my Sling
>>> standalone
>>> build but Felix doesn't see it when it loads other bundles.  Is this
>>> something in Felix or does Sling influence what files are loaded?

Reply | Threaded
Open this post in threaded view
|

Re: Deploying a WAR at startup

carl.hall-2
I looked through the patch for SLING-1157 and it looks to be just what I need.  Thanks for submitting that.

For those that find this thread later, the reason why this works is that war produced by my build has a proper OSGi bundle manifest in it as well as all the needed bits to be a proper webapp.  Felix uses the manifest to load everything in OSGi.  Pax Web sees a bundle has been loaded that contains WEB-INF/web.xml and processes it as a webapp.  Since Sling, pre-1157, processes jar files, it's just a matter of renaming the artifact.

In Java syntax:

class TheArtifactFromMyBuild implements OSGiBundle, WebApp;

:-)


----- "Justin Edelson" <[hidden email]> wrote:

> I'm surprised that works, but I'm not really familiar with the pax web
>  
> extender. In any case, I've submitted the patch. The issue is  
> SLING-1157.
>
> Justin
>
> On Oct 20, 2009, at 5:31 PM, "Carl F. Hall" <[hidden email]>
>
> wrote:
>
> > For the meantime, I've added a couple of ant tasks to my maven build
>  
> > that copies the war to a jar and installs it to my maven repo.  This
>  
> > jar copy of the war is included in my build and is working fine.
> >
> >
> > ----- "carl hall" <[hidden email]> wrote:
> >
> >> I've added Pax Web Extender to my build and have maven generating
> the
> >> proper manifest for my WAR.  I'm definitely able to install it
> using
> >> the web console but need to include it in my build.
> >>
> >> My bundle is an interesting case.  It wraps the ActiveMQ web
> console
> >> WAR, so that it can add the proper manifest.  Maven needs the
> project
> >> type to be WAR so that it can overlay the ActiveMQ WAR though the
> >> bundle is both an OSGi bundle and a WAR.
> >>
> >> Let me know if there's anything I can help with to get your patch
> >> merged in.
> >>
> >>
> >> ----- "Justin Edelson" <[hidden email]> wrote:
> >>
> >>> Sling's BootstrapInstaller doesn't support WAR files yet. I'm 90%
> of
> >>> the
> >>> way done with the patch to add this; just running into some
> broken
> >>> tests.
> >>>
> >>> You can install/start bundles at runtime via the web console (or
> the
> >>> sling:install Maven goal).
> >>>
> >>> Note that even when this patch is applied, it doesn't necessarily
> >>> mean
> >>> that a standard WAR file will work, just that if a WAR file is a
> >>> valid
> >>> bundle, it will be installed and started.
> >>>
> >>> Justin
> >>>
> >>> -----Original Message-----
> >>> From: Carl F. Hall [mailto:[hidden email]]
> >>> Sent: Tuesday, October 20, 2009 10:10 AM
> >>> To: [hidden email]
> >>> Subject: Deploying a WAR at startup
> >>>
> >>> I have a WAR (activemqweb.war) that is included in my Sling
> >>> standalone
> >>> build but Felix doesn't see it when it loads other bundles.  Is
> this
> >>> something in Felix or does Sling influence what files are loaded?

Reply | Threaded
Open this post in threaded view
|

RE: Deploying a WAR at startup

Edelson, Justin-3
So the pax web extender uses the presence of WEB-INF/web.xml to identify a potential WAR bundle? Interesting. Spring DM's web extender actually wants the file to be named <something>.war.
 
Justin

________________________________

From: Carl F. Hall [mailto:[hidden email]]
Sent: Tue 10/20/2009 6:32 PM
To: [hidden email]
Subject: Re: Deploying a WAR at startup



I looked through the patch for SLING-1157 and it looks to be just what I need.  Thanks for submitting that.

For those that find this thread later, the reason why this works is that war produced by my build has a proper OSGi bundle manifest in it as well as all the needed bits to be a proper webapp.  Felix uses the manifest to load everything in OSGi.  Pax Web sees a bundle has been loaded that contains WEB-INF/web.xml and processes it as a webapp.  Since Sling, pre-1157, processes jar files, it's just a matter of renaming the artifact.

In Java syntax:

class TheArtifactFromMyBuild implements OSGiBundle, WebApp;

:-)


----- "Justin Edelson" <[hidden email]> wrote:

> I'm surprised that works, but I'm not really familiar with the pax web
>
> extender. In any case, I've submitted the patch. The issue is
> SLING-1157.
>
> Justin
>
> On Oct 20, 2009, at 5:31 PM, "Carl F. Hall" <[hidden email]>
>
> wrote:
>
> > For the meantime, I've added a couple of ant tasks to my maven build
>
> > that copies the war to a jar and installs it to my maven repo.  This
>
> > jar copy of the war is included in my build and is working fine.
> >
> >
> > ----- "carl hall" <[hidden email]> wrote:
> >
> >> I've added Pax Web Extender to my build and have maven generating
> the
> >> proper manifest for my WAR.  I'm definitely able to install it
> using
> >> the web console but need to include it in my build.
> >>
> >> My bundle is an interesting case.  It wraps the ActiveMQ web
> console
> >> WAR, so that it can add the proper manifest.  Maven needs the
> project
> >> type to be WAR so that it can overlay the ActiveMQ WAR though the
> >> bundle is both an OSGi bundle and a WAR.
> >>
> >> Let me know if there's anything I can help with to get your patch
> >> merged in.
> >>
> >>
> >> ----- "Justin Edelson" <[hidden email]> wrote:
> >>
> >>> Sling's BootstrapInstaller doesn't support WAR files yet. I'm 90%
> of
> >>> the
> >>> way done with the patch to add this; just running into some
> broken
> >>> tests.
> >>>
> >>> You can install/start bundles at runtime via the web console (or
> the
> >>> sling:install Maven goal).
> >>>
> >>> Note that even when this patch is applied, it doesn't necessarily
> >>> mean
> >>> that a standard WAR file will work, just that if a WAR file is a
> >>> valid
> >>> bundle, it will be installed and started.
> >>>
> >>> Justin
> >>>
> >>> -----Original Message-----
> >>> From: Carl F. Hall [mailto:[hidden email]]
> >>> Sent: Tuesday, October 20, 2009 10:10 AM
> >>> To: [hidden email]
> >>> Subject: Deploying a WAR at startup
> >>>
> >>> I have a WAR (activemqweb.war) that is included in my Sling
> >>> standalone
> >>> build but Felix doesn't see it when it loads other bundles.  Is
> this
> >>> something in Felix or does Sling influence what files are loaded?