[jboss-jira] [JBoss JIRA] (WFLY-8064) Dependecy Injection not working

Pradeep Ganapathy (JIRA) issues at jboss.org
Thu Feb 9 06:36:00 EST 2017


Pradeep Ganapathy created WFLY-8064:
---------------------------------------

             Summary: Dependecy Injection not working
                 Key: WFLY-8064
                 URL: https://issues.jboss.org/browse/WFLY-8064
             Project: WildFly
          Issue Type: Release
          Components: CDI / Weld
    Affects Versions: 10.0.0.Final
         Environment: Windows 2012 R2
            Reporter: Pradeep Ganapathy
            Assignee: Stuart Douglas


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