tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Issue with CDI injection: got CreationException with StackOverflowError
Date Fri, 05 May 2017 15:44:37 GMT
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" <ljnelson@gmail.com> a écrit :

> On Fri, May 5, 2017 at 7:57 AM COURTAULT Francois <
> Francois.Courtault@gemalto.com> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message