0

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?

michalavis
  • 79
  • 1
  • 8

1 Answers1

0

The default place for the beans.xml for building jars with maven would be in

src/main/resources/META-INF/
Laertes
  • 334
  • 1
  • 6