tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laird Nelson <ljnel...@gmail.com>
Subject Re: Issue with CDI injection: got CreationException with StackOverflowError
Date Fri, 05 May 2017 15:38:37 GMT
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