You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Abhijit Sarkar <sa...@outlook.com> on 2014/02/02 02:18:07 UTC
StackOverflowError
Hi,I'm getting a StackOverflowError while running tests on the application. This is a pet project which I'm migrating from Java/Spring/Maven to Groovy/CDI/Gradle. Is it ok to ask for help here or is there another more appropriate group?In case someone decides to help me out, the code is here (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and I've attached a build log with this email. One thing I noticed, which may not even be related, is that 2 beans I'm trying to override using @Specializes are still getting deployed.
Java 1.7.0_51-b13, Open EJB 4.6.1-SNAPSHOT
Regards,Abhijit
RE: StackOverflowError
Posted by Abhijit Sarkar <so...@outlook.com>.
I ended up using DeltaSpike CdiTestRunner (http://deltaspike.apache.org/test-control.html). I could also do the injection manually using BeanManager but the CdiTestRunner is a lot easier. What boggles my mind is that the injection through producer methods were happening in the same class, just not by type!I might come back to it later, for now I'll live with the CdiTestRunner.
Regards,Abhijit
> Date: Mon, 3 Feb 2014 07:12:48 +0100
> Subject: Re: StackOverflowError
> From: rmannibucau@gmail.com
> To: dev@tomee.apache.org
>
> Where do you expect test injection to be done? Maybe have a look to
> arquillian, applicationcomposr junite runner, openejb ejbcontainer
> bind("inject", xxx) feature or deltaspike junit runner
>
> Le lundi 3 février 2014, Abhijit Sarkar <so...@outlook.com> a écrit :
> > After struggling all day with it, I switched to using Apache DeltaSpike
> with Weld and it told me that I had circular dependencies. I'd think that's
> where the StackOverflowError was coming from but OWB fails to recognize the
> root cause (improvement option?).
> > Anyway, after fixing the circular dependencies problem, I'm back to OWB
> again but now my injected dependencies are null. Surprisingly, there's not
> any good account of how to unit test CDI with DeltaSpike and OWB. From the
> scanty documentation, I seem to be doing nothing wrong.
> > Anyone wants to take a look? The project can be downloaded from GitHub (
> https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and the
> following command would readily expose the aforementioned issue:
> >
> >
> >
> >
> >
> >
> >
> > gradle -PskipCoverage -Dtest.single=CDITestSuite clean build
> > Regards,Abhijit
> >> From: rmannibucau@gmail.com
> >> Date: Sun, 2 Feb 2014 10:00:23 +0100
> >> Subject: Re: StackOverflowError
> >> To: dev@tomee.apache.org
> >>
> >> 1)
> >> java -> groovy
> >> mvn -> gradle
> >> spring -> cdi
> >>
> >> all can have side effects (in particular groovy and IoC), groovy
> >> should be well handled
> >>
> >> 3) @ManagedBean is alsmot a stateful so I'm pretty sure you don't want
> >> to use it but rather @Dependent or @ApplicationScoped, @Produces in
> >> EJBs (@ManagedBean is considered this way) are not that good since you
> >> can't ignore an EJB, just use normal CDI beans
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2014-02-02 Abhijit Sarkar <so...@outlook.com>:
> >> > Thank you for looking into it.
> >> > "> first if you change everything it is hard to understand the cause"
> >> > Nothing was changed, neither the code, nor the output I attached with
> the email. Why do you say that?
> >> > "> secondly your example is not self contained and need some dep it
> can't retrive by default"
> >> > Probably you're referring to the dependency
> 'name.abhijitsarkar.util.logging:logging-util'. It's a logging module I use
> - I didn't know you'd actually try to execute the code. I've replaced it
> with SLF4J now.
> >> > "lastly you use @ManagedBean which is surely not what you want"Without
> @ManagedBean, the OpenEJB container complains that it can't find the beans.
> I don't have the error message handy else I'd have put it here. Perhaps a
> package scan or something similar needs to be set?
> >> >> From: rmannibucau@gmail.com
> >> >> Date: Sun, 2 Feb 2014 08:50:21 +0100
> >> >> Subject: Re: StackOverflowError
> >> >> To: dev@tomee.apache.org
> >> >>
> >> >> Hi
> >> >>
> >> >> first if you change everything it is hard to understand the cause,
> >> >> secondly your example is not self contained and need some dep it can't
> >> >> retrive by default, lastly you use @ManagedBean which is surely not
> >> >> what you want, is it intended?
> >> >> Romain Manni-Bucau
> >> >> Twitter: @rmannibucau
> >> >> Blog: http://rmannibucau.wordpress.com/
> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> >> Github: https://github.com/rmannibucau
> >> >>
> >> >>
> >> >>
> >> >> 2014-02-02 Abhijit Sarkar <so...@outlook.com>:
> >> >> > Hi,
> >> >> > I'm getting a StackOverflowError while running tests on the
> application.
> >> >> > This is a pet project which I'm migrating from Java/Spring/Maven to
> >> >> > Groovy/CDI/Gradle. Is it ok to ask for help here or is there
> another more
> >> >> > appropriate group?
> >> >> > In case someone decides to help me out, the code is here
> >> >> > (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager)
> and I've
> >> >> > attached a build log with this email. One thing I noticed, which
> may not
> >> >> > even be related, is that 2 beans I'm trying to override using
> @Specializes
> >> >> > are still getting deployed.
> >> >> >
> >> >> > Java 1.7.0_51-b13, Open EJB 4.6.1-SNAPSHOT
> >> >> >
> >> >> > Regards,
> >> >> > Abhijit
> >> >
> >
>
> --
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau
> <http://fr.linkedin.com/in/rmannibucau>*
> *Github: https://github.com/rmannibucau <https://github.com/rmannibucau>*
Re: StackOverflowError
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Where do you expect test injection to be done? Maybe have a look to
arquillian, applicationcomposr junite runner, openejb ejbcontainer
bind("inject", xxx) feature or deltaspike junit runner
Le lundi 3 février 2014, Abhijit Sarkar <so...@outlook.com> a écrit :
> After struggling all day with it, I switched to using Apache DeltaSpike
with Weld and it told me that I had circular dependencies. I'd think that's
where the StackOverflowError was coming from but OWB fails to recognize the
root cause (improvement option?).
> Anyway, after fixing the circular dependencies problem, I'm back to OWB
again but now my injected dependencies are null. Surprisingly, there's not
any good account of how to unit test CDI with DeltaSpike and OWB. From the
scanty documentation, I seem to be doing nothing wrong.
> Anyone wants to take a look? The project can be downloaded from GitHub (
https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and the
following command would readily expose the aforementioned issue:
>
>
>
>
>
>
>
> gradle -PskipCoverage -Dtest.single=CDITestSuite clean build
> Regards,Abhijit
>> From: rmannibucau@gmail.com
>> Date: Sun, 2 Feb 2014 10:00:23 +0100
>> Subject: Re: StackOverflowError
>> To: dev@tomee.apache.org
>>
>> 1)
>> java -> groovy
>> mvn -> gradle
>> spring -> cdi
>>
>> all can have side effects (in particular groovy and IoC), groovy
>> should be well handled
>>
>> 3) @ManagedBean is alsmot a stateful so I'm pretty sure you don't want
>> to use it but rather @Dependent or @ApplicationScoped, @Produces in
>> EJBs (@ManagedBean is considered this way) are not that good since you
>> can't ignore an EJB, just use normal CDI beans
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2014-02-02 Abhijit Sarkar <so...@outlook.com>:
>> > Thank you for looking into it.
>> > "> first if you change everything it is hard to understand the cause"
>> > Nothing was changed, neither the code, nor the output I attached with
the email. Why do you say that?
>> > "> secondly your example is not self contained and need some dep it
can't retrive by default"
>> > Probably you're referring to the dependency
'name.abhijitsarkar.util.logging:logging-util'. It's a logging module I use
- I didn't know you'd actually try to execute the code. I've replaced it
with SLF4J now.
>> > "lastly you use @ManagedBean which is surely not what you want"Without
@ManagedBean, the OpenEJB container complains that it can't find the beans.
I don't have the error message handy else I'd have put it here. Perhaps a
package scan or something similar needs to be set?
>> >> From: rmannibucau@gmail.com
>> >> Date: Sun, 2 Feb 2014 08:50:21 +0100
>> >> Subject: Re: StackOverflowError
>> >> To: dev@tomee.apache.org
>> >>
>> >> Hi
>> >>
>> >> first if you change everything it is hard to understand the cause,
>> >> secondly your example is not self contained and need some dep it can't
>> >> retrive by default, lastly you use @ManagedBean which is surely not
>> >> what you want, is it intended?
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >>
>> >> 2014-02-02 Abhijit Sarkar <so...@outlook.com>:
>> >> > Hi,
>> >> > I'm getting a StackOverflowError while running tests on the
application.
>> >> > This is a pet project which I'm migrating from Java/Spring/Maven to
>> >> > Groovy/CDI/Gradle. Is it ok to ask for help here or is there
another more
>> >> > appropriate group?
>> >> > In case someone decides to help me out, the code is here
>> >> > (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager)
and I've
>> >> > attached a build log with this email. One thing I noticed, which
may not
>> >> > even be related, is that 2 beans I'm trying to override using
@Specializes
>> >> > are still getting deployed.
>> >> >
>> >> > Java 1.7.0_51-b13, Open EJB 4.6.1-SNAPSHOT
>> >> >
>> >> > Regards,
>> >> > Abhijit
>> >
>
--
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau
<http://fr.linkedin.com/in/rmannibucau>*
*Github: https://github.com/rmannibucau <https://github.com/rmannibucau>*
RE: StackOverflowError
Posted by Abhijit Sarkar <so...@outlook.com>.
After struggling all day with it, I switched to using Apache DeltaSpike with Weld and it told me that I had circular dependencies. I'd think that's where the StackOverflowError was coming from but OWB fails to recognize the root cause (improvement option?).
Anyway, after fixing the circular dependencies problem, I'm back to OWB again but now my injected dependencies are null. Surprisingly, there's not any good account of how to unit test CDI with DeltaSpike and OWB. From the scanty documentation, I seem to be doing nothing wrong.
Anyone wants to take a look? The project can be downloaded from GitHub (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and the following command would readily expose the aforementioned issue:
gradle -PskipCoverage -Dtest.single=CDITestSuite clean build
Regards,Abhijit
> From: rmannibucau@gmail.com
> Date: Sun, 2 Feb 2014 10:00:23 +0100
> Subject: Re: StackOverflowError
> To: dev@tomee.apache.org
>
> 1)
> java -> groovy
> mvn -> gradle
> spring -> cdi
>
> all can have side effects (in particular groovy and IoC), groovy
> should be well handled
>
> 3) @ManagedBean is alsmot a stateful so I'm pretty sure you don't want
> to use it but rather @Dependent or @ApplicationScoped, @Produces in
> EJBs (@ManagedBean is considered this way) are not that good since you
> can't ignore an EJB, just use normal CDI beans
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-02-02 Abhijit Sarkar <so...@outlook.com>:
> > Thank you for looking into it.
> > "> first if you change everything it is hard to understand the cause"
> > Nothing was changed, neither the code, nor the output I attached with the email. Why do you say that?
> > "> secondly your example is not self contained and need some dep it can't retrive by default"
> > Probably you're referring to the dependency 'name.abhijitsarkar.util.logging:logging-util'. It's a logging module I use - I didn't know you'd actually try to execute the code. I've replaced it with SLF4J now.
> > "lastly you use @ManagedBean which is surely not what you want"Without @ManagedBean, the OpenEJB container complains that it can't find the beans. I don't have the error message handy else I'd have put it here. Perhaps a package scan or something similar needs to be set?
> >> From: rmannibucau@gmail.com
> >> Date: Sun, 2 Feb 2014 08:50:21 +0100
> >> Subject: Re: StackOverflowError
> >> To: dev@tomee.apache.org
> >>
> >> Hi
> >>
> >> first if you change everything it is hard to understand the cause,
> >> secondly your example is not self contained and need some dep it can't
> >> retrive by default, lastly you use @ManagedBean which is surely not
> >> what you want, is it intended?
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2014-02-02 Abhijit Sarkar <so...@outlook.com>:
> >> > Hi,
> >> > I'm getting a StackOverflowError while running tests on the application.
> >> > This is a pet project which I'm migrating from Java/Spring/Maven to
> >> > Groovy/CDI/Gradle. Is it ok to ask for help here or is there another more
> >> > appropriate group?
> >> > In case someone decides to help me out, the code is here
> >> > (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and I've
> >> > attached a build log with this email. One thing I noticed, which may not
> >> > even be related, is that 2 beans I'm trying to override using @Specializes
> >> > are still getting deployed.
> >> >
> >> > Java 1.7.0_51-b13, Open EJB 4.6.1-SNAPSHOT
> >> >
> >> > Regards,
> >> > Abhijit
> >
Re: StackOverflowError
Posted by Romain Manni-Bucau <rm...@gmail.com>.
1)
java -> groovy
mvn -> gradle
spring -> cdi
all can have side effects (in particular groovy and IoC), groovy
should be well handled
3) @ManagedBean is alsmot a stateful so I'm pretty sure you don't want
to use it but rather @Dependent or @ApplicationScoped, @Produces in
EJBs (@ManagedBean is considered this way) are not that good since you
can't ignore an EJB, just use normal CDI beans
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-02-02 Abhijit Sarkar <so...@outlook.com>:
> Thank you for looking into it.
> "> first if you change everything it is hard to understand the cause"
> Nothing was changed, neither the code, nor the output I attached with the email. Why do you say that?
> "> secondly your example is not self contained and need some dep it can't retrive by default"
> Probably you're referring to the dependency 'name.abhijitsarkar.util.logging:logging-util'. It's a logging module I use - I didn't know you'd actually try to execute the code. I've replaced it with SLF4J now.
> "lastly you use @ManagedBean which is surely not what you want"Without @ManagedBean, the OpenEJB container complains that it can't find the beans. I don't have the error message handy else I'd have put it here. Perhaps a package scan or something similar needs to be set?
>> From: rmannibucau@gmail.com
>> Date: Sun, 2 Feb 2014 08:50:21 +0100
>> Subject: Re: StackOverflowError
>> To: dev@tomee.apache.org
>>
>> Hi
>>
>> first if you change everything it is hard to understand the cause,
>> secondly your example is not self contained and need some dep it can't
>> retrive by default, lastly you use @ManagedBean which is surely not
>> what you want, is it intended?
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2014-02-02 Abhijit Sarkar <so...@outlook.com>:
>> > Hi,
>> > I'm getting a StackOverflowError while running tests on the application.
>> > This is a pet project which I'm migrating from Java/Spring/Maven to
>> > Groovy/CDI/Gradle. Is it ok to ask for help here or is there another more
>> > appropriate group?
>> > In case someone decides to help me out, the code is here
>> > (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and I've
>> > attached a build log with this email. One thing I noticed, which may not
>> > even be related, is that 2 beans I'm trying to override using @Specializes
>> > are still getting deployed.
>> >
>> > Java 1.7.0_51-b13, Open EJB 4.6.1-SNAPSHOT
>> >
>> > Regards,
>> > Abhijit
>
RE: StackOverflowError
Posted by Abhijit Sarkar <so...@outlook.com>.
Thank you for looking into it.
"> first if you change everything it is hard to understand the cause"
Nothing was changed, neither the code, nor the output I attached with the email. Why do you say that?
"> secondly your example is not self contained and need some dep it can't retrive by default"
Probably you're referring to the dependency 'name.abhijitsarkar.util.logging:logging-util'. It's a logging module I use - I didn't know you'd actually try to execute the code. I've replaced it with SLF4J now.
"lastly you use @ManagedBean which is surely not what you want"Without @ManagedBean, the OpenEJB container complains that it can't find the beans. I don't have the error message handy else I'd have put it here. Perhaps a package scan or something similar needs to be set?
> From: rmannibucau@gmail.com
> Date: Sun, 2 Feb 2014 08:50:21 +0100
> Subject: Re: StackOverflowError
> To: dev@tomee.apache.org
>
> Hi
>
> first if you change everything it is hard to understand the cause,
> secondly your example is not self contained and need some dep it can't
> retrive by default, lastly you use @ManagedBean which is surely not
> what you want, is it intended?
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-02-02 Abhijit Sarkar <so...@outlook.com>:
> > Hi,
> > I'm getting a StackOverflowError while running tests on the application.
> > This is a pet project which I'm migrating from Java/Spring/Maven to
> > Groovy/CDI/Gradle. Is it ok to ask for help here or is there another more
> > appropriate group?
> > In case someone decides to help me out, the code is here
> > (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and I've
> > attached a build log with this email. One thing I noticed, which may not
> > even be related, is that 2 beans I'm trying to override using @Specializes
> > are still getting deployed.
> >
> > Java 1.7.0_51-b13, Open EJB 4.6.1-SNAPSHOT
> >
> > Regards,
> > Abhijit
Re: StackOverflowError
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi
first if you change everything it is hard to understand the cause,
secondly your example is not self contained and need some dep it can't
retrive by default, lastly you use @ManagedBean which is surely not
what you want, is it intended?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-02-02 Abhijit Sarkar <so...@outlook.com>:
> Hi,
> I'm getting a StackOverflowError while running tests on the application.
> This is a pet project which I'm migrating from Java/Spring/Maven to
> Groovy/CDI/Gradle. Is it ok to ask for help here or is there another more
> appropriate group?
> In case someone decides to help me out, the code is here
> (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and I've
> attached a build log with this email. One thing I noticed, which may not
> even be related, is that 2 beans I'm trying to override using @Specializes
> are still getting deployed.
>
> Java 1.7.0_51-b13, Open EJB 4.6.1-SNAPSHOT
>
> Regards,
> Abhijit
StackOverflowError
Posted by Abhijit Sarkar <so...@outlook.com>.
Hi,I'm getting a StackOverflowError while running tests on the application. This is a pet project which I'm migrating from Java/Spring/Maven to Groovy/CDI/Gradle. Is it ok to ask for help here or is there another more appropriate group?In case someone decides to help me out, the code is here (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and I've attached a build log with this email. One thing I noticed, which may not even be related, is that 2 beans I'm trying to override using @Specializes are still getting deployed.
Java 1.7.0_51-b13, Open EJB 4.6.1-SNAPSHOT
Regards,Abhijit