I'm trying to deploy a simple WAR file on wildfly 9.0.2 final. The WAR has no web.xml and no EJB's for the moment - just, via annotations, a websocket endpoint with a dependency injection in the constructor and factories to produce the dependencies. On deployment, I get the error:
java.lang.NoSuchMethodException: com.aip.textspace.infra.control.websocket.MainEndPoint.<init>
It looks like widlfly is trying to call a null constructor which does not exist. Here is the constructor for MainEndPoint:
@Inject
public MainEndPoint(SessionController control) {
super();
this.control = control;
}
I have another class called SessionControllerFactory which has a producer method for the injection:
@Produces
public SessionController build() {
...
In the Maven POM, I reference the CDI library:
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>
So what did I leave out that is needed for wildfly to call the constructor with dependency injection?
BTW, based on a related response, I tried adding a null constructor to MainEndPoint. In that case the deployment succeeds but the injection never happens, and I get null pointer exceptions when accessiong this.control in MainEndPoint.