0 Replies Latest reply on Jan 10, 2013 7:42 PM by ulrichromahn

    Issue with Felix Webconsole in latest 7.2 SNAPSHOT

    ulrichromahn

      I am seeing a strange behaviour with the Felix Webconsole.

       

      I build the latest snapshot from Github and started it. I initially noticed, that someone must have removed OSGi from the default standalone.xml (grrr), so I had to correct that first.

       

      When I added the Felix Webconsole according to this, I noticed a few exceptions in the server log:

       

      16:27:19,256 INFO  [org.jboss.web] (MSC service thread 1-1) JBAS018210: Register web context: /system/console

      16:27:19,263 INFO  [org.jboss.as.osgi] (MSC service thread 1-1) JBAS011913: Register HttpService alias: /system/console

      16:27:19,269 INFO  [org.jboss.web] (MSC service thread 1-1) JBAS018210: Register web context: /system/console/res

      16:27:19,271 INFO  [org.jboss.as.osgi] (MSC service thread 1-1) JBAS011913: Register HttpService alias: /system/console/res

      16:27:19,272 WARN  [org.jboss.modules] (ClassLoader Thread) Failed to define class org.apache.felix.webconsole.internal.servlet.ConfigurationListener2 in Module "deployment.org.apache.felix.webconsole:3.1.8" from Service Module Loader: java.lang.LinkageError: Failed to link org/apache/felix/webconsole/internal/servlet/ConfigurationListener2 (Module "deployment.org.apache.felix.webconsole:3.1.8" from Service Module Loader)

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.FilteredLocalLoader.loadClassLocal(FilteredLocalLoader.java:46) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.Module.loadModuleClass(Module.java:527) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ConcurrentClassLoader.access$400(ConcurrentClassLoader.java:52) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ConcurrentClassLoader$LoaderThread.run(ConcurrentClassLoader.java:627) [jboss-modules.jar:1.1.3.GA]

      Caused by: java.lang.NoClassDefFoundError: org/osgi/service/metatype/MetaTypeProvider

                at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_09]

                at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_09]

                at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_09]

                at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.3.GA]

                ... 9 more

      Caused by: java.lang.ClassNotFoundException: org.osgi.service.metatype.MetaTypeProvider from [Module "deployment.org.apache.felix.webconsole:3.1.8" from Service Module Loader]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.3.GA]

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.3.GA]

                ... 14 more

       

       

      16:27:19,282 INFO  [org.jboss.as.osgi] (CM Configuration Updater (ManagedService Update: pid=org.apache.felix.webconsole.internal.servlet.OsgiManager)) JBAS011914: Unregister HttpService alias: /system/console/res

      16:27:19,287 INFO  [org.jboss.as.osgi] (CM Configuration Updater (ManagedService Update: pid=org.apache.felix.webconsole.internal.servlet.OsgiManager)) JBAS011914: Unregister HttpService alias: /system/console

      16:27:19,290 INFO  [org.jboss.osgi.framework] (MSC service thread 1-1) JBOSGI011002: Bundle started: org.apache.felix.webconsole:3.1.8

      16:27:19,299 INFO  [org.jboss.osgi.framework] (MSC service thread 1-1) JBOSGI011000: OSGi Framework started

      16:27:19,297 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/system/console]] (CM Configuration Updater (ManagedService Update: pid=org.apache.felix.webconsole.internal.servlet.OsgiManager)) JBWEB000266: Servlet system/console threw unload exception: javax.servlet.ServletException: JBWEB000265: Servlet.destroy() for servlet system/console threw exception

                at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1390)

                at org.apache.catalina.core.StandardWrapper.stop(StandardWrapper.java:1669)

                at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3906)

                at org.jboss.as.osgi.httpservice.HttpServiceImpl.unregisterInternal(HttpServiceImpl.java:215)

                at org.jboss.as.osgi.httpservice.HttpServiceImpl.unregister(HttpServiceImpl.java:203)

                at org.apache.felix.webconsole.internal.servlet.OsgiManager.unbindHttpService(OsgiManager.java:772) [OsgiManager.class:]

                at org.apache.felix.webconsole.internal.servlet.OsgiManager$HttpServiceTracker.removedService(OsgiManager.java:660) [OsgiManager$HttpServiceTracker.class:]

                at org.osgi.util.tracker.ServiceTracker$Tracked.untrack(ServiceTracker.java:1126) [ServiceTracker$Tracked.class:]

                at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:347) [ServiceTracker.class:]

                at org.apache.felix.webconsole.internal.servlet.OsgiManager.updateConfiguration(OsgiManager.java:821) [OsgiManager.class:]

                at org.apache.felix.webconsole.internal.servlet.ConfigurationListener.updated(ConfigurationListener.java:66) [ConfigurationListener.class:]

                at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1160)

                at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:104)

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]

      Caused by: java.lang.NullPointerException

                at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1380)

                ... 13 more

       

       

      16:27:19,330 INFO  [org.jboss.web] (CM Configuration Updater (ManagedService Update: pid=org.apache.felix.webconsole.internal.servlet.OsgiManager)) JBAS018210: Register web context: /system/console

      16:27:19,337 INFO  [org.jboss.as.osgi] (CM Configuration Updater (ManagedService Update: pid=org.apache.felix.webconsole.internal.servlet.OsgiManager)) JBAS011913: Register HttpService alias: /system/console

      16:27:19,337 INFO  [org.jboss.web] (CM Configuration Updater (ManagedService Update: pid=org.apache.felix.webconsole.internal.servlet.OsgiManager)) JBAS018210: Register web context: /system/console/res

      16:27:19,340 INFO  [org.jboss.as.osgi] (CM Configuration Updater (ManagedService Update: pid=org.apache.felix.webconsole.internal.servlet.OsgiManager)) JBAS011913: Register HttpService alias: /system/console/res

       

      Going to the documented URL http://localhost:8080/httpservice/system/console gave me a HTTP 404!!

       

      However, when going to http://localhost:8080/system/console I got the the Felix Webconsole.

       

      Please be so kind and update the documentation!

       

      Then I tried to get rid of the Exception above. I noticed that the Felix Webconsole seem to import org.osgi.service.metatype.MetaTypeProvider which is provided by the OSGi Enterprise Compendium and according to https://issues.jboss.org/browse/AS7-5803 this has been removed as a default capability.

      So, I tried to add the enterprise compendium as capability and re-started JBoss AS. As expected, the Exception went away. However, it appears that although the Felix Webconsole bundle gets started, it does not bind to the HTTP Service (no corresponding message in the log about the context) and hence I see a HTTP 404 when going to the URL.

       

      I follow the reasoning behind AS7-5803, however, how would I then correctly provide the org.osgi.service.metatype package to the Felix Webconsole? Who is the correct "implementor" of this API and hence would be the correct capability to be added?