You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Marius Kruger <am...@gmail.com> on 2014/09/24 03:59:46 UTC

small regression in openejb 4.7.1 since 4.7.0 in weird sub-bean edge case

hey,
I found that upgrading from 4.7.0 to 4.7.1 broke some of my tests.
I spent some time to narrow it down:
it happens if you have a bean in your project and then extend it in a test
bean then it appears that openejb tries to load the parent twice and I get
a NameAlreadyBoundException

the error goes away if I either
* change the version back to 4.7.0
* stop extending the parent bean
* make the parent a normal class
* move the main bean to src/test/java
* move the test bean to src/main/java   (so maybe its a maven classpath
issue?)


here is  a project that displays a failing test:

$ git clone https://github.com/amanica/tomee-embedded-trial.git
$ cd tomee-embedded-trial
$ git checkout d517ae9      #for in case I commit something later
$ mvn clean install -Dtest=PingRSEmbeddedOpenEjbTest


-------------------------------------------------------------------------------
Test set: com.example.PingRSEmbeddedOpenEjbTest
-------------------------------------------------------------------------------
Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 3.275 sec
<<< FAILURE!
ping(com.example.PingRSEmbeddedOpenEjbTest)  Time elapsed: 2.657 sec  <<<
ERROR!
java.lang.RuntimeException: Could not start up container.
at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:95)
at com.example.AOpenEjbTest.injectContext(AOpenEjbTest.java:67)
at com.example.AOpenEjbTest.setupAOpenEjbTest(AOpenEjbTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by:
org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
org.apache.openejb.OpenEJBException: Creating application failed:
/stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind business remote
deployment in jndi.
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:339)
at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
at com.example.AOpenEjbTest.getContext(AOpenEjbTest.java:101)
at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:77)
... 32 more
Caused by: org.apache.openejb.OpenEJBException: Creating application
failed: /stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind
business remote deployment in jndi.
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:896)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:623)
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:335)
... 35 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: Unable to bind
business remote deployment in jndi.
at
org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:448)
at
org.apache.openejb.assembler.classic.JndiBuilder.build(JndiBuilder.java:92)
at
org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:1017)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:788)
... 37 more
Caused by: javax.naming.NameAlreadyBoundException:
openejb/Deployment/PingRS/com.example.PingRS!LocalBeanHome
at
org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:661)
at
org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:436)
... 40 more

ping2(com.example.PingRSEmbeddedOpenEjbTest)  Time elapsed: 0.303 sec  <<<
ERROR!
java.lang.RuntimeException: Could not start up container.
at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:95)
at com.example.AOpenEjbTest.injectContext(AOpenEjbTest.java:67)
at com.example.AOpenEjbTest.setupAOpenEjbTest(AOpenEjbTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by:
org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
org.apache.openejb.OpenEJBException: Creating application failed:
/stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind business remote
deployment in jndi.
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:339)
at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
at com.example.AOpenEjbTest.getContext(AOpenEjbTest.java:101)
at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:77)
... 32 more
Caused by: org.apache.openejb.OpenEJBException: Creating application
failed: /stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind
business remote deployment in jndi.
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:896)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:623)
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:335)
... 35 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: Unable to bind
business remote deployment in jndi.
at
org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:448)
at
org.apache.openejb.assembler.classic.JndiBuilder.build(JndiBuilder.java:92)
at
org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:1017)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:788)
... 37 more
Caused by: javax.naming.NameAlreadyBoundException:
openejb/Deployment/PingRS/com.example.PingRS!LocalBeanHome
at
org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:661)
at
org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:436)
... 40 more

giveMeADuck(com.example.PingRSEmbeddedOpenEjbTest)  Time elapsed: 0.227 sec
 <<< ERROR!
java.lang.RuntimeException: Could not start up container.
at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:95)
at com.example.AOpenEjbTest.injectContext(AOpenEjbTest.java:67)
at com.example.AOpenEjbTest.setupAOpenEjbTest(AOpenEjbTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by:
org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
org.apache.openejb.OpenEJBException: Creating application failed:
/stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind business remote
deployment in jndi.
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:339)
at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
at com.example.AOpenEjbTest.getContext(AOpenEjbTest.java:101)
at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:77)
... 32 more
Caused by: org.apache.openejb.OpenEJBException: Creating application
failed: /stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind
business remote deployment in jndi.
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:896)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:623)
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:335)
... 35 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: Unable to bind
business remote deployment in jndi.
at
org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:448)
at
org.apache.openejb.assembler.classic.JndiBuilder.build(JndiBuilder.java:92)
at
org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:1017)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:788)
... 37 more
Caused by: javax.naming.NameAlreadyBoundException:
openejb/Deployment/PingRS/com.example.PingRS!LocalBeanHome
at
org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:661)
at
org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:436)
... 40 more


