eclipse-ee4j / eclipse-ee4j/jersey
hk2-cdi bridge doesn't work correkt
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
( With maven i use
```
org.glassfish.jersey.containers.glassfish
jersey-gf-cdi
2.14
```
)
If i register a concrete resource class, injection works correct e.g.:
```
ResourceConfig resourceConfig = new ResourceConfig();
resourceConfig.register(RootResource.class);
```
```
public class RootResource
{
@Inject
@SimpleDb(value="mariadb")
private EntityManager em;
@GET
@Produces({ "text/plain" })
public final String getValue()
{
...............................
```
But now, i load a resource class dynamically, with
```
c = Class.forName(.....);
and register ist with
resourceConfig.register(c);
```
or
```
resourceConfig.registerInstances(c.newInstance());
```
But, it doesn't work and crashes with error
Unknown HK2 failure detected:
MultiException stack 1 of 1
org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at SystemInjecteeImpl .......................
Have u overseen something, or is it not possible to use
such anonymous classes?
#### Environment
Java SE 1.8.0_92-b14
Windows 7
#### Affected Versions
[2.14]
Contributor guide
Assessment
This issue has not been assessed yet.