>>>>> Jean-Baptiste Onofré <[email protected]>:
> Hi Steinar,
> by webapp, you mean a web application bundle I guess, right ?
Well, my webapps actually consists of several bundles, that are loaded
by a karaf feature, usually:
1. A service bundle, defining the services of the business logic, and
an application specific database plugin interface
2. A liquibase database schema bundle
3. A database plugin bundle (I usually have one for derby and one for
PostgreSQL ans select either at runtime)
4. A business logic bundle providing the service defined in the
service bundle
5. A web.security bundle defining the web context using web whiteboard
(this is my first failure in karaf.log), and adding a shiro filter
to the web whiteboard and the web context
6. A web.api bundle creating REST services for the services provided by
the business logic bundle (item #4 above) and plugging a servlet
into the web context defined in item #5 using web whiteboard
7. a web.frontend plugging a servlet into the web context defined in
item #5 using web whiteboard
So basically 3 bundles plugging into the web whiteboard, together with
several support bundles (database and business logic).
Examples of webapps following this pattern:
https://github.com/steinarb/authservice
https://github.com/steinarb/ukelonn
https://github.com/steinarb/handlereg
The top level, hand written, feature files pulling the complete webapp in:
https://github.com/steinarb/authservice/blob/master/src/main/filtered-resources/feature.xml#L16
https://github.com/steinarb/ukelonn/blob/master/karaf/src/main/filtered-resources/feature.xml#L16
https://github.com/steinarb/handlereg/blob/master/src/main/filtered-resources/feature.xml#L16
> I added karaf-servlet-example in Karaf distribution using
> maven-bundle-plugin 4.2.0 with Java 11 (Oracle), and it works fine.
> Maybe you can share a simple test case similar to your webapp that I can
> test locally.
Hm, yes, maybe...?
Most of my sample projects use the web whiteboard, but don't define a
web context (which is what was failing for me according to the
karaf.log), but this project defines both a web context and uses apache
shiro:
https://github.com/steinarb/authservice-sampleclient
I'll see how it works out.
Thanks!