-- 
✝ Marius

Re: small regression in openejb 4.7.1 since 4.7.0 in weird sub-bean edge case

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Marius, trunk and we'll backport it to 1.7.x


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-09-24 13:09 GMT+02:00 Marius Kruger <am...@gmail.com>:
> Thanks guys, I can have a go at adding a test, what branch should I target?

Re: small regression in openejb 4.7.1 since 4.7.0 in weird sub-bean edge case

Posted by Marius Kruger <am...@gmail.com>.
Thanks guys, I can have a go at adding a test, what branch should I target?

Re: small regression in openejb 4.7.1 since 4.7.0 in weird sub-bean edge case

Posted by Romain Manni-Bucau <rm...@gmail.com>.
well to be honest it was in xbean 4 upgrade which changed so much
things that this was the least issue at the moment and that's why it
passed through the release this way.

WHat I'm not sure is we should have a test about it somewhere (when I
added ModuleLimitedFinder). But doesn't hurt to add one for tomee
embedded (where we miss some tests surely)


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-09-24 10:24 GMT+02:00 Andy Gumbrecht <ag...@tomitribe.com>:
> It's a nice feature, but I think ensuring backwards compatibility is
> essential to keeping existing users happy - Marius obviously spent a lot of
> time tracking this down and the resolution is down to your extreme in depth
> knowledge of internals.
>
> "just add openejb.finder.module-scoped=true" (To
> [tomee]/conf/system.properties btw.) is a small statement with a huge
> impact. We can't all have you in our back pocket, but great that you are
> here on the forum for these things.
>
> However, things like this must without question be in the release
> announcement and not tucked away in notes, especially if the default /
> existing functionality has changed.
>
> It's too late to change now (I will still add it to the page though), but we
> all have to be careful not to drive people away with issues like this. I
> would rather see the test from Marius in the project to ensure that it is
> not repeated.
>
> Andy.
>
>
> On 24/09/2014 10:03, Romain Manni-Bucau wrote:
>>
>> 2014-09-24 9:50 GMT+02:00 Andy Gumbrecht <ag...@tomitribe.com>:
>>>
>>> What does openejb.finder.module-scoped=true do, where is it documented
>>> and
>>> should it then not be true by default if it breaks previous
>>> functionality?
>>>
>> it ensure we don't scan classes outside current module.
>>
>> should it be true? yes and no. In 80% of apps it doesn't change
>> anything excepted it goes really faster for big apps.
>>
>> you can set it to true by default if you think that's better but TCKs
>> and out tests don't care AFAIK.
>>
>>> Andy.
>>>
>>> On 24/09/2014 08:02, Romain Manni-Bucau wrote:
>>>>
>>>> Hi
>>>>
>>>> just add openejb.finder.module-scoped=true
>>>>
>>>>
>>>> --
>>>> ✝ Marius
>>>
>>>
>>>
>>> --
>>>    Andy Gumbrecht
>>>    https://twitter.com/AndyGeeDe
>>>    http://www.tomitribe.com
>>>
>>
>
> --
>   Andy Gumbrecht
>   https://twitter.com/AndyGeeDe
>   http://www.tomitribe.com
>

Re: small regression in openejb 4.7.1 since 4.7.0 in weird sub-bean edge case

Posted by Andy Gumbrecht <ag...@tomitribe.com>.
It's a nice feature, but I think ensuring backwards compatibility is 
essential to keeping existing users happy - Marius obviously spent a lot 
of time tracking this down and the resolution is down to your extreme in 
depth knowledge of internals.

"just add openejb.finder.module-scoped=true" (To 
[tomee]/conf/system.properties btw.) is a small statement with a huge 
impact. We can't all have you in our back pocket, but great that you are 
here on the forum for these things.

However, things like this must without question be in the release 
announcement and not tucked away in notes, especially if the default / 
existing functionality has changed.

