Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-2082

"Could not inject members" when running inside glassfish-embedded-3.1

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.12.Final
    • GlassFish Containers
    • None

      I have a project with some simple Rest services a some beans (with @ApplicationScoped) and a test that runs correctly when

      {@Deployment(testable = false)}

      .
      However, if I set

      {testable = true}

      and try to retrive some component in the test, for instance:

      @Inject
      private UserServiceImpl userService;

      Test fails with the message

      java.lang.RuntimeException: Could not inject members

      at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.injectClass(CDIInjectionEnricher.java:135)
      at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.enrich(CDIInjectionEnricher.java:78)
      ...
      Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001408: Unsatisfied dependencies for type HelloWorldResource with qualifiers @Default
      at injection point [BackedAnnotatedField] @Inject private com..payara.HelloTest.helloWorldResource
      at com..payara.HelloTest.helloWorldResource(HelloTest.java:0)

      Notes:
      · Same code runs (with appropriate changes) on Wildfly-swarm
      · Just in case it could be related, I have a multipart upload service, so I need to initialize the components like this:

      @ApplicationPath("/app/v1/")
      public class DemoPayaraApplication extends ResourceConfig {
      public DemoPayaraApplication()

      Unknown macro: { packages("com.everis.payara"); register(MultiPartFeature.class); }

      }

      And add additional dpendencies

      <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-multipart</artifactId>
      <version>2.25.1</version>
      <scope>provided</scope>
      </dependency>

              Unassigned Unassigned
              abelromero@gmail.com Abel Salgado Romero (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: