I have problem with dependency injection from another .jar
module. When I try to inject services from that project, I get error
WELD-001408: Unsatisfied dependencies for type MyService with qualifiers @Default at injection point [BackedAnnotatedField] @Inject private smilecounter.app.windows.MainWindow.service at smilecounter.app.windows.MainWindow.service(MainWindow.java:0)
I have class:
@Singleton
public class MainWindow extends JFrame{
@Inject private MyService service;
...
}
that is injecting MyService
defined like this:
@ApplicationScoped
@Singleton
public class MyService{...}
In my desktop application module (Java SE
) I've added to pom:
<!-- CDI -->
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se</artifactId>
<version>${cdi.version}</version>
</dependency>
while in my services module, I've added:
<!-- CDI -->
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se</artifactId>
<version>${cdi.version}</version>
</dependency>
<!-- JAX-RS -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>${jaxrs.version}</version>
</dependency>
<!-- RESTEASY -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${javaee.api.version}</version>
<scope>provided</scope>
</dependency>
since those services are using also RESTeasy services.
Is there any way to inject those services in my desktop module without creating proxies that are setting manually dependencies?
EDIT
As requested in comment section, I'm posting my dependency from desktop
to core-services
:
<dependency>
<groupId>myApp</groupId>
<artifactId>myApp.services</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>