It's too late to change now (I will still add it to the page though), 
but we all have to be careful not to drive people away with issues like 
this. I would rather see the test from Marius in the project to ensure 
that it is not repeated.

Andy.

On 24/09/2014 10:03, Romain Manni-Bucau wrote:
> 2014-09-24 9:50 GMT+02:00 Andy Gumbrecht <ag...@tomitribe.com>:
>> What does openejb.finder.module-scoped=true do, where is it documented and
>> should it then not be true by default if it breaks previous functionality?
>>
> it ensure we don't scan classes outside current module.
>
> should it be true? yes and no. In 80% of apps it doesn't change
> anything excepted it goes really faster for big apps.
>
> you can set it to true by default if you think that's better but TCKs
> and out tests don't care AFAIK.
>
>> Andy.
>>
>> On 24/09/2014 08:02, Romain Manni-Bucau wrote:
>>> Hi
>>>
>>> just add openejb.finder.module-scoped=true
>>>
>>>
>>> --
>>> ✝ Marius
>>
>>
>> --
>>    Andy Gumbrecht
>>    https://twitter.com/AndyGeeDe
>>    http://www.tomitribe.com
>>
>

-- 
   Andy Gumbrecht
   https://twitter.com/AndyGeeDe
   http://www.tomitribe.com


Re: small regression in openejb 4.7.1 since 4.7.0 in weird sub-bean edge case

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2014-09-24 9:50 GMT+02:00 Andy Gumbrecht <ag...@tomitribe.com>:
> What does openejb.finder.module-scoped=true do, where is it documented and
> should it then not be true by default if it breaks previous functionality?
>

it ensure we don't scan classes outside current module.

should it be true? yes and no. In 80% of apps it doesn't change
anything excepted it goes really faster for big apps.

you can set it to true by default if you think that's better but TCKs
and out tests don't care AFAIK.

> Andy.
>
> On 24/09/2014 08:02, Romain Manni-Bucau wrote:
>>
>> Hi
>>
>> just add openejb.finder.module-scoped=true
>>
>>
>> --
>> ✝ Marius
>
>
>
> --
>   Andy Gumbrecht
>   https://twitter.com/AndyGeeDe
>   http://www.tomitribe.com
>

Re: small regression in openejb 4.7.1 since 4.7.0 in weird sub-bean edge case

Posted by Andy Gumbrecht <ag...@tomitribe.com>.
What does openejb.finder.module-scoped=true do, where is it documented 
and should it then not be true by default if it breaks previous 
functionality?

Andy.

On 24/09/2014 08:02, Romain Manni-Bucau wrote:
> Hi
>
> just add openejb.finder.module-scoped=true
>
>
> --
> ✝ Marius


-- 
   Andy Gumbrecht
   https://twitter.com/AndyGeeDe
   http://www.tomitribe.com


Re: small regression in openejb 4.7.1 since 4.7.0 in weird sub-bean edge case

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

