You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by jtkb <ka...@avionicengineers.com> on 2015/07/02 23:21:47 UTC

Construct a Web Application From Multiple Bundles

Hi,

I've been using/learning/experimenting using Apache Karaf and Pax Web 3.X to
deploy a web application.

What I would like to do now is be able to split my web application across
several OSGi bundles, similar to what  Virgo Snaps
<https://www.eclipse.org/virgo/documentation/virgo-documentation-3.5.0.RELEASE/docs/snaps-guide/htmlsingle/virgo-snaps-guide.html>  
allows to be done.

As far as I am aware, although I can make the Java code visible to other
Java code in another bundle, web content/pages is not. I want to structure
my bundles with a parent bundle provides a 'base' web-page frame work into
which is can load/display web pages/content from child bundles if/as they
become available. Based upon my understanding above, this means that the
parent bundle needs to be able to access content in it's child bundles.

My question is, is this possible to do this with Karaf and Pax web as they
stand? So far I believe that each web bundle is in isolation to one another
i.e. no visibility.



--
View this message in context: http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: pax web error on bundle install

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

anything special of the war file you just droped in there?
could you open an issue for this, makes it easier to track.

regards, Achim


2015-07-06 14:33 GMT+02:00 <de...@mobigov.com>:

>
>
> The first time I drop my bundle into deploy it does not start correctly.
> The following error is the one that I am getting.  After a karaf restart
> though everything starts and works fine.
>
>
>
> ERROR: Bundle org.ops4j.pax.web.pax-web-extender-whiteboard [117]
> EventDispatcher: Error during dispatch. (java.lang.IllegalStateException:
> Invalid BundleContext.)
> java.lang.IllegalStateException: Invalid BundleContext.
>     at
> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
>     at
> org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
>     at
> org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService$Customizer.removedService(ReplaceableService.java:110)
>     at
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
>     at
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)
>     at
> org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
>     at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:377)
>     at
> org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService.stop(ReplaceableService.java:55)
>     at
> org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.stop(WebApplication.java:119)
>     at
> org.ops4j.pax.web.extender.whiteboard.internal.ExtenderContext.removeWebApplication(ExtenderContext.java:86)
>     at
> org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.removedService(AbstractTracker.java:211)
>     at
> org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.removedService(AbstractTracker.java:42)
>     at
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
>     at
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)
>     at
> org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
>     at
> org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:909)
>     at
> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:987)
>     at
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
>     at
> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
>     at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4560)
>     at org.apache.felix.framework.Felix.access$000(Felix.java:106)
>     at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:419)
>     at
> org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:171)
>     at
> org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
>     at
> org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:236)
>     at org.apache.felix.framework.Felix.activateBundle(Felix.java:2249)
>     at org.apache.felix.framework.Felix.startBundle(Felix.java:2138)
>     at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:977)
>     at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:964)
>     at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1189)
>     at
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:830)
>     at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1079)
>     at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:975)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>     at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>     at java.lang.Thread.run(Thread.java:745)
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

pax web error on bundle install

Posted by de...@mobigov.com.
 

The first time I drop my bundle into deploy it does not start correctly.
The following error is the one that I am getting. After a karaf restart
though everything starts and works fine. 

ERROR: Bundle org.ops4j.pax.web.pax-web-extender-whiteboard [117]
EventDispatcher: Error during dispatch.
(java.lang.IllegalStateException: Invalid BundleContext.)
java.lang.IllegalStateException: Invalid BundleContext.
 at
org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
 at
org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
 at
org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService$Customizer.removedService(ReplaceableService.java:110)
 at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
 at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)
 at
org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
 at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:377)
 at
org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService.stop(ReplaceableService.java:55)
 at
org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.stop(WebApplication.java:119)
 at
org.ops4j.pax.web.extender.whiteboard.internal.ExtenderContext.removeWebApplication(ExtenderContext.java:86)
 at
org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.removedService(AbstractTracker.java:211)
 at
org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.removedService(AbstractTracker.java:42)
 at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
 at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)
 at
org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
 at
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:909)
 at
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:987)
 at
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
 at
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
 at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4560)
 at org.apache.felix.framework.Felix.access$000(Felix.java:106)
 at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:419)
 at
org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:171)
 at
org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
 at
org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:236)
 at org.apache.felix.framework.Felix.activateBundle(Felix.java:2249)
 at org.apache.felix.framework.Felix.startBundle(Felix.java:2138)
 at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:977)
 at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:964)
 at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1189)
 at
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:830)
 at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1079)
 at
org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:975)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745) 

Re: Construct a Web Application From Multiple Bundles

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Nick,

you can find a sample for a shared context at the pax-web integration tests
[1]

regards, Achim

[1] -
https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-itest/pax-web-itest-container/pax-web-itest-container-jetty/src/test/java/org/ops4j/pax/web/itest/jetty/SharedContextFilterIntegrationTest.java


2015-07-15 23:04 GMT+02:00 Nick Baker <nb...@pentaho.com>:

