发表于: 2016-12-26 23:25:58

2 1945


一.今天完成的事情

1.看师兄的任务八日志:http://www.jnshu.com/#/daily/7829?uid=3933  做个maven聚合。

一步步的跟着做。。。

3.      SpringMVC + Mybatis +RMI

(1)     首先新建聚合的maven工程。

Packagingpom

(2)     新建 coreservice controller 子项目

新建时Maven Module

然后Parent Project 选择SpringRMI-Test

(3)     建完过后的工程目录

(4)     我自己写的demo

Springrmi-studentpom文不需要引jar

(5)     首先写coremodel service

                                       

                                  Student.class得继承Serializable:

                

                                   StudentService接口:

                               

(6)     然后写service

因为coreservice不再是同一个工程,所以servicepom文件得引入core

studentDao, StudentServiceImpl, jdbc.properties, log4j.properties spring-mybatis的配置和之前的spring-mybatis一样,不再赘述。

不同是的spring配置文件里得加入server的配置。

然后在StartServer里启动server

(7)     最后controller

         按照springmvc的流程走就行了。

         先配置web.xml

再配置springrmi-client.xml

Controllerspringmvc-mybatis的写法一毛一样。

2.遇到的问题:

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

java.lang.NoClassDefFoundError: Lcom/wangsx/service/StudentService;

调试了整整一天,还没有搞定啊。。。 我想目中压根就没有Lcom/wangsx/ser... 这个目录   搞不明白啊??


Caused by: java.lang.ClassNotFoundException: com.wangsx.service.StudentService

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)

... 27 more


明天:明天慢慢研究吧,2点啦。哈哈。。。  我调通了一个师兄的代码,明天好好研究下。包括代码规范等等。。。。。。。。。。。。。。。。。。。。。。。。。。。。


返回列表 返回列表
评论

    分享到