|
From: Fábio S. <fab...@ya...> - 2008-08-08 14:12:34
|
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 com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses |