Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring自动连线gwt RemoteServiceServlet实现类为null_Java_Spring_Gwt_Autowired - Fatal编程技术网

Java Spring自动连线gwt RemoteServiceServlet实现类为null

Java Spring自动连线gwt RemoteServiceServlet实现类为null,java,spring,gwt,autowired,Java,Spring,Gwt,Autowired,我的项目中有两个gwt RemoteServiceServlet,它使用gwt框架,如下所示 @RemoteServiceRelativePath("AuthService") public interface AuthService extends RemoteService { } public class AuthServiceImpl extends RemoteServiceServlet implements AuthService { @Autowired p

我的项目中有两个gwt RemoteServiceServlet,它使用gwt框架,如下所示

@RemoteServiceRelativePath("AuthService")
public interface AuthService extends RemoteService {
}

public class AuthServiceImpl extends RemoteServiceServlet implements AuthService
{
     @Autowired
     private StoredService storeService;
}

@RemoteServiceRelativePath("webService")
public interface WebService extends RemoteService
{
}

public class WebServiceImpl extends RemoteServiceServlet implements WebService
{
     @Autowired
     private LogService logService;
}
StoreService和LogService的@Autowired都可以工作。但当我尝试在AuthService中自动连接WebService时,它在运行时将为null

接口和实现位于不同的包中,分别是com.test.client.service和com.test.server.service

我已确认我的SpringApplication-context.xml已声明如下:

<context:component-scan
    base-package="com.test.client.service, com.test.server.service
>
这是因为RemoteService导致自动连线无法正常工作吗? 感谢您的帮助


谢谢

我使用以下内容将GWT-RPC集成到Spring中。我6年前写的,从来没有看到需要改变它。这是一个古老的学校,它的工作。它将GWT-RPC服务建模为Spring MVC控制器,它们是。您可以将任何内容自动连接到这些控制器中

我在另一个回答中提到了这一点,因此我将发布一个链接:

@Override
public void init(ServletConfig config) throws ServletException {
    super.init(config);

    WebApplicationContextUtils.getWebApplicationContext(config.getServletContext())
        .getAutowireCapableBeanFactory().autowireBean(this);
}