发表于: 2017-04-06 02:03:25
5 1359
今天完成的事情:终于对SpringRmi有点感悟了,整整一个月啊,原来那些demo已经讲的很清楚了只是当时太菜没看明白;
<bean id="studentServiceExporter" class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName" value="StudentService"/>
<property name="service" ref="studentService"/>
<property name="serviceInterface" value="com.ptteng.service.StudentService"/>
<property name="registryPort" value="8001"/>
<property name="servicePort" value="8002"/>
</bean>
<bean id="studentService" class="com.ptteng.serviceImpl.StudentServiceImpl"></bean>
<bean id="vocationServiceExporter" class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName" value="VocationService"/>
<property name="service" ref="vocationService"/>
<property name="serviceInterface" value="com.ptteng.service.VocationService"/>
<property name="registryPort" value="8003"/>
<property name="servicePort" value="8004"/>
</bean>
<bean id="studentService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="rmi://localhost:8001/StudentService"/>
<property name="serviceInterface" value="com.ptteng.service.StudentService"/>
</bean>
<bean id="vocationService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="rmi://localhost:8003/VocationService"/>
<property name="serviceInterface" value="com.ptteng.service.VocationService"/>
</bean
一个Controller一个在service,启动service之后,注册表端口正确即可访问.
centos的数据库是装好了,但是无法启动服务,晚上还是谨慎操作吧.
明天的计划:完成任务8,巩固Linux;
遇到的问题:ERROR! The server quit without updating PID file (/usr/local/webserver/mysql/mysql.pid明明已经按照教程配置了,在最后关键时刻启动服务的时候出现了一个这个错误,网上的方法很多明天在一个一个试;
收获:
在实现了将近三个远程调用的demo之后终于开窍了,service包主要对数据库操作,core包主要就是一些model和工具类,controller包放Controller和前端页面.但是这些和前后端分离还是有点差别.
评论