java - Spring RMI 服务器错误

标签 java spring web-applications rmi

Caused by: java.lang.IllegalArgumentException: Service [logService] is a String rather than an actual service reference: Have you accidentally specified the service bean name as value instead of as reference?
<小时/>

这是我的 ServerAppContext 代码:

    <bean id="entityRmiServiceExporter" class="org.springframework.remoting.rmi.RmiServiceExporter">
        <property name="serviceName" value="log-service"/>
        <property name="serviceInterface" value="com.hippie.blog.service.LogService"/>
        <property name="service" value="logService"/>
        <property name="registryPort" value="2020"/>
    </bean>

    <bean id="logService" class="com.hippie.blog.service.LogServiceImpl">
    </bean>

我似乎无法让它发挥作用。我应该输入什么

property name="service" value="logService"

因为这是错误所指的行。 我需要将其引用到我的 LogServiceImpl 吗?

最佳答案

使用如下: <property name="service" ref="logService"/> 当您引用其他 bean 时,请使用 ref 属性,而不是 value。

关于java - Spring RMI 服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34215704/

相关文章:

java - 在 Java 中使用 if 语句检查类

java - 使用默认的 spring 日志记录添加日志记录?

java - Spring + Hibernate 初始化错误 : Cannot find class [<providername>]

java - Spring WS TransformingInterceptor XSLT 复制请求

java - 用 Java 编写简单的 JSON 响应

java - 如果我们在调用函数中有@Transaction,被调用的函数是否仍处于事务中?

jquery - 使用 Hammer.js 和 .on() 绑定(bind)事件

Maven 多模块 Web 应用程序(热插拔)

asp.net - Azure Web 角色中的网站项目

java - 无法从 J2ME 执行 HTTP POST(诺基亚 S40 第 6 版)