>  Can someone direct me to the changes to the HTTP Service which make this
> possible? How did they handle the getResource method with a shared
> HTTPContext? We're investigating exactly this scenario now.
>
>  Thanks,
>  Nick
>
>    *From: *Achim Nierbeck
> *Sent: *Wednesday, July 15, 2015 4:59 PM
> *To: *user@karaf.apache.org
> *Reply To: *user@karaf.apache.org
> *Subject: *Re: Construct a Web Application From Multiple Bundles
>
>  Hi,
>
>  never tried to run Pax-Web 4 with Karaf 3.0.2 but if you do it you won't
> have the web and http commands available.
> AFAIK Karaf 4 and JPA shouldn't be of an issue, you might need to make
> sure you have the right version of it installed though.
>
>  You should give it a try :-)
>
>  regards, Achim
>
>
> 2015-07-15 22:20 GMT+02:00 jtkb <ka...@avionicengineers.com>:
>
>> Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
>>  Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
>
>  --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
>  Software Architect / Project Manager / Scrum Master
>
>


-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Construct a Web Application From Multiple Bundles

Posted by Nick Baker <nb...@pentaho.com>.
Can someone direct me to the changes to the HTTP Service which make this possible? How did they handle the getResource method with a shared HTTPContext? We're investigating exactly this scenario now.

Thanks,
Nick

From: Achim Nierbeck
Sent: Wednesday, July 15, 2015 4:59 PM
To: user@karaf.apache.org
Reply To: user@karaf.apache.org
Subject: Re: Construct a Web Application From Multiple Bundles


Hi,

never tried to run Pax-Web 4 with Karaf 3.0.2 but if you do it you won't have the web and http commands available.
AFAIK Karaf 4 and JPA shouldn't be of an issue, you might need to make sure you have the right version of it installed though.

You should give it a try :-)

regards, Achim


2015-07-15 22:20 GMT+02:00 jtkb <ka...@avionicengineers.com>>:
Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.



--
View this message in context: http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master


Re: Construct a Web Application From Multiple Bundles

