I\'m running into a issue with CDI Injection into a Weld container in JBoss 7.1.1
I\'ve got the following object model :
@Stateless
class ServiceEjb
I solved the problem by using javax.inject.Provider explicitly. Although I feel like this should be done under the hood by WELD automatically this was not the case for me too. This worked for me and solved my related problem.
class A {
@Inject
Provider b; // access with b.get()
}
class B {
@Inject
Provider a; // access with a.get()
}
I haven't tested it, but it could be enough to use one Provider to break the cycle, i.e. you don't need to use it in both classes.