Hello and thank you for a quick response! Sorry, I forgot to include the versions. I am running Apache Karaf 4.4.1 which comes with Pax Web 8.0.6.
I looked at the samples and they already helped me a lot but I will look at them once again, maybe I missed something. Basically, I followed: https://github.com/ops4j/org.ops4j.pax.web/blob/web-8.0.11/samples/samples-jsf/war-primefaces-wired/pom.xml You actually don't uninstall features using karaf-maven-plugin - you declare features you want, and karaf-maven-plugin will put the features into boot features (etc/org.apache.karaf.features.cfg - when in runtime scope) or into startup bundles (etc/startup.properties - when in compile scope). So definitely you have to fix your <configuration> for karaf-maven-plugin. I have the following dependencies in my pom.xml (used to build custom Karaf distribution) <dependency> <groupId>org.apache.karaf.features</groupId> <artifactId>framework</artifactId> <version>${karaf.version}</version> <type>kar</type> </dependency> <dependency> <groupId>org.apache.karaf.features</groupId> <artifactId>framework</artifactId> <version>${karaf.version}</version> <classifier>features</classifier> <type>xml</type> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.karaf.features</groupId> <artifactId>standard</artifactId> <version>${karaf.version}</version> <classifier>features</classifier> <type>xml</type> <scope>runtime</scope> </dependency> And I listed the following features in startupFeatures: <startupFeatures> <startupFeature>framework-logback</startupFeature> <startupFeature>instance</startupFeature> <startupFeature>package</startupFeature> <startupFeature>log</startupFeature> <startupFeature>ssh</startupFeature> <startupFeature>system</startupFeature> <startupFeature>feature</startupFeature> <startupFeature>shell</startupFeature> <startupFeature>management</startupFeature> <startupFeature>service</startupFeature> <startupFeature>jaas</startupFeature> <startupFeature>deployer</startupFeature> <startupFeature>diagnostic</startupFeature> <startupFeature>wrap</startupFeature> <startupFeature>bundle</startupFeature> <startupFeature>config</startupFeature> <startupFeature>http</startupFeature> <startupFeature>webconsole</startupFeature> <startupFeature>pax-web-http-tomcat</startupFeature> </startupFeatures> This results in the above declared features listed in bootFeatures in etc/org.apache.karaf.features.cfg. When I start Karaf with this set up without my application the webconsole works fine and I can see the following on the features page: pax-web-http-jetty 8.0.6 org.ops4j.pax.web-8.0.6 Installed pax-web-http-tomcat 8.0.6 org.ops4j.pax.web-8.0.6 Installed Therefore I asked whether it i possible to uninstall pax-web-http-jetty. 2nd - how do you install the webconsole and/or your JSF bundle? Are then installed as WAR (WAB) files? May I see them? I don't claim that the problem is only at your side - maybe Pax Web didn't anticpate some setup and I'd be happy to help solving this problem. Webconsole is listed in the bootFeatures (see above). My application consists of a lot of bundles but the one with the UI is a WAB (war packaging with manifest which includes: Web-ContextPath: /main). Primefaces and JSF are wired using the Require-Bundle header in manifest: <Require-Bundle> javax.faces-api, org.primefaces </Require-Bundle> All the bundles and their dependencies (JSF, primefaces etc.) are listed in a feature.xml file which I place in the deploy directory in Karaf. The application loads and works fine. I am just having problem with the webconsole. I unfortunately cannot share the code of the bundles. But I am happy to provide more information if necessary. Let me know if you need more information. Best regards Martin Zukal From: Grzegorz Grzybek <[email protected]> Sent: Thursday, November 3, 2022 9:56 AM To: [email protected]; Martin Zukal <[email protected]> Subject: Re: webconsole and pax-web-http-tomcat Hello First - which Karaf version are you using? Assuming it's Karaf 4.4.x with Pax Web 8.0.x I can try helping. Pax Web 8 is highly refactored major version of the project where we've tried to make sure that things like JSF (which rely heavily on ServletContainerInitializers) work smoothly. There are dedicated tests both for webconsole and for JSF (MyFaces, Primefaces) and even for techs like Vaadin. Check the JSF samples at https://github.com/ops4j/org.ops4j.pax.web/tree/web-8.0.11/samples/samples-jsf Is it possible that the behavior is caused by conflict between pax-web-http-jetty and pax-web-http-tomcat? Is there a way how to uninstall pax-web-http-jetty using karaf-maven-plugin? You actually don't uninstall features using karaf-maven-plugin - you declare features you want, and karaf-maven-plugin will put the features into boot features (etc/org.apache.karaf.features.cfg - when in runtime scope) or into startup bundles (etc/startup.properties - when in compile scope). So definitely you have to fix your <configuration> for karaf-maven-plugin. 2nd - how do you install the webconsole and/or your JSF bundle? Are then installed as WAR (WAB) files? May I see them? I don't claim that the problem is only at your side - maybe Pax Web didn't anticpate some setup and I'd be happy to help solving this problem. kind regards Grzegorz Grzybek czw., 3 lis 2022 o 09:46 Martin Zukal via user <[email protected] <mailto:[email protected]> > napisał(a): Hello everyone, I am experiencing strange behavior with webconsole of Apache Karaf. I have an application deployed using a custom feature file in Apache Karaf. The application is based on Spring and is using Primefaces (and Mojarra JSF implementation version 2.2.15). When I run it with standard war feature (which by default installs pax-web-http-jetty) I am getting the following error messages in the log file: Unable to obtain InjectionProvider from init time FacesContext. Does this container implement the Mojarra Injection SPI? Unable to inject com.sun.faces.application.ApplicationFactoryImpl@5005965f <mailto:com.sun.faces.application.ApplicationFactoryImpl@5005965f> because no InjectionProvider can be found. Does this container implement the Mojarra Injection SPI? However, the webconsole works perfectly in this case. When I install the pax-web-http-tomcat feature the above mentioned error messages are gone but the webconsole is not working properly (the resources from res and lib are not loaded so I see allmost an empty page - see attachment). I can see the following errors in the log file: [2022-11-03 09:29:26.358] INFO tp-nio2-0.0.0.0-8080-exec-10 o.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/] Marking servlet [default-56ee4de3-f9f8-44c8-96ea-4580393e6469] as unavailable [2022-11-03 09:29:26.360] ERROR tp-nio2-0.0.0.0-8080-exec-10 o.a.c.c.C.[.[.[/].[default-56ee4de3-f9f8-44c8-96ea-4580393e6469] Allocate exception for servlet [default-56ee4de3-f9f8-44c8-96ea-4580393e6469] javax.servlet.UnavailableException: No static resources were found at org.apache.catalina.servlets.DefaultServlet.init(DefaultServlet.java:384) at org.ops4j.pax.web.service.tomcat.internal.web.TomcatResourceServlet.init(TomcatResourceServlet.java:87) at javax.servlet.GenericServlet.init(GenericServlet.java:180) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:804) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:128) at org.ops4j.pax.web.service.tomcat.internal.PaxWebStandardWrapperValve.invoke(PaxWebStandardWrapperValve.java:50) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.ops4j.pax.web.service.tomcat.internal.PaxWebStandardContextValve.invoke(PaxWebStandardContextValve.java:98) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) at org.apache.tomcat.util.net <http://org.apache.tomcat.util.net> .Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1701) at org.apache.tomcat.util.net <http://org.apache.tomcat.util.net> .SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.net <http://org.apache.tomcat.util.net> .AbstractEndpoint.processSocket(AbstractEndpoint.java:1190) at org.apache.tomcat.util.net <http://org.apache.tomcat.util.net> .Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:633) at org.apache.tomcat.util.net <http://org.apache.tomcat.util.net> .Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:611) at java.base/sun.nio.ch.Invoker.invokeUnchecked(Unknown Source) at java.base/sun.nio.ch.Invoker$2.run(Unknown Source) at java.base/sun.nio.ch <http://sun.nio.ch> .AsynchronousChannelGroupImpl$1.run(Unknown Source) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Unknown Source) Does it mean that the webconsole works only with pax-web-http-jetty? I can also see that both pax-web-http-jetty and pax-web-http-tomcat features are installed. Is it possible that the behavior is caused by conflict between pax-web-http-jetty and pax-web-http-tomcat? Is there a way how to uninstall pax-web-http-jetty using karaf-maven-plugin? Any help with this issue will be appreciated. Best regards Martin Zukal