just add openejb.finder.module-scoped=true


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-09-24 3:59 GMT+02:00 Marius Kruger <am...@gmail.com>:
> hey,
> I found that upgrading from 4.7.0 to 4.7.1 broke some of my tests.
> I spent some time to narrow it down:
> it happens if you have a bean in your project and then extend it in a test
> bean then it appears that openejb tries to load the parent twice and I get
> a NameAlreadyBoundException
>
> the error goes away if I either
> * change the version back to 4.7.0
> * stop extending the parent bean
> * make the parent a normal class
> * move the main bean to src/test/java
> * move the test bean to src/main/java   (so maybe its a maven classpath
> issue?)
>
>
> here is  a project that displays a failing test:
>
> $ git clone https://github.com/amanica/tomee-embedded-trial.git
> $ cd tomee-embedded-trial
> $ git checkout d517ae9      #for in case I commit something later
> $ mvn clean install -Dtest=PingRSEmbeddedOpenEjbTest
>
>
> -------------------------------------------------------------------------------
> Test set: com.example.PingRSEmbeddedOpenEjbTest
> -------------------------------------------------------------------------------
> Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 3.275 sec
> <<< FAILURE!
> ping(com.example.PingRSEmbeddedOpenEjbTest)  Time elapsed: 2.657 sec  <<<
> ERROR!
> java.lang.RuntimeException: Could not start up container.
> at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:95)
> at com.example.AOpenEjbTest.injectContext(AOpenEjbTest.java:67)
> at com.example.AOpenEjbTest.setupAOpenEjbTest(AOpenEjbTest.java:35)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
> at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
> at
> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
> Caused by:
> org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
> org.apache.openejb.OpenEJBException: Creating application failed:
> /stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind business remote
> deployment in jndi.
> at
> org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:339)
> at
> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
> at com.example.AOpenEjbTest.getContext(AOpenEjbTest.java:101)
> at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:77)
> ... 32 more
> Caused by: org.apache.openejb.OpenEJBException: Creating application
> failed: /stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind
> business remote deployment in jndi.
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:896)
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:623)
> at
> org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:335)
> ... 35 more
> Caused by: org.apache.openejb.OpenEJBRuntimeException: Unable to bind
> business remote deployment in jndi.
> at
> org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:448)
> at
> org.apache.openejb.assembler.classic.JndiBuilder.build(JndiBuilder.java:92)
> at
> org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:1017)
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:788)
> ... 37 more
> Caused by: javax.naming.NameAlreadyBoundException:
> openejb/Deployment/PingRS/com.example.PingRS!LocalBeanHome
> at
> org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:661)
> at
> org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:436)
> ... 40 more
>
> ping2(com.example.PingRSEmbeddedOpenEjbTest)  Time elapsed: 0.303 sec  <<<
> ERROR!
> java.lang.RuntimeException: Could not start up container.
> at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:95)
> at com.example.AOpenEjbTest.injectContext(AOpenEjbTest.java:67)
> at com.example.AOpenEjbTest.setupAOpenEjbTest(AOpenEjbTest.java:35)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
> at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
> at
> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
> Caused by:
> org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
> org.apache.openejb.OpenEJBException: Creating application failed:
> /stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind business remote
> deployment in jndi.
> at
> org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:339)
> at
> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
> at com.example.AOpenEjbTest.getContext(AOpenEjbTest.java:101)
> at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:77)
> ... 32 more
> Caused by: org.apache.openejb.OpenEJBException: Creating application
> failed: /stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind
> business remote deployment in jndi.
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:896)
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:623)
> at
> org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:335)
> ... 35 more
> Caused by: org.apache.openejb.OpenEJBRuntimeException: Unable to bind
> business remote deployment in jndi.
> at
> org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:448)
> at
> org.apache.openejb.assembler.classic.JndiBuilder.build(JndiBuilder.java:92)
> at
> org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:1017)
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:788)
> ... 37 more
> Caused by: javax.naming.NameAlreadyBoundException:
> openejb/Deployment/PingRS/com.example.PingRS!LocalBeanHome
> at
> org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:661)
> at
> org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:436)
> ... 40 more
>
> giveMeADuck(com.example.PingRSEmbeddedOpenEjbTest)  Time elapsed: 0.227 sec
>  <<< ERROR!
> java.lang.RuntimeException: Could not start up container.
> at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:95)
> at com.example.AOpenEjbTest.injectContext(AOpenEjbTest.java:67)
> at com.example.AOpenEjbTest.setupAOpenEjbTest(AOpenEjbTest.java:35)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
> at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
> at
> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
> Caused by:
> org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
> org.apache.openejb.OpenEJBException: Creating application failed:
> /stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind business remote
> deployment in jndi.
> at
> org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:339)
> at
> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
> at com.example.AOpenEjbTest.getContext(AOpenEjbTest.java:101)
> at com.example.AOpenEjbTest.inject(AOpenEjbTest.java:77)
> ... 32 more
> Caused by: org.apache.openejb.OpenEJBException: Creating application
> failed: /stf/prj/tmp/tomee-embedded-trial/myAppName: Unable to bind
> business remote deployment in jndi.
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:896)
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:623)
> at
> org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:335)
> ... 35 more
> Caused by: org.apache.openejb.OpenEJBRuntimeException: Unable to bind
> business remote deployment in jndi.
> at
> org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:448)
> at
> org.apache.openejb.assembler.classic.JndiBuilder.build(JndiBuilder.java:92)
> at
> org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:1017)
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:788)
> ... 37 more
> Caused by: javax.naming.NameAlreadyBoundException:
> openejb/Deployment/PingRS/com.example.PingRS!LocalBeanHome
> at
> org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:661)
> at
> org.apache.openejb.assembler.classic.JndiBuilder.bind(JndiBuilder.java:436)
> ... 40 more
>
>
> --
> ✝ Marius