[jboss-jira] [JBoss JIRA] (WFLY-8064) Dependecy Injection not working
Alessio Soldano (JIRA)
issues at jboss.org
Mon Feb 20 03:52:00 EST 2017
[ https://issues.jboss.org/browse/WFLY-8064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13365894#comment-13365894 ]
Alessio Soldano commented on WFLY-8064:
---------------------------------------
indeed... [~gprade], please provide a reproducer, thanks
> Dependecy Injection not working
> -------------------------------
>
> Key: WFLY-8064
> URL: https://issues.jboss.org/browse/WFLY-8064
> Project: WildFly
> Issue Type: Release
> Components: CDI / Weld, REST
> Affects Versions: 10.0.0.Final
> Environment: Windows 2012 R2
> Reporter: Pradeep Ganapathy
> Assignee: Alessio Soldano
>
> All injected parameters after post construct are null. Jboss cant able to detect inject paramaters. Both dao and testDescription parameters are null. As a result null pointer exception
> RestEasy versions(All) ----> 3.0.14.Final.
> ApplicationScoped
> public class TestImpl implements ITest
> {
>
> @Inject
> private ITestDAO dao;
> public TestImpl setTestDAO(ITestDAO dao)
> {
> this.dao = dao;
> return this;
> }
> @Inject
> private TestDescription testDescription;
> public TestImpl setTestDescription(TestDescription testDescription)
> {
> this.testDescription = testDescription;
> return this;
> }
> }
> Error Logs:
> 2017-02-09 13:11:22,256 ERROR [io.undertow.request] (default task-128) UT005023: Exception handling request to( My EndPoint): org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
> Caused by: java.lang.NullPointerException
> at ServiceRegistryImpl.lookup(ServiceRegistryImpl.java:142)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)
> ... 35 more
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list