如何解决RMI:RemoteAccountService扩展了Remote
| 我有一个怪异的问题,我在阅读“ 19.使用Spring进行远程处理和Web服务”一节下的Spring Integration文档,它有一个接口,但是没有在任何地方使用。为什么文档中完全讨论此接口?public interface RemoteAccountService extends Remote {
public void insertAccount(Account account) throws RemoteException;
public List<Account> getAccounts(String name) throws RemoteException;
}
解决方法
在19.5.1节中为JAX-RPC包装器类实现了该类。粘贴以下第19.5.1节讨论的前几行:
/**
* JAX-RPC compliant RemoteAccountService implementation that simply delegates
* to the AccountService implementation in the root web application context.
*
* This wrapper class is necessary because JAX-RPC requires working with dedicated
* endpoint classes. If an existing service needs to be exported,a wrapper that
* extends ServletEndpointSupport for simple application context access is
* the simplest JAX-RPC compliant way.
*
* This is the class registered with the server-side JAX-RPC implementation.
* In the case of Axis,this happens in \"server-config.wsdd\" respectively via
* deployment calls. The web service engine manages the lifecycle of instances
* of this class: A Spring application context can just be accessed here.
*/import org.springframework.remoting.jaxrpc.ServletEndpointSupport;
public class AccountServiceEndpoint extends ServletEndpointSupport implements RemoteAccountService {
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。