Posted by jtkb <ka...@avionicengineers.com>.
Thanks for the links to the mailing list Achim!
On 20/07/15 09:39, Achim Nierbeck [via Karaf] wrote:
> Hi Kerry,
>
>     Hi Achim,
>
>     Thanks for your reply. I did think it might be a little difficult and
>     especially as I've only a small amount of experience with web
>     applications etc.
>
>
> I'm sure it can be done, just the way to get there might be bit bumpy ;)
>
>
>     I'll think on the answers you provided and search the mailing list
>     archive for the thread you mentioned. I appreciate yours and all those
>     involved with Karaf help and advice when I as a user get a problem. In
>     fact I sometimes wonder if you get to go to sleep as you sometimes
>     seem
>     to answer at all hours of the day (and night!)
>
>
> hehe, yeah sometimes it might seem that way.
> It's a pleasure to help people to get on track :)
> btw. the mailinglist I had in mind (as I didn't realize it's the karaf 
> one we are talking on right now)
> is the ops4j mailinglist [1].
> The thread is actually this one: [2]
>
> regards, Achim
>
> [1] - https://groups.google.com/forum/#!forum/ops4j 
> <https://groups.google.com/forum/#%21forum/ops4j>
> [2] - 
> https://groups.google.com/forum/#!searchin/ops4j/template/ops4j/1uDM8SVKzNo/jC2eDoIEV8cJ 
> <https://groups.google.com/forum/#%21searchin/ops4j/template/ops4j/1uDM8SVKzNo/jC2eDoIEV8cJ>
>
>     Regards
>
>     Kerry
>
>     On 20/07/15 08:46, Achim Nierbeck [via Karaf] wrote:
>     > Hi, Kerry,
>     >
>     > ouch you want to use JSF ... since JSF is doing stuff a lot
>     different
>     > then all other web-based applications, especially lots of
>     classforname
>     > search.
>     > This will make it much more complicated
>     > Besides that, it might be doable, I just don't use JSF a lot so we
>     > might go into the undiscovered-country here ;-)
>     >
>     > Thinking about this, I could see different ways of getting there.
>     >
>     > One way, start with a wab and extend it with web-fragments, this is
>     > the way it'll work in any Servlet3 container and should work for
>     > Pax-Web too.
>     > ("should" could mean, there might be a missing feature in pax-web
>     > which I'm not aware of right now)
>     > The other way would require to register the JSF Listener either
>     > through the webcontainer service or as a service so the
>     > Whiteboard-Extender can pick it up.
>     > Again I think due to the nature of JSF/JSPs and Taglibs this
>     might be
>     > a bigger hassle. BUT I've seen a thread on this mailinglist
>     where one
>     > was doing something similar and registering resources as such, with
>     > some tweaking I think. So it can be done.
>     >
>     > regards, Achim
>     >
>     > 2015-07-19 22:19 GMT+02:00 jtkb <[hidden email]
>     > </user/SendEmail.jtp?type=node&node=4041501&i=0>>:
>     >
>     >     Hi Achim,
>     >
>     >     You mentioned previously that I could use Pax-Web
>     WebContainer to
>     >     possibly achieve 'loadable' child OSGi bundles (contain web
>     pages etc)
>     >     into a Parent/base page.
>     >
>     >     I've been looking at the 'helloword-wc' sample to see how to use
>     >     WebContainer. I should have mentioned I want to use JSF in child
>     >     bundles
>     >     and I assume this is possible as I can call
>     >     WebContainer.registerServlet() with an instance of
>     >     javax.faces.webapp.FacesServlet instead? Is there anything
>     else I
>     >     particularly need to do using JSF (other than having JSF support
>     >     installed)? I did wonder if I need to call
>     >     WebContainer.registerJsps() too?
>     >
>     >     Regards
>     >
>     >     Kerry
>     >
>     >     On 15/07/15 21:59, Achim Nierbeck [via Karaf] wrote:
>     >     > Hi,
>     >     >
>     >     > never tried to run Pax-Web 4 with Karaf 3.0.2 but if you
>     do it you
>     >     > won't have the web and http commands available.
>     >     > AFAIK Karaf 4 and JPA shouldn't be of an issue, you might need
>     >     to make
>     >     > sure you have the right version of it installed though.
>     >     >
>     >     > You should give it a try :-)
>     >     >
>     >     > regards, Achim
>     >     >
>     >     > 2015-07-15 22:20 GMT+02:00 jtkb <[hidden email]
>     >     > </user/SendEmail.jtp?type=node&node=4041442&i=0>>:
>     >     >
>     >     >     Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.
>     >     >
>     >     >
>     >     >
>     >     >     --
>     >     >     View this message in context:
>     >     >
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
>     >     >     Sent from the Karaf - User mailing list archive at Nabble.com.
>     >     >
>     >     >
>     >     >
>     >     >
>     >     > --
>     >     >
>     >     > Apache Member
>     >     > Apache Karaf <http://karaf.apache.org/> Committer & PMC
>     >     > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>     >     > Committer & Project Lead
>     >     > blog <http://notizblog.nierbeck.de/>
>     >     > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>     >     >
>     >     > Software Architect / Project Manager / Scrum Master
>     >     >
>     >     >
>     >     >
>     >     >
>     >
>      ------------------------------------------------------------------------
>     >     > If you reply to this email, your message will be added to the
>     >     > discussion below:
>     >     >
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041442.html
>     >     >
>     >     > To start a new topic under Karaf - User, email
>     >     > [hidden email]
>     </user/SendEmail.jtp?type=node&node=4041501&i=1>
>     >     > To unsubscribe from Construct a Web Application From Multiple
>     >     Bundles,
>     >     > click here
>     >     > <> NAML
>     >     >
>     >   
>      <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>     >     >
>     >
>     >
>     >
>     >
>     >
>     >     --
>     >     View this message in context:
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041496.html
>     >     Sent from the Karaf - User mailing list archive at Nabble.com.
>     >
>     >
>     >
>     >
>     > --
>     >
>     > Apache Member
>     > Apache Karaf <http://karaf.apache.org/> Committer & PMC
>     > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>     > Committer & Project Lead
>     > blog <http://notizblog.nierbeck.de/>
>     > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>     >
>     > Software Architect / Project Manager / Scrum Master
>     >
>     >
>     >
>     >
>     ------------------------------------------------------------------------
>     > If you reply to this email, your message will be added to the
>     > discussion below:
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041501.html
>     >
>     > To start a new topic under Karaf - User, email
>     >[hidden email] </user/SendEmail.jtp?type=node&node=4041503&i=0>
>     > To unsubscribe from Construct a Web Application From Multiple
>     Bundles,
>     > click here
>     > <> NAML
>     >
>     <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>     >
>
>
>
>
>
>     --
>     View this message in context:
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041502.html
>     Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>
>
> -- 
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> 
> Committer & Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041503.html 
>
> To start a new topic under Karaf - User, email 
> ml-node+s922171n930749h87@n3.nabble.com
> To unsubscribe from Construct a Web Application From Multiple Bundles, 
> click here 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4041252&code=a2FyYWZAYXZpb25pY2VuZ2luZWVycy5jb218NDA0MTI1MnwxOTU3MjI4MTQ3>.
> NAML 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041505.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Construct a Web Application From Multiple Bundles

Posted by jtkb <ka...@avionicengineers.com>.
Hi Achim,

I'm having a few problems understanding how I can create a web-fragment 
bundle which includes JSF. I can create something based upon the Pax-Web 
samples project 'war-jsf', with the POM similar and I just use 
<web-fragment> tags instead of <web>. The bundle deploys however when I 
go to view the pages I get the raw JSF i.e. it's not been processed. 
I've looked at the web-fragment example too and this is a little 
different as it uses JSP and not JSF. It also builds a JAR instead of a 
WAR but this shouldn't really make much difference?

I'm a little confused how to structure a bundle to deploy JSF pages as a 
web-fragment, any pointers?

Thanks

