[
https://issues.jboss.org/browse/JBAS-8818?page=com.atlassian.jira.plugin....
]
Nicklas Karlsson commented on JBAS-8818:
----------------------------------------
CDI is initialized since I can do manual lookup from a @PostConstruct method.
However, If i try to lookup a @Singleton I end up with
10:36:01,940 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/KaKe]] Error configuring
application listener of class fi.affecto.kake.sys.seuranta.SeurantaListener:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[:1.6.0_23]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[:1.6.0_23]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
at
org.jboss.web.tomcat.service.TomcatInjectionContainer.processesLifecycleCallbackMetaData(TomcatInjectionContainer.java:560)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.TomcatInjectionContainer.postConstruct(TomcatInjectionContainer.java:333)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:302)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:281)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:264)
[:6.0.0.Final]
at
org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3319)
[:6.0.0.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3828)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:294)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
[:6.0.0.Final]
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:477)
[:6.0.0.Final]
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) [:6.0.0.Final]
at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[:1.6.0_23]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[:1.6.0_23]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
[:6.0.0.GA]
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
[:6.0.0.GA]
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
[:2.2.0.GA]
at $Proxy41.start(Unknown Source) at
org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53)
[:2.2.0.GA]
at
org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:41)
[:2.2.0.GA]
at
org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:301)
[:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246)
[jboss-dependency.jar:2.2.0.GA]
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139)
[jboss-dependency.jar:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939)
[jboss-dependency.jar:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654)
[jboss-dependency.jar:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983)
[:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076)
[:2.2.0.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679)
[:2.2.0.GA]
at
org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106)
[:6.0.0.Final]
at
org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143)
[:0.2.2]
at
org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240)
[:0.2.2]
at
org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192)
[:0.2.2]
at
org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57)
[:0.2.2]
at
org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74)
[:0.2.2]
at
org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95)
[:0.2.2]
at
org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87)
[:0.2.2]
at
org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234)
[:0.2.2]
at
org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213)
[:0.2.2]
at
org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150)
[:0.2.2]
at
org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135)
[:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146)
[:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90)
[:0.2.2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_23]
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
[:1.6.0_23]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_23]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
[:1.6.0_23]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
[:1.6.0_23]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
[:1.6.0_23]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[:1.6.0_23]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[:1.6.0_23]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]
Caused by: org.jboss.weld.exceptions.CreationException: WELD-000079 Could not find the EJB
in JNDI: class
fi.affecto.kake.sys.seuranta.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$C:$Java$AS$jboss-6$0$0$Final$server$default$deploy$KaKe$war"-SessionBean-Seuranta_$$_WeldProxy
at org.jboss.weld.bean.SessionBean.create(SessionBean.java:351) [:2011-01-10 09:56]
at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:67)
[:2011-01-10 09:56]
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:673)
[:2011-01-10 09:56]
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:711)
[:2011-01-10 09:56]
at fi.affecto.kake.sys.apu.BeanUtil.getInstance(BeanUtil.java:35) [classe:]
at fi.affecto.kake.sys.seuranta.SeurantaListener.alusta(SeurantaListener.java:21)
[classe:]
... 67 more
Caused by: java.lang.RuntimeException: Error retreiving EJB from JNDI Seuranta
(Singleton); BeanClass: class fi.affecto.kake.sys.seuranta.Seuranta; Local Business
Interfaces: [Business interface: class fi.affecto.kake.sys.seuranta.Seuranta]
at org.jboss.weld.integration.ejb.JBossEjbServices.resolveEjb(JBossEjbServices.java:69)
[:6.0.0.Final]
at org.jboss.weld.bean.SessionBean.createReference(SessionBean.java:477) [:2011-01-10
09:56]
at
org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.<init>(EnterpriseBeanProxyMethodHandler.java:75)
[:2011-01-10 09:56]
at org.jboss.weld.bean.SessionBean.create(SessionBean.java:334) [:2011-01-10 09:56]
... 72 more
Caused by: javax.naming.NameNotFoundException: no-interface not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [:5.0.5.Final]
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779) [:5.0.5.Final]
at org.jnp.server.NamingServer.getObject(NamingServer.java:785) [:5.0.5.Final]
at org.jnp.server.NamingServer.lookup(NamingServer.java:443) [:5.0.5.Final]
at org.jnp.server.NamingServer.lookup(NamingServer.java:399) [:5.0.5.Final]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728) [:5.0.5.Final]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688) [:5.0.5.Final]
at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_23]
at
org.jboss.weld.integration.ejb.JBossSessionObjectReference.<init>(JBossSessionObjectReference.java:44)
[:6.0.0.Final]
at org.jboss.weld.integration.ejb.JBossEjbServices.resolveEjb(JBossEjbServices.java:65)
[:6.0.0.Final]
... 75 more
Not sure if it's supposed to be available at that point, though.
CDI injection not working in WebListeners
-----------------------------------------
Key: JBAS-8818
URL:
https://issues.jboss.org/browse/JBAS-8818
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Weld/CDI
Affects Versions: 6.0.0.Final
Reporter: Nicklas Karlsson
Assignee: Marius Bogoevici
CDI injection is not performed for WebListeners, e.g.
@WebListener
public class BugListener implements HttpSessionListener
{
@Inject
BeanManager beanManager;
...
}
Will have beanManager==null when the methods are hit
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira