Monday, November 23, 2015

spring4gwt error:Spring bean not found: querySenior

I am trying to make gwt-2.7 work with spring-4.2.3.Configurations are:


<!-- spring config -->  <context-param>      <param-name>contextConfigLocation</param-name>      <param-value>/WEB-INF/applicationContext.xml</param-value>  </context-param>  <listener>      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>  </listener>    <!-- Spring GWT integration -->  <servlet>      <servlet-name>springGwtRemoteServiceServlet</servlet-name>      <servlet-class>org.spring4gwt.server.SpringGwtRemoteServiceServlet</servlet-class>  </servlet>  <servlet-mapping>      <servlet-name>springGwtRemoteServiceServlet</servlet-name>      <url-pattern>/idp_web/service/*</url-pattern>  </servlet-mapping>


<beans   ...   ....  default-lazy-init="true">    <!-- auto-inject bean by annotation mechanism -->  <context:component-scan      base-package="com.vsi.idp.analysis.server,                      com.vsi.idp.base.server,                      com.vsi.idp.kpi.server,            ,                      com.vsi.idp.statistics.server" />         //other configurations  </beans>

GWT services

@RemoteServiceRelativePath("service/querySenior")  public interface SeniorQueryService extends RemoteService{...}

service impl

@Service("querySenior")  public class SeniorQueryServiceImpl extends RemoteServiceServlet implements SeniorQueryService{...}

Spock unit test works fine

@ContextConfiguration(locations = "file:war/WEB-INF/applicationContext.xml")  public class SeniorQueryServiceImplTest extends Specification{      @Autowired    SeniorQueryServiceImpl service      def "query by full address"(){        //blabla    }  }

Running gwt project tells:

Failed to load resource: the server responded with a status of 500 (Server Error)

Error stack looks like:

[WARN] Exception while dispatching incoming RPC call  java.lang.IllegalArgumentException: Spring bean not found: querySenior  at org.spring4gwt.server.SpringGwtRemoteServiceServlet.getBean(  at org.spring4gwt.server.SpringGwtRemoteServiceServlet.getBean(  at org.spring4gwt.server.SpringGwtRemoteServiceServlet.processCall(  at

I think:

1,"500(server error)" tells that gwt has recognized spring service  2,spring service unit test works fine,so spring configuration is right 

The problem may come from spring4gwt,and how to solve this problem?

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment