Or just scoping beans a ans b. Lazy init of cdi would work. That said it
can be a missing dep or a conflicting api too. Put a breakpoint in the
exception constructor and print the stack, you ll know very quickly ;).


Le 5 mai 2017 17:38, "Laird Nelson" <[email protected]> a écrit :

> On Fri, May 5, 2017 at 7:57 AM COURTAULT Francois <
> [email protected]> wrote:
>
> > I perform the same test by using curl instead of Swagger UI and I got the
> > same response:
> > {"code":500,"messages":["javax.enterprise.inject.
> CreationException","java.lang.StackOverflowError","
> > - Caused by: null"]}.
> >
>
> I can't speak to TomEE here but this means almost certainly that you have
> something like:
>
> public class A {
>   @Inject
>   private B b;
> }
> public class B {
>   @Inject
>   private A a;
> }
>
> You can resolve these situations with:
>
> public class A {
>   @Inject
>   private *Provider<B> bProvider*;
> }
> public class B {
>   @Inject
>   private A a;
> }
>
> …or:
>
> public class A {
>   @Inject
>   private B b;
> }
> public class B {
>   @Inject
>   private *Provider<A> aProvider*;
> }
>
> Best,
> Laird
> --
> http://about.me/lairdnelson
>

Reply via email to