|
From: Bill B. <bb...@re...> - 2008-08-08 15:16:55
|
So you want a instance per request model?
I'm not that familiar with spring and the RestEasy code expects a
singleton model.
I'll try out your code and see if I can figure things out.
Fábio Serra wrote:
> Hi,
>
> We have a problem integrating RestEasy and Spring. It seems like when
> two users access the same resource at the same time, the
> SpringContextLoaderListener is not injecting after the first instance.
> After that all the resource instances aren't injected by Spring causing
> NullPointerException at the spring injected objects.
>
> My web.xml is the same as the examples of this integration.
>
> Here is my resource class:
> @Service("locating")
> @Path("/")
> public class LocatingResource {
> public LocatingResource() {
> System.out.println("Instanciando....");
> }
>
> @GET
> @Path("locating")
> public String getLocating() {
> System.out.println("Class: "+ this);
> System.out.println("LOCATING...("+getSpringTest()+")");
> return getSeci().toString();
> }
>
> @Resource
> private Seci seci;
> public void setSeci( Seci seci ) {
> System.out.println("Classe1: " +this);
> System.out.println("SACI2: "+ seci);
> this.seci = seci;
> }
> public Seci getSeci() {
> return this.seci;
> }
> }
>
> My ApplicationContext.xml :
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:context="http://www.springframework.org/schema/context"
> default-autowire="byName"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
>
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> http://www.springframework.org/schema/context
>
> http://www.springframework.org/schema/context/spring-context-2.5.xsd"
>
> >
> <context:annotation-config/>
> <context:spring-configured/>
> <context:component-scan base-package="padauan"
> annotation-config="true"/>
> </bean>
>
>
> Thanks,
>
> Fabio Serra
>
> ------------------------------------------------------------------------
> Novos endereços, o Yahoo! que você conhece. Crie um email novo
> <http://br.rd.yahoo.com/mail/taglines/mail/*http://br.new.mail.yahoo.com/addresses>
> com a sua cara @ymail.com ou @rocketmail.com.
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|