Created
October 5, 2011 13:16
-
-
Save mathieuancelin/1264396 to your computer and use it in GitHub Desktop.
JNDI lookup for BundleContext FAIL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15:15:37,060 INFO [stdout] (MSC service thread 1-4) 15:15:37.060 [MSC service thread 1-4] WARN o.j.w.e.o.i.e.s.WeldOSGiExtension - Starting Weld-OSGi extension in hybrid mode. | |
15:15:37,065 ERROR [stderr] (MSC service thread 1-4) javax.naming.NameNotFoundException: java:comp/BundleContext | |
15:15:37,065 ERROR [stderr] (MSC service thread 1-4) at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:55) | |
15:15:37,065 ERROR [stderr] (MSC service thread 1-4) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:209) | |
15:15:37,065 ERROR [stderr] (MSC service thread 1-4) at javax.naming.InitialContext.lookup(InitialContext.java:392) | |
15:15:37,066 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.environment.osgi.impl.extension.service.WeldOSGiExtension.runExtensionInHybridMode(WeldOSGiExtension.java:224) | |
15:15:37,066 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.environment.osgi.impl.extension.service.WeldOSGiExtension.registerCDIOSGiServices(WeldOSGiExtension.java:216) | |
15:15:37,066 ERROR [stderr] (MSC service thread 1-4) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
15:15:37,066 ERROR [stderr] (MSC service thread 1-4) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | |
15:15:37,067 ERROR [stderr] (MSC service thread 1-4) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | |
15:15:37,067 ERROR [stderr] (MSC service thread 1-4) at java.lang.reflect.Method.invoke(Method.java:597) | |
15:15:37,067 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) | |
15:15:37,067 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) | |
15:15:37,067 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) | |
15:15:37,067 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) | |
15:15:37,068 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170) | |
15:15:37,068 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51) | |
15:15:37,068 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:162) | |
15:15:37,068 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241) | |
15:15:37,069 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229) | |
15:15:37,069 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207) | |
15:15:37,069 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:75) | |
15:15:37,069 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:46) | |
15:15:37,071 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:40) | |
15:15:37,071 ERROR [stderr] (MSC service thread 1-4) at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:348) | |
15:15:37,071 ERROR [stderr] (MSC service thread 1-4) at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83) | |
15:15:37,071 ERROR [stderr] (MSC service thread 1-4) at org.jboss.as.weld.services.WeldService.start(WeldService.java:89) | |
15:15:37,071 ERROR [stderr] (MSC service thread 1-4) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) | |
15:15:37,072 ERROR [stderr] (MSC service thread 1-4) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) | |
15:15:37,072 ERROR [stderr] (MSC service thread 1-4) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) | |
15:15:37,072 ERROR [stderr] (MSC service thread 1-4) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) | |
15:15:37,072 ERROR [stderr] (MSC service thread 1-4) at java.lang.Thread.run(Thread.java:680) | |
15:15:37,073 INFO [stdout] (MSC service thread 1-4) 15:15:37.073 [MSC service thread 1-4] WARN o.j.w.e.o.i.e.s.WeldOSGiExtension - Cannot lookup JNDI BundleContext. |
Yes, have a look at BundleContextJndiBindingProcessor and check that the binding gets triggered for your deployment. If not up already the OSGi subsystem needs to be activated, which also happens in that code. We rely on the AnnotationIndex to trigger the binding
Actually, the OSGi subsystem seems to be active because my app get the BundleContext injection. But as the JNDI lookup is performed during the initialization (deployment) of the app, I suspect the JNDI context isn't yet available or something like that. So I can't get any object from the JNDI context.
In that case we need a dedicated jira with a test that isolates your issue. Could you possibly create such a test?
Ok, I will try to create a test.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems it's because I'm outside EJB or Servlet invocation. Is it possible ?