users@jersey.java.net

Re: [Jersey] Jersey Spring CONTEXT_CONFIG_LOCATION <was> Re: [Jersey] Problems using JerseyTest

From: tarjei <tarjei_at_nu.no>
Date: Thu, 08 Oct 2009 12:36:58 +0200

Great :)

Do you have maven packages somewhere I can test them?
regards,
Tarjei
On 10/08/2009 12:10 PM, Paul Sandoz wrote:
>
> On Oct 7, 2009, at 11:47 AM, tarjei wrote:
>
>> Hi,
>>
>> On 10/06/2009 04:09 PM, Paul Sandoz wrote:
>>>
>>> I think this is a bug in the Jersey spring configuration and it should
>>> also fail if using a web.xml. Is that your experience?
>> I do not wire web.xml the same way but your analysis below seems
>> correct to me.
>>
>> I have posted a bug[1] on the issue. Do you think a fix will be
>> included in the 1.1.4 release?
>>
>> 1. https://jersey.dev.java.net/issues/show_bug.cgi?id=381
>>
>
> Fixed in the 1.1.4 branch (i will also propagate to the trunk).
>
> Paul.
>
>
>> kind regards,
>> Tarjei
>>
>>
>>
>>
>>>
>>> The problem is in the following method on the Jersey SpringServlet:
>>>
>>> private ConfigurableApplicationContext getChildContext(String
>>> contextConfigLocation) {
>>> final ConfigurableWebApplicationContext ctx = new
>>> XmlWebApplicationContext();
>>> ctx.setParent(getDefaultContext());
>>> ctx.setServletContext(getServletContext());
>>> ctx.setConfigLocations(new String[]{contextConfigLocation}); //
>>> <-- Problem is here
>>>
>>> ctx.refresh();
>>> return ctx;
>>> }
>>>
>>> It appears that the method call to:
>>>
>>> ctx.setConfigLocations(new String[]{contextConfigLocation});
>>>
>>> http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/context/ConfigurableWebApplicationContext.html#setConfigLocations%28java.lang.String[]%29
>>>
>>>
>>>
>>> is wrong and it should be:
>>>
>>> ctx.setConfigLocation(contextConfigLocation);
>>>
>>> i.e. the call with the array assumes only one location per element.
>>>
>>> Could you log an issue?
>>
>>
>> --
>> Tarjei Huse
>> Mobil: 920 63 413
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>


-- 
Tarjei Huse
Mobil: 920 63 413