发表于: 2017-08-11 23:25:09
1 1190
今天学到了什么:
经过一系列的增删扒抄成功配置好了一个基于RMI前后端分离的HelloWorld,
但是忘记截图了,就不放图片了,
参考链接 https://juejin.im/post/58720e8c1b69e6005ca6e306
还有一个中文版的Rmi手册 http://www.10tiao.com/html/501/201705/2686978388/1.html
然后在其基础上进行更改,改成可以查询数据库
最结果是这样的:
左边是Server右边是Client
再后来想通过前端页面进行查找操作,但是遇到了困难
遇到的困难:
这是一个demo所以类比较少,左边是前台,右边是后台
然后后端正常启动前端各种报错,先是tomcat端口冲突,改了端口还是冲突,直接使用tomcat结果报错
创建beans失败
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'categoryServiceImpl': Unsatisfied dependency expressed through field 'categoryMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.how2java.mapper.CategoryMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiProxyFactoryBean#0' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect
目前尚未解决
收获:
大概理解SpringRMI的工作过程
明天的计划:
解决bug,把增删查改加上
评论