[ https://issues.apache.org/jira/browse/FELIX-5205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15175736#comment-15175736 ]
Frank Lyaruu commented on FELIX-5205: ------------------------------------- If this happens, it keeps happening until I restart the app. After that, about 50 % chance it will happen again. It is a rather large application (300+ bundles) that works fine under Karaf 3 (SCR 1.8.x). While I can't rule out that there is something wrong with a service component declaration somewhere, I'd expect scr:list / webconsole to be a bit more defensive and not completely break down, or at least log something. > Webconsole and text console throw IllegalStateException > ------------------------------------------------------- > > Key: FELIX-5205 > URL: https://issues.apache.org/jira/browse/FELIX-5205 > Project: Felix > Issue Type: Bug > Components: Declarative Services (SCR), Gogo Shell, Web Console > Affects Versions: scr-2.0.2 > Environment: Mac OSX 10.11.2 Java 1.8.0_66 > Reporter: Frank Lyaruu > > Recently I've upgraded my application from using Karaf 3.x to Karaf 4.x. The > application works fine, but sometimes (I can't reproduce consistenly but it > happens regularly) the 'Components' tab of the webconsole throws an > IllegalStateException: > Problem accessing /system/console/components. Reason: > Server Error > Caused by: > java.lang.IllegalStateException: Invalid BundleContext. > at > org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511) > at > org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114) > at > org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345) > at > org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241) > at > org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79) > at > org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin$RequestInfo.<init>(WebConsolePlugin.java:615) > at > org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin.doGet(WebConsolePlugin.java:177) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) > at > org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:567) > at > org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.doService(KarafOsgiManager.java:78) > at > org.apache.felix.webconsole.internal.servlet.KarafOsgiManager$1.run(KarafOsgiManager.java:58) > at java.security.AccessController.doPrivileged(Native Method) > at org.apache.karaf.util.jaas.JaasHelper.doAs(JaasHelper.java:103) > at > org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.service(KarafOsgiManager.java:56) > at > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812) > at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587) > .... > If I do a 'scr:list' in the Gogo shell, I get a similar error: > 2016-03-02 14:48:25,065 | ERROR | nsole user karaf | ShellUtil > | 58 - org.apache.karaf.shell.core - 4.0.4 | Exception caught while > executing command > java.lang.IllegalStateException: Invalid BundleContext. > at > org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511) > at > org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114) > at > org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345) > at > org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241) > at > org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79) > at org.apache.felix.scr.impl.ScrCommand.list(ScrCommand.java:248) > at org.apache.felix.scr.impl.ScrGogoCommand.list(ScrGogoCommand.java:64) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native > Method)[:1.8.0_66-internal] > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_66-internal] > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_66-internal] > at java.lang.reflect.Method.invoke(Method.java:497)[:1.8.0_66-internal] > at > org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)[58:org.apache.karaf.shell.core:4.0.4] > ... > That it happens both in Gogo and Webconsole makes me think the problem is in > SCR. Any ideas? -- This message was sent by Atlassian JIRA (v6.3.4#6332)