Kerry
On 20/07/15 09:39, Achim Nierbeck [via Karaf] wrote:
> Hi Kerry,
>
>     Hi Achim,
>
>     Thanks for your reply. I did think it might be a little difficult and
>     especially as I've only a small amount of experience with web
>     applications etc.
>
>
> I'm sure it can be done, just the way to get there might be bit bumpy ;)
>
>
>     I'll think on the answers you provided and search the mailing list
>     archive for the thread you mentioned. I appreciate yours and all those
>     involved with Karaf help and advice when I as a user get a problem. In
>     fact I sometimes wonder if you get to go to sleep as you sometimes
>     seem
>     to answer at all hours of the day (and night!)
>
>
> hehe, yeah sometimes it might seem that way.
> It's a pleasure to help people to get on track :)
> btw. the mailinglist I had in mind (as I didn't realize it's the karaf 
> one we are talking on right now)
> is the ops4j mailinglist [1].
> The thread is actually this one: [2]
>
> regards, Achim
>
> [1] - https://groups.google.com/forum/#!forum/ops4j 
> <https://groups.google.com/forum/#%21forum/ops4j>
> [2] - 
> https://groups.google.com/forum/#!searchin/ops4j/template/ops4j/1uDM8SVKzNo/jC2eDoIEV8cJ 
> <https://groups.google.com/forum/#%21searchin/ops4j/template/ops4j/1uDM8SVKzNo/jC2eDoIEV8cJ>
>
>     Regards
>
>     Kerry
>
>     On 20/07/15 08:46, Achim Nierbeck [via Karaf] wrote:
>     > Hi, Kerry,
>     >
>     > ouch you want to use JSF ... since JSF is doing stuff a lot
>     different
>     > then all other web-based applications, especially lots of
>     classforname
>     > search.
>     > This will make it much more complicated
>     > Besides that, it might be doable, I just don't use JSF a lot so we
>     > might go into the undiscovered-country here ;-)
>     >
>     > Thinking about this, I could see different ways of getting there.
>     >
>     > One way, start with a wab and extend it with web-fragments, this is
>     > the way it'll work in any Servlet3 container and should work for
>     > Pax-Web too.
>     > ("should" could mean, there might be a missing feature in pax-web
>     > which I'm not aware of right now)
>     > The other way would require to register the JSF Listener either
>     > through the webcontainer service or as a service so the
>     > Whiteboard-Extender can pick it up.
>     > Again I think due to the nature of JSF/JSPs and Taglibs this
>     might be
>     > a bigger hassle. BUT I've seen a thread on this mailinglist
>     where one
>     > was doing something similar and registering resources as such, with
>     > some tweaking I think. So it can be done.
>     >
>     > regards, Achim
>     >
>     > 2015-07-19 22:19 GMT+02:00 jtkb <[hidden email]
>     > </user/SendEmail.jtp?type=node&node=4041501&i=0>>:
>     >
>     >     Hi Achim,
>     >
>     >     You mentioned previously that I could use Pax-Web
>     WebContainer to
>     >     possibly achieve 'loadable' child OSGi bundles (contain web
>     pages etc)
>     >     into a Parent/base page.
>     >
>     >     I've been looking at the 'helloword-wc' sample to see how to use
>     >     WebContainer. I should have mentioned I want to use JSF in child
>     >     bundles
>     >     and I assume this is possible as I can call
>     >     WebContainer.registerServlet() with an instance of
>     >     javax.faces.webapp.FacesServlet instead? Is there anything
>     else I
>     >     particularly need to do using JSF (other than having JSF support
>     >     installed)? I did wonder if I need to call
>     >     WebContainer.registerJsps() too?
>     >
>     >     Regards
>     >
>     >     Kerry
>     >
>     >     On 15/07/15 21:59, Achim Nierbeck [via Karaf] wrote:
>     >     > Hi,
>     >     >
>     >     > never tried to run Pax-Web 4 with Karaf 3.0.2 but if you
>     do it you
>     >     > won't have the web and http commands available.
>     >     > AFAIK Karaf 4 and JPA shouldn't be of an issue, you might need
>     >     to make
>     >     > sure you have the right version of it installed though.
>     >     >
>     >     > You should give it a try :-)
>     >     >
>     >     > regards, Achim
>     >     >
>     >     > 2015-07-15 22:20 GMT+02:00 jtkb <[hidden email]
>     >     > </user/SendEmail.jtp?type=node&node=4041442&i=0>>:
>     >     >
>     >     >     Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.
>     >     >
>     >     >
>     >     >
>     >     >     --
>     >     >     View this message in context:
>     >     >
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
>     >     >     Sent from the Karaf - User mailing list archive at Nabble.com.
>     >     >
>     >     >
>     >     >
>     >     >
>     >     > --
>     >     >
>     >     > Apache Member
>     >     > Apache Karaf <http://karaf.apache.org/> Committer & PMC
>     >     > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>     >     > Committer & Project Lead
>     >     > blog <http://notizblog.nierbeck.de/>
>     >     > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>     >     >
>     >     > Software Architect / Project Manager / Scrum Master
>     >     >
>     >     >
>     >     >
>     >     >
>     >
>      ------------------------------------------------------------------------
>     >     > If you reply to this email, your message will be added to the
>     >     > discussion below:
>     >     >
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041442.html
>     >     >
>     >     > To start a new topic under Karaf - User, email
>     >     > [hidden email]
>     </user/SendEmail.jtp?type=node&node=4041501&i=1>
>     >     > To unsubscribe from Construct a Web Application From Multiple
>     >     Bundles,
>     >     > click here
>     >     > <> NAML
>     >     >
>     >   
>      <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>     >     >
>     >
>     >
>     >
>     >
>     >
>     >     --
>     >     View this message in context:
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041496.html
>     >     Sent from the Karaf - User mailing list archive at Nabble.com.
>     >
>     >
>     >
>     >
>     > --
>     >
>     > Apache Member
>     > Apache Karaf <http://karaf.apache.org/> Committer & PMC
>     > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>     > Committer & Project Lead
>     > blog <http://notizblog.nierbeck.de/>
>     > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>     >
>     > Software Architect / Project Manager / Scrum Master
>     >
>     >
>     >
>     >
>     ------------------------------------------------------------------------
>     > If you reply to this email, your message will be added to the
>     > discussion below:
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041501.html
>     >
>     > To start a new topic under Karaf - User, email
>     >[hidden email] </user/SendEmail.jtp?type=node&node=4041503&i=0>
>     > To unsubscribe from Construct a Web Application From Multiple
>     Bundles,
>     > click here
>     > <> NAML
>     >
>     <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>     >
>
>
>
>
>
>     --
>     View this message in context:
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041502.html
>     Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>
>
> -- 
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> 
> Committer & Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041503.html 
>
> To start a new topic under Karaf - User, email 
> ml-node+s922171n930749h87@n3.nabble.com
> To unsubscribe from Construct a Web Application From Multiple Bundles, 
> click here 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4041252&code=a2FyYWZAYXZpb25pY2VuZ2luZWVycy5jb218NDA0MTI1MnwxOTU3MjI4MTQ3>.
> NAML 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041659.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Construct a Web Application From Multiple Bundles

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Kerry,


