Question posted on stackoverflow

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Question posted on stackoverflow

tomorrow
Hi,
I posted a question previously on stackoverflow, here is the link
http://stackoverflow.com/questions/5047059/bitronix-transaction-manager
I didn't want to expose too much information but I really appreciate your help on this problem.

I am aware that spring configuration gets in the way when running unit tests and tries to create the datasource again,
hence the error message.

Caused by: java.lang.IllegalArgumentException: resource with uniqueName 'xyzDb' has already been registered

Can you tell me what is the best way to accomplish this? I can provide any specific information that you might need, config..etc.

Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: Question posted on stackoverflow

Ludovic Orban-2
You aren't the only once facing this problem. Have you checked this thread: http://old.nabble.com/test-failures-on-multiple-spring-test-classes-ts30133286.html ?

IIRC Spring 2.5.x doesn't automatically close the context and you have to do that yourself with a @AfterClass method. At least, that was proposed solution which seems to work.

2011/2/25 Austin <[hidden email]>
Hi,
I posted a question previously on stackoverflow, here is the link
http://stackoverflow.com/questions/5047059/bitronix-transaction-manager
I didn't want to expose too much information but I really appreciate your help on this problem.

I am aware that spring configuration gets in the way when running unit tests and tries to create the datasource again,
hence the error message.

Caused by: java.lang.IllegalArgumentException: resource with uniqueName 'xyzDb' has already been registered

Can you tell me what is the best way to accomplish this? I can provide any specific information that you might need, config..etc.

Thank you.


Reply | Threaded
Open this post in threaded view
|

Re: Question posted on stackoverflow

snicoll
Speaking of that, that's probably something that should be reported to
the Spring issue tracker.

S.

On Fri, Feb 25, 2011 at 10:29 PM, Ludovic Orban <[hidden email]> wrote:

> You aren't the only once facing this problem. Have you checked this thread:
> http://old.nabble.com/test-failures-on-multiple-spring-test-classes-ts30133286.html
> ?
>
> IIRC Spring 2.5.x doesn't automatically close the context and you have to do
> that yourself with a @AfterClass method. At least, that was proposed
> solution which seems to work.
>
> 2011/2/25 Austin <[hidden email]>
>>
>> Hi,
>> I posted a question previously on stackoverflow, here is the link
>> http://stackoverflow.com/questions/5047059/bitronix-transaction-manager
>> I didn't want to expose too much information but I really appreciate your
>> help on this problem.
>>
>> I am aware that spring configuration gets in the way when running unit
>> tests and tries to create the datasource again,
>> hence the error message.
>>
>> Caused by: java.lang.IllegalArgumentException: resource with uniqueName
>> 'xyzDb' has already been registered
>>
>> Can you tell me what is the best way to accomplish this? I can provide any
>> specific information that you might need, config..etc.
>>
>> Thank you.
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Question posted on stackoverflow

Ludovic Orban-2
I can't say for sure what's going on, maybe you missed something in your spring config like specifying the shutdown method on the datasource bean or something more subtle.

Let me repeat that: if you get an exception saying that a resource with 'xyz' unique name is already registered this always means this resource is getting recreated but not closed. Now figuring out why this happens often is non-trivial in a spring environment.

I back Stephane Nicoll's suggestion: this should be reported to SpringSource. They may be able to help and fix the problem in a future release.


2011/2/26 Stephane Nicoll <[hidden email]>
Speaking of that, that's probably something that should be reported to
the Spring issue tracker.

S.

On Fri, Feb 25, 2011 at 10:29 PM, Ludovic Orban <[hidden email]> wrote:
> You aren't the only once facing this problem. Have you checked this thread:
> http://old.nabble.com/test-failures-on-multiple-spring-test-classes-ts30133286.html
> ?
>
> IIRC Spring 2.5.x doesn't automatically close the context and you have to do
> that yourself with a @AfterClass method. At least, that was proposed
> solution which seems to work.
>
> 2011/2/25 Austin <[hidden email]>
>>
>> Hi,
>> I posted a question previously on stackoverflow, here is the link
>> http://stackoverflow.com/questions/5047059/bitronix-transaction-manager
>> I didn't want to expose too much information but I really appreciate your
>> help on this problem.
>>
>> I am aware that spring configuration gets in the way when running unit
>> tests and tries to create the datasource again,
>> hence the error message.
>>
>> Caused by: java.lang.IllegalArgumentException: resource with uniqueName
>> 'xyzDb' has already been registered
>>
>> Can you tell me what is the best way to accomplish this? I can provide any
>> specific information that you might need, config..etc.
>>
>> Thank you.
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email