1. Unsupported major.minor version 52.0 (unable to load class org.springframework.web.SpringServletContainerInitializer)
解决: 根据错误信息Unsupported major.minor version 52.0查到说是jdk版本集成tomcat版本太高,需要改低一些,于是检查了我的jdk,
我jdk用的1.7的,Tomcat用的8.0的,没有问题。忙了半天也不知道改哪里,突然就想到是不是我集成的jar包版本的问题呢?
因为我在配置的时候所有的jar包都选择的最新版本的
*修改了spring的三个jar包,将5.0.1改成了4.3.12还将Publish module contexts to separate XML files打勾的去掉了,启动tomcat成功
2. SEVERE: Error configuring application listener of class org.springframework.web.util.IntrospectorCleanupListener
解决: 这个错误就是找不到Spring Web Context包文件,你可能会说明有包呀,怎么就找不到呢?在我们添加spring模块支持的时候,
都会下载Spring的包,但就是找不到的。原因可能是没有把包放到调试输出的支持库里,一般是项目目录下的lib文件夹。
可以查看项目目录结构中target目录,这个目录就是调试输出的目录,如果这个目录里面没有spring的包就会找不到org.springframework.web.context包,
解决办法:进入projectsettings-Artifacts在右边中部的Available Elements中的包双击添加到Output root指定的目录(一般为lib目录)里。
3.URI标识未注册
发现URI 资源未注册,点击红灯泡 第一行 添加外部资源即可
4.Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0',
nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSession
解决:确信在pom文件中添加了mybatis的引用,最后去本地maven库和项目依赖包中查找看,并没有该jar的引用。原因是intellij idea并没有下载该jar包,重新导入引用即可解决。
5. java.lang.ClassNotFoundException: org.springframework.dao.support.DaoSupport
mybatis-spring版本高,换成1.1.1版本
7.Could not resolve resource location pattern [classpath:taotao/mapping/*.xml]: class path resource [taotao/mapping/] cannot be resolved to URL because it does not exist
解决: out目录下没有mapper.xml因为idea 使用maven进行打包发布时,由于maven无法对xml文件进行编译打包,须在pom.xml文件中添加如下配置
<build>
<!--解决Intellij构建项目时,target/classes目录下不存在mapper.xml文件-->
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
1.out存放的是该项目下所有Module(模块)的编译结果。
2.target存放的是单个Module的编译结果。
3. 如果为某个Module指定了编译结果的路径,则不会再输出到out文件夹中了。
你在Project Structure中的Project选项卡中可以设置Project compiler output的目录。
在Modules中选择某一个模块后,在右侧的Paths选项卡中可以设置该模块的Compiler output目录。
8. maven install的时候spring.xml 打包不进target, 单独执行junit test ,检查xml是否生成,生成之后再打包。