I have two beans in my jar module -> bean A:
@Singleton
public final class A {
public String getS() {
return"";
}
and a second bean B within the same jar module:
@Stateless
public final class B {
@Inject
private A a;
public String getAS() {
a.getS() // -> NullPointerException
}
}
I have the file beans.xml in
src/main/resources/META-INF/
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
is added to pom.xml, but still injected A is null.
In a generated jar file beans.xml is present
whether I missed something?