Hi Gerard,

see my answers in-line.

regards, Achim

[1] - https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/whiteboard/src/main/java/org/ops4j/pax/web/extender/samples/whiteboard/internal/Activator.java

Am 30.05.2012 18:52, schrieb Gerard Maas:
Hi,

I'm currently using Pax-web 1.1.4 (upgraded today) + war extender + whiteboard. We have a JS heavy app backed up by several servlets. The servlets are registered using DS (and picked up by whiteboard). I have been trying to use a war/<content> to serve my html+js code, but it does not behave consistently.

The system is throwing the "HTTP Context already in use ..." exception when the war is getting registered. Then, there seem to be some kind of racing condition b/c sometimes my static context comes under the manifest declared <Web-ContextPath>/<mycontent> and sometimes lands on /<mycontent>.

Is it the expected behavior that a resources from a bundle cannot be served from a war (war extender?) and whiteboard at the same time?

yes, you either have a war application or better a web-application-bundle that behaves like the std. war everyone knows but is a war with a osgi-manifest and therefore does have the ability to import-/export packages. Or you have a std. osgi bundle where you register your servlets as services. So what does pax-web do here it actually tries to register the servlets contained inside the war on the application context basically using the same mechanism as
if you would register your servlet through the whiteboard-extender.


Currently I've created a bundle activator following [1] to load my static content on a know path, but this path it's deep and obscure in the code and might be a headache for the guy who will have to maintain the sw afterwards. I'd prefer the declarative war method if possible. Also, I don't see how to create a <welcome-file-list> with the programmatic method.

regarding the welcome-file I suggest taking a look at the sample activator at [1]. it can be done with that.


Any hints on this case?

You have to decide do you want to do all your webstuff with a std. war then stick to the war/wab mechanism and let
blueprint or spring-dm do the dependency injections to "outside" services.
If you want to have full control over all your servlets and want to make sure everthing is the way you want with ds, then you need to stick to your std. bundles and register your servlets, resources and welcome files as the samples show




many thanks,  Gerard.

[1] http://team.ops4j.org/wiki/display/ops4j/Pax+Web+Extender+-+Whiteboard


_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general


--
- Apache Karaf<http://karaf.apache.org/>  Committer&  PMC
- OPS4J Pax Web<http://wiki.ops4j.org/display/paxweb/Pax+Web/>    Committer&  
Project Lead
- OPS4J Pax for Vaadin<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>  
Committer&  Project Lead
- Blog<http://notizblog.nierbeck.de/>

_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to