> Hi Achim,
>
> Thanks for your reply. I did think it might be a little difficult and
> especially as I've only a small amount of experience with web
> applications etc.
>

I'm sure it can be done, just the way to get there might be bit bumpy ;)


>
> I'll think on the answers you provided and search the mailing list
> archive for the thread you mentioned. I appreciate yours and all those
> involved with Karaf help and advice when I as a user get a problem. In
> fact I sometimes wonder if you get to go to sleep as you sometimes seem
> to answer at all hours of the day (and night!)
>
>
hehe, yeah sometimes it might seem that way.
It's a pleasure to help people to get on track :)
btw. the mailinglist I had in mind (as I didn't realize it's the karaf one
we are talking on right now)
is the ops4j mailinglist [1].
The thread is actually this one: [2]

regards, Achim

[1] - https://groups.google.com/forum/#!forum/ops4j
[2] -
https://groups.google.com/forum/#!searchin/ops4j/template/ops4j/1uDM8SVKzNo/jC2eDoIEV8cJ


> Regards
>
> Kerry
>
> On 20/07/15 08:46, Achim Nierbeck [via Karaf] wrote:
> > Hi, Kerry,
> >
> > ouch you want to use JSF ... since JSF is doing stuff a lot different
> > then all other web-based applications, especially lots of classforname
> > search.
> > This will make it much more complicated
> > Besides that, it might be doable, I just don't use JSF a lot so we
> > might go into the undiscovered-country here ;-)
> >
> > Thinking about this, I could see different ways of getting there.
> >
> > One way, start with a wab and extend it with web-fragments, this is
> > the way it'll work in any Servlet3 container and should work for
> > Pax-Web too.
> > ("should" could mean, there might be a missing feature in pax-web
> > which I'm not aware of right now)
> > The other way would require to register the JSF Listener either
> > through the webcontainer service or as a service so the
> > Whiteboard-Extender can pick it up.
> > Again I think due to the nature of JSF/JSPs and Taglibs this might be
> > a bigger hassle. BUT I've seen a thread on this mailinglist where one
> > was doing something similar and registering resources as such, with
> > some tweaking I think. So it can be done.
> >
> > regards, Achim
> >
> > 2015-07-19 22:19 GMT+02:00 jtkb <[hidden email]
> > </user/SendEmail.jtp?type=node&node=4041501&i=0>>:
> >
> >     Hi Achim,
> >
> >     You mentioned previously that I could use Pax-Web WebContainer to
> >     possibly achieve 'loadable' child OSGi bundles (contain web pages
> etc)
> >     into a Parent/base page.
> >
> >     I've been looking at the 'helloword-wc' sample to see how to use
> >     WebContainer. I should have mentioned I want to use JSF in child
> >     bundles
> >     and I assume this is possible as I can call
> >     WebContainer.registerServlet() with an instance of
> >     javax.faces.webapp.FacesServlet instead? Is there anything else I
> >     particularly need to do using JSF (other than having JSF support
> >     installed)? I did wonder if I need to call
> >     WebContainer.registerJsps() too?
> >
> >     Regards
> >
> >     Kerry
> >
> >     On 15/07/15 21:59, Achim Nierbeck [via Karaf] wrote:
> >     > Hi,
> >     >
> >     > never tried to run Pax-Web 4 with Karaf 3.0.2 but if you do it you
> >     > won't have the web and http commands available.
> >     > AFAIK Karaf 4 and JPA shouldn't be of an issue, you might need
> >     to make
> >     > sure you have the right version of it installed though.
> >     >
> >     > You should give it a try :-)
> >     >
> >     > regards, Achim
> >     >
> >     > 2015-07-15 22:20 GMT+02:00 jtkb <[hidden email]
> >     > </user/SendEmail.jtp?type=node&node=4041442&i=0>>:
> >     >
> >     >     Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.
> >     >
> >     >
> >     >
> >     >     --
> >     >     View this message in context:
> >     >
> >
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
> >     >     Sent from the Karaf - User mailing list archive at Nabble.com.
> >     >
> >     >
> >     >
> >     >
> >     > --
> >     >
> >     > Apache Member
> >     > Apache Karaf <http://karaf.apache.org/> Committer & PMC
> >     > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
> >     > Committer & Project Lead
> >     > blog <http://notizblog.nierbeck.de/>
> >     > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> >     >
> >     > Software Architect / Project Manager / Scrum Master
> >     >
> >     >
> >     >
> >     >
> >
>  ------------------------------------------------------------------------
> >     > If you reply to this email, your message will be added to the
> >     > discussion below:
> >     >
> >
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041442.html
> >     >
> >     > To start a new topic under Karaf - User, email
> >     > [hidden email] </user/SendEmail.jtp?type=node&node=4041501&i=1>
> >     > To unsubscribe from Construct a Web Application From Multiple
> >     Bundles,
> >     > click here
> >     > <> NAML
> >     >
> >     <
> http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >     >
> >
> >
> >
> >
> >
> >     --
> >     View this message in context:
> >
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041496.html
> >     Sent from the Karaf - User mailing list archive at Nabble.com.
> >
> >
> >
> >
> > --
> >
> > Apache Member
> > Apache Karaf <http://karaf.apache.org/> Committer & PMC
> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
> > Committer & Project Lead
> > blog <http://notizblog.nierbeck.de/>
> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> >
> > Software Architect / Project Manager / Scrum Master
> >
> >
> >
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041501.html
> >
> > To start a new topic under Karaf - User, email
> > ml-node+s922171n930749h87@n3.nabble.com
> > To unsubscribe from Construct a Web Application From Multiple Bundles,
> > click here
> > <
> http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4041252&code=a2FyYWZAYXZpb25pY2VuZ2luZWVycy5jb218NDA0MTI1MnwxOTU3MjI4MTQ3
> >.
> > NAML
> > <
> http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041502.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Construct a Web Application From Multiple Bundles

