Description of EventAdminSubscriberHandler
------------------------------------------
Key: FELIX-3164
URL: https://issues.apache.org/jira/browse/FELIX-3164
Project: Felix
Issue Type: Bug
Components: iPOJO
Affects Versions: iPOJO-1.6.0
Environment: Karaf 2.2.2
Windows 7
Java 1.6.0_24
Reporter: Joel Schuster
Priority: Minor
Fix For: iPOJO-1.8.0
When using the ipojo webconsole or the ipojo arch gogo commands I get a
NullPointerException from
org.apache.felix.ipojo.architecture.InstanceDescription when I'm trying to take
a look at any instance that has a @Subscriber annotation and event admin
listener implementation.
I started taking a look at this and it seems that the problem stems from the
m_description field of the
org.apache.felix.ipojo.handlers.event.subscriber.EventAdminSubscriberHander
being null when all the services are being examined by the InstanceDescription
class.
Durring debugging I see that all the other service handlers have valid,
non-null, descriptions but that the event admin one does not. I haven't spent
any more time to determine why that is. I can say that the m_description IS
being set and is valid during initialization in initializeComponentFactory() of
EventAdminSubscriberHandler. Somehow it looses it somewhere along the way.
Here's the stack trace from the web console:
HTTP ERROR 500
Problem accessing
/system/console/iPOJO/instances/org.snapteam.test.endpoint.ExampleIPojoComponent.d9eee2c0-3ce7-4742-afb0-5707e366e623.json.
Reason:
Server Error
Caused by:
java.lang.NullPointerException
at
org.apache.felix.ipojo.architecture.InstanceDescription.getHandlerDescription(InstanceDescription.java:111)
at
org.apache.felix.ipojo.webconsole.IPOJOPlugin.__getInstanceDetail(IPOJOPlugin.java:468)
at
org.apache.felix.ipojo.webconsole.IPOJOPlugin.getInstanceDetail(IPOJOPlugin.java)
at
org.apache.felix.ipojo.webconsole.IPOJOPlugin.__doGet(IPOJOPlugin.java:510)
at org.apache.felix.ipojo.webconsole.IPOJOPlugin.doGet(IPOJOPlugin.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at
org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:437)
at
org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:384)
at
org.apache.felix.webconsole.internal.KarafOsgiManager.doService(KarafOsgiManager.java:67)
at
org.apache.felix.webconsole.internal.KarafOsgiManager$1.run(KarafOsgiManager.java:47)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at
org.apache.felix.webconsole.internal.KarafOsgiManager.service(KarafOsgiManager.java:45)
at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:538)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)
at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:480)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:937)
at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:116)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:871)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:72)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:346)
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:589)
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1048)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:601)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
at
org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
at java.lang.Thread.run(Thread.java:662)
And from the gogo command line:
09:02:58,119 | INFO | l Console Thread | araf.shell.console.jline.Console 258
| 25 - org.apache.karaf.shell.console - 2.2.2 | Exception caught while
executing command
java.lang.NullPointerException
at
org.apache.felix.ipojo.architecture.InstanceDescription.getDescription(InstanceDescription.java:164)
at
org.apache.felix.ipojo.PrimitiveInstanceDescription.getDescription(PrimitiveInstanceDescription.java:165)
at org.apache.felix.ipojo.arch.gogo.Arch.__instance(Arch.java:115)
at org.apache.felix.ipojo.arch.gogo.Arch.instance(Arch.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)[:1.6.0_24]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_24]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_24]
at
org.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)[25:org.apache.karaf.shell.console:2.2.2]
at
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)[25:org.apache.karaf.shell.console:2.2.2]
at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[25:org.apache.karaf.shell.console:2.2.2]
at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[25:org.apache.karaf.shell.console:2.2.2]
at
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[25:org.apache.karaf.shell.console:2.2.2]
at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[25:org.apache.karaf.shell.console:2.2.2]
at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[25:org.apache.karaf.shell.console:2.2.2]
at
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:79)[25:org.apache.karaf.shell.console:2.2.2]
at
org.apache.karaf.shell.console.jline.Console.run(Console.java:240)[25:org.apache.karaf.shell.console:2.2.2]
at java.lang.Thread.run(Thread.java:662)[:1.6.0_24]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira