When adding a UsersDao dependency

@ApplicationScoped @Produces("application/json") @Consumes("application/json") @Path("private/users/") public class UserResource { @Inject private UsersDao usersDao; @POST @Path("/set") @Consumes("application/json") @Produces("application/json") public Response setUser (UsersDto usersDto){ return Response.ok().build(); } } 

Compile error occurs

 org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001408: Unsatisfied dependencies for type UsersDao with qualifiers @Default at injection point [BackedAnnotatedField] @Inject private ru.orgunit.rest.UserResource.usersDao at ru.orgunit.rest.UserResource.usersDao(UserResource.java:0) 

Users class

 @Entity @Table (name = "users") @Proxy(lazy = false) public class Users extends SuperEntity { @Transient public static final String SYSTEM_CREATOR = "system"; @Column(name = "name") private String name; @Column(name = "surname") private String surname; @Column(name = "login") private String login; @Column(name = "email") private String email; } 

When adding inject the usual interface everything works.

My beans.xml

 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> </beans> 
  • Format the code using 4 spaces of indentation, you can also select a code snippet in the message and press the Ctrl + K combination to add or remove indentation. - Mikhail Vaysman
  • one
    Did you yourself read the text of the error yourself? Why is there no userdao code? You think that useless Users will help determine the cause? - Sergey
  • org.glassfish.deployment.common.DeploymentException: CDI Deployment Failure: WELD-001408: Unsatisfied dependency for the UsersDao type with the @@ Default qualifier at the deployment point [BackedAnnotatedField] @@ Inject private ru.orgunit.rest.UserResource.usersDao in ru. orgunit.rest.UserResource.usersDao (UserResource.java Range) Does not see the CDI Your UsersDao. Why? Yes, the dog knows it. - Sergey

0