Posted by jtkb <ka...@avionicengineers.com>.
Hi Achim,

Thanks for your reply. I did think it might be a little difficult and 
especially as I've only a small amount of experience with web 
applications etc.

I'll think on the answers you provided and search the mailing list 
archive for the thread you mentioned. I appreciate yours and all those 
involved with Karaf help and advice when I as a user get a problem. In 
fact I sometimes wonder if you get to go to sleep as you sometimes seem 
to answer at all hours of the day (and night!)

Regards

Kerry

On 20/07/15 08:46, Achim Nierbeck [via Karaf] wrote:
> Hi, Kerry,
>
> ouch you want to use JSF ... since JSF is doing stuff a lot different 
> then all other web-based applications, especially lots of classforname 
> search.
> This will make it much more complicated
> Besides that, it might be doable, I just don't use JSF a lot so we 
> might go into the undiscovered-country here ;-)
>
> Thinking about this, I could see different ways of getting there.
>
> One way, start with a wab and extend it with web-fragments, this is 
> the way it'll work in any Servlet3 container and should work for 
> Pax-Web too.
> ("should" could mean, there might be a missing feature in pax-web 
> which I'm not aware of right now)
> The other way would require to register the JSF Listener either 
> through the webcontainer service or as a service so the 
> Whiteboard-Extender can pick it up.
> Again I think due to the nature of JSF/JSPs and Taglibs this might be 
> a bigger hassle. BUT I've seen a thread on this mailinglist where one 
> was doing something similar and registering resources as such, with 
> some tweaking I think. So it can be done.
>
> regards, Achim
>
> 2015-07-19 22:19 GMT+02:00 jtkb <[hidden email] 
> </user/SendEmail.jtp?type=node&node=4041501&i=0>>:
>
>     Hi Achim,
>
>     You mentioned previously that I could use Pax-Web WebContainer to
>     possibly achieve 'loadable' child OSGi bundles (contain web pages etc)
>     into a Parent/base page.
>
>     I've been looking at the 'helloword-wc' sample to see how to use
>     WebContainer. I should have mentioned I want to use JSF in child
>     bundles
>     and I assume this is possible as I can call
>     WebContainer.registerServlet() with an instance of
>     javax.faces.webapp.FacesServlet instead? Is there anything else I
>     particularly need to do using JSF (other than having JSF support
>     installed)? I did wonder if I need to call
>     WebContainer.registerJsps() too?
>
>     Regards
>
>     Kerry
>
>     On 15/07/15 21:59, Achim Nierbeck [via Karaf] wrote:
>     > Hi,
>     >
>     > never tried to run Pax-Web 4 with Karaf 3.0.2 but if you do it you
>     > won't have the web and http commands available.
>     > AFAIK Karaf 4 and JPA shouldn't be of an issue, you might need
>     to make
>     > sure you have the right version of it installed though.
>     >
>     > You should give it a try :-)
>     >
>     > regards, Achim
>     >
>     > 2015-07-15 22:20 GMT+02:00 jtkb <[hidden email]
>     > </user/SendEmail.jtp?type=node&node=4041442&i=0>>:
>     >
>     >     Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.
>     >
>     >
>     >
>     >     --
>     >     View this message in context:
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
>     >     Sent from the Karaf - User mailing list archive at Nabble.com.
>     >
>     >
>     >
>     >
>     > --
>     >
>     > Apache Member
>     > Apache Karaf <http://karaf.apache.org/> Committer & PMC
>     > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>     > Committer & Project Lead
>     > blog <http://notizblog.nierbeck.de/>
>     > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>     >
>     > Software Architect / Project Manager / Scrum Master
>     >
>     >
>     >
>     >
>     ------------------------------------------------------------------------
>     > If you reply to this email, your message will be added to the
>     > discussion below:
>     >
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041442.html
>     >
>     > To start a new topic under Karaf - User, email
>     > [hidden email] </user/SendEmail.jtp?type=node&node=4041501&i=1>
>     > To unsubscribe from Construct a Web Application From Multiple
>     Bundles,
>     > click here
>     > <> NAML
>     >
>     <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>     >
>
>
>
>
>
>     --
>     View this message in context:
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041496.html
>     Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>
>
> -- 
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> 
> Committer & Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041501.html 
>
> To start a new topic under Karaf - User, email 
> ml-node+s922171n930749h87@n3.nabble.com
> To unsubscribe from Construct a Web Application From Multiple Bundles, 
> click here 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4041252&code=a2FyYWZAYXZpb25pY2VuZ2luZWVycy5jb218NDA0MTI1MnwxOTU3MjI4MTQ3>.
> NAML 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041502.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Construct a Web Application From Multiple Bundles

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi, Kerry,

