On Thu, Apr 2, 2009 at 1:48 PM, Azazel Se <[email protected]> wrote:
>> From: [email protected]
>>
>> "ApplicationContextHolder.getContext()" isn't needed when using
>> SpringServletContextObjectSupplier. If spring and axis2 are working
>> together, you are done. You have to configure Spring to use
>> ApplicationContextHolder, otherwise it will return null values.
>>
>> - R
>
>> From: [email protected]
>> To: [email protected]
>
>> Here, how you try to use context .and can you provide error trace you
>> got ....? i cant get any clue with supplied details .
>> > .   ApplicationContext ctx = ApplicationContextHolder.getContext();
>> I don't think you need to have this line to access SpringContext
>> explicitly , because "MyServ " is already a Spring manged bean. if you
>> want to access any other bean inside "MyServ " use Spring injection
>> instead of access through ApplicationContextHolder.
>
>
>
>
> Hi, thanks for the replies.
>
> I have an application which I didn't make which uses spring, it has an API
> which hides the details and preferably I don't add any more stuff to it. The
> goal is to just use a few of the methods and get returns as normal and not
> interact directly with spring. I have never used Spring before so my
> knowledge about the innerworkings is small but if I get the API to work I
> shouldn't need to either. The springappl needs the context at initiating. I
> have tested it in a jsp file and it works, but I want to move it to a web
> service. In the jsp file I had the same context stuff added to the web.xml
> and this is in the jsp file:
>
> MyApplWithSpring  ap = new
> MyApplWithSpring(WebApplicationContextUtils.getWebApplicationContext(getServletContext()));
>
> This worked and I could use some of its methods afterwards.
> So I thought it would work in the web service as well if I used
> ApplicationContextHolder.getContext() and used new
> MyApplWithSpring(ApplicationContextHolder.getContext()). If possible how do
> I configure spring to use the ApplicationContextHolder so that it isn't
> null? Or is there any other(/better) way I can do this?
>
> -Az.
>

So the "springappl" you didn't write requires an ApplicationContext
reference, even though you are successfully using
SpringServletContextObjectSupplier that doesn't really require an
ApplicationContext reference? If so, I'll show you how to do it.

- R

Reply via email to