ops4j / org.ops4j.pax.web

OSGi R7 Http Service, Whiteboard and Web Applications (OSGi CMPN Release chapters 102, 140 and 128) implementation using Jetty 9, Tomcat 9 or Undertow 2.
https://ops4j1.jira.com/wiki/display/paxweb/Pax+Web
Other
144 stars 183 forks source link

Jetty-Bundle not able to deploy JSF-Bundle (WAR-Extender) [PAXWEB-811] #609

Closed ops4j-issues closed 9 years ago

ops4j-issues commented 9 years ago

Marc Schlegel created PAXWEB-811

Running a JSF-bundle (WAR/WAB) with jetty-bundle does not work because the bundle wont get to the DEPLOYED state.

Changing the bundle-composition using pax-web-jetty together with a the eclipse-jetty modules and javax.servlet-api (3.1.0) everything is working (this is what pax-web-itest does).

Reproduced with patch for pax-web-itest
PAXWEB811--IntegrationTest-for-JSF-on-JettyBundle.patch

The test produces an Exception within an MBeanContainer

2015-04-15 08:26:47.350:WARN:oejj.MBeanContainer:pool-10-thread-1: bean: qtp2057369{STOPPED,8<=0<=200,i=0,q=0}
javax.management.InstanceAlreadyExistsException: org.eclipse.jetty.util.thread:type=queuedthreadpool,id=0
    at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at org.eclipse.jetty.jmx.MBeanContainer.beanAdded(MBeanContainer.java:209)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.addEventListener(ContainerLifeCycle.java:367)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.addBean(ContainerLifeCycle.java:257)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.addBean(ContainerLifeCycle.java:231)
    at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.start(JettyServerImpl.java:158)
    at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Stopped.start(ServerControllerImpl.java:414)
    at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.start(ServerControllerImpl.java:71)
    at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Unconfigured.configure(ServerControllerImpl.java:697)
    at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.configure(ServerControllerImpl.java:87)
    at org.ops4j.pax.web.service.internal.Activator.updateController(Activator.java:349)
    at org.ops4j.pax.web.service.internal.Activator$3.run(Activator.java:291)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

This issue might also affect the other pax-web-containers. JSP-bundles are not affected.


Affects: 4.1.1 Fixed in: 4.1.2, 6.0.0 Attachments:

Votes: 0, Watches: 2

ops4j-issues commented 9 years ago

Achim Nierbeck commented

First we'll need to try to reproduce this with the standard jsf-sample of pax-web, that should already fail.

ops4j-issues commented 9 years ago

Marc Schlegel commented

Patch containing Integration-Test in pax-web-itest. Issue edited.

PAXWEB811--IntegrationTest-for-JSF-on-JettyBundle.patch

ops4j-issues commented 9 years ago

Achim Nierbeck commented

The issue isn't related to not finding the MBeanContainer, as those are actually only warnings.
The reason seems to be related to the following:

org.ops4j.pax.web.pax-web-jetty-bundle[org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper] : will add org.apache.myfaces.ee6.MyFacesContainerInitializer to ServletContainerInitializers

It looks like this part throws an exception, which isn't caught and therefore stalls the deployment of the war.

actually this part throws it:

BundleAnnotationFinder baf = new BundleAnnotationFinder(packageAdminTracker.getService(),bundle);

--->
Reason:
CNF: org.apache.xbean.finder.BundleAnnotationFinder
looks like the xbean-finder module is missing

Turns out, it's a bunch of imports are missing, trying to fix that.

ops4j-issues commented 9 years ago

Achim Nierbeck commented

master:
https://github.com/ops4j/org.ops4j.pax.web/commit/244b99fd74a48c8d58d1f87b38162fb17903f01c
4.1.2:
https://github.com/ops4j/org.ops4j.pax.web/commit/d2299289e9d19889ea6a9e910f6361f4797a57a2