ouch you want to use JSF ... since JSF is doing stuff a lot different then
all other web-based applications, especially lots of classforname search.
This will make it much more complicated
Besides that, it might be doable, I just don't use JSF a lot so we might go
into the undiscovered-country here ;-)

Thinking about this, I could see different ways of getting there.

One way, start with a wab and extend it with web-fragments, this is the way
it'll work in any Servlet3 container and should work for Pax-Web too.
("should" could mean, there might be a missing feature in pax-web which I'm
not aware of right now)
The other way would require to register the JSF Listener either through the
webcontainer service or as a service so the Whiteboard-Extender can pick it
up.
Again I think due to the nature of JSF/JSPs and Taglibs this might be a
bigger hassle. BUT I've seen a thread on this mailinglist where one was
doing something similar and registering resources as such, with some
tweaking I think. So it can be done.

regards, Achim

2015-07-19 22:19 GMT+02:00 jtkb <ka...@avionicengineers.com>:

> Hi Achim,
>
> You mentioned previously that I could use Pax-Web WebContainer to
> possibly achieve 'loadable' child OSGi bundles (contain web pages etc)
> into a Parent/base page.
>
> I've been looking at the 'helloword-wc' sample to see how to use
> WebContainer. I should have mentioned I want to use JSF in child bundles
> and I assume this is possible as I can call
> WebContainer.registerServlet() with an instance of
> javax.faces.webapp.FacesServlet instead? Is there anything else I
> particularly need to do using JSF (other than having JSF support
> installed)? I did wonder if I need to call WebContainer.registerJsps() too?
>
> Regards
>
> Kerry
>
> On 15/07/15 21:59, Achim Nierbeck [via Karaf] wrote:
> > Hi,
> >
> > never tried to run Pax-Web 4 with Karaf 3.0.2 but if you do it you
> > won't have the web and http commands available.
> > AFAIK Karaf 4 and JPA shouldn't be of an issue, you might need to make
> > sure you have the right version of it installed though.
> >
> > You should give it a try :-)
> >
> > regards, Achim
> >
> > 2015-07-15 22:20 GMT+02:00 jtkb <[hidden email]
> > </user/SendEmail.jtp?type=node&node=4041442&i=0>>:
> >
> >     Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.
> >
> >
> >
> >     --
> >     View this message in context:
> >
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
> >     Sent from the Karaf - User mailing list archive at Nabble.com.
> >
> >
> >
> >
> > --
> >
> > Apache Member
> > Apache Karaf <http://karaf.apache.org/> Committer & PMC
> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
> > Committer & Project Lead
> > blog <http://notizblog.nierbeck.de/>
> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> >
> > Software Architect / Project Manager / Scrum Master
> >
> >
> >
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041442.html
> >
> > To start a new topic under Karaf - User, email
> > ml-node+s922171n930749h87@n3.nabble.com
> > To unsubscribe from Construct a Web Application From Multiple Bundles,
> > click here
> > <
> http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4041252&code=a2FyYWZAYXZpb25pY2VuZ2luZWVycy5jb218NDA0MTI1MnwxOTU3MjI4MTQ3
> >.
> > NAML
> > <
> http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041496.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Construct a Web Application From Multiple Bundles

Posted by jtkb <ka...@avionicengineers.com>.
Hi Achim,

You mentioned previously that I could use Pax-Web WebContainer to 
possibly achieve 'loadable' child OSGi bundles (contain web pages etc) 
into a Parent/base page.

I've been looking at the 'helloword-wc' sample to see how to use 
WebContainer. I should have mentioned I want to use JSF in child bundles 
and I assume this is possible as I can call 
WebContainer.registerServlet() with an instance of 
javax.faces.webapp.FacesServlet instead? Is there anything else I 
particularly need to do using JSF (other than having JSF support 
installed)? I did wonder if I need to call WebContainer.registerJsps() too?

Regards

Kerry

On 15/07/15 21:59, Achim Nierbeck [via Karaf] wrote:
> Hi,
>
> never tried to run Pax-Web 4 with Karaf 3.0.2 but if you do it you 
> won't have the web and http commands available.
> AFAIK Karaf 4 and JPA shouldn't be of an issue, you might need to make 
> sure you have the right version of it installed though.
>
> You should give it a try :-)
>
> regards, Achim
>
> 2015-07-15 22:20 GMT+02:00 jtkb <[hidden email] 
> </user/SendEmail.jtp?type=node&node=4041442&i=0>>:
>
>     Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.
>
>
>
>     --
>     View this message in context:
>     http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
>     Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>
>
> -- 
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> 
> Committer & Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041442.html 
>
> To start a new topic under Karaf - User, email 
> ml-node+s922171n930749h87@n3.nabble.com
> To unsubscribe from Construct a Web Application From Multiple Bundles, 
> click here 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4041252&code=a2FyYWZAYXZpb25pY2VuZ2luZWVycy5jb218NDA0MTI1MnwxOTU3MjI4MTQ3>.
> NAML 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041496.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Construct a Web Application From Multiple Bundles

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

never tried to run Pax-Web 4 with Karaf 3.0.2 but if you do it you won't
have the web and http commands available.
AFAIK Karaf 4 and JPA shouldn't be of an issue, you might need to make sure
you have the right version of it installed though.

You should give it a try :-)

regards, Achim


2015-07-15 22:20 GMT+02:00 jtkb <ka...@avionicengineers.com>:

> Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Construct a Web Application From Multiple Bundles

Posted by jtkb <ka...@avionicengineers.com>.
Just to clarify, I meant Pax-Web 4 in Karaf 3.0.2.



--
View this message in context: http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041440.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Construct a Web Application From Multiple Bundles

Posted by jtkb <ka...@avionicengineers.com>.
Hi Achim,

Thanks for your reply, and apologies for not replying. I have had a few
problems with the mailing list and forum website but I think I have those
resolved.

Do I need to move to Karaf4 and Pax-Web 4 to do this ? For example can I use
Pax-web for in Karaf 3.0.2? 

The only reason I ask is that I also need JPA which I know works in 3.0.2
but experienced problems with it in 3.0.3. If there are no problems with JPA
in Karaf 4 then I can certainly look to moving to it.



--
View this message in context: http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252p4041439.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Construct a Web Application From Multiple Bundles

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

as per OSGi spec this isn't possible for war or wab bundles.
But you can do something like this with Karaf4 and Pax-Web 4 if you use the
whiteboard extender of Pax-Web and/or the Pax-Web WebContainer (an enhanced
HttpService).
With this version you are able to register a HttpContext as a shared
Context, and therefore you are able to register web-resources to this
shared HttpContext.

regards, Achim


2015-07-02 23:21 GMT+02:00 jtkb <ka...@avionicengineers.com>:

> Hi,
>
> I've been using/learning/experimenting using Apache Karaf and Pax Web 3.X
> to
> deploy a web application.
>
> What I would like to do now is be able to split my web application across
> several OSGi bundles, similar to what  Virgo Snaps
> <
> https://www.eclipse.org/virgo/documentation/virgo-documentation-3.5.0.RELEASE/docs/snaps-guide/htmlsingle/virgo-snaps-guide.html
> >
> allows to be done.
>
> As far as I am aware, although I can make the Java code visible to other
> Java code in another bundle, web content/pages is not. I want to structure
> my bundles with a parent bundle provides a 'base' web-page frame work into
> which is can load/display web pages/content from child bundles if/as they
> become available. Based upon my understanding above, this means that the
> parent bundle needs to be able to access content in it's child bundles.
>
> My question is, is this possible to do this with Karaf and Pax web as they
> stand? So far I believe that each web bundle is in isolation to one another
> i.e. no visibility.
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Construct-a-Web-Application-From-Multiple-Bundles-tp4041252.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master