SpringBoot部署到WAS上的问题小结
来源:互联网 发布:算法精解:c语言描述pdf 编辑:程序博客网 时间:2024/05/17 06:43
省略桃花。。。仅做记录
采用WAS版本为8.5.5.9,PS:此版本以下版本不能良好的支持Servlet3.0的注解功能,而SpringBoot完全取消了web.xml的配置,采用注解方式。
采用JDK1.6,PS:从1.8降到1.7再到1.6,前后花费长时间发现1.6版本比较稳定,WAS的支持比较好。
在开发过程中遇到的问题如下:
1)采用jdk1.8时,由于服务器版本WAS8.0.0.9的JDK版本为1.6,出现部署后404的问题“WebSphere Application Server:Error 404: java.io.FileNotFoundException: SRVE0190E: File not found:”,起初以为是WAS不能支持注解形式的Servlet调起Spring,在网上查询解决方案得到:去掉SpringBootServletInitializer接口实现,重新加入web.xml方式。出现JDK版本问题,遂降低至jdk1.6,期间出现spring-boot-starter-tomcat版本由8降至7.0.59,此种方式可行;
2)但是采用web.xml方式完全背离了SpringBoot的本意,故重新找到一台WAS8.5.5.9的机器进行SpringBootServletInitializer方式启动,出现 com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource org/apache/ibatis/javassist/SerializedProxy.class in archive WEB-INF/lib/mybatis-3.4.0.jar 的问题,查询解决方案:https://github.com/mybatis/mybatis-3/issues/706#issuecomment-227731860 获知:mybatis3.4.0下的此类与SpringBoot不兼容,改为 3.4.1即可解决
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>${mybatis.spring.version}</version> <exclusions> <exclusion> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.4.1</version> </dependency>
Mybatis版本兼容问题原因:mybatis-spring-boot-starter为高人贡献,其中有个类涉及到注入方式为构造器方式注入,在Spring中采用@Autowired方式注入时,会得到多个注入类,导致错误,没有明白为何会采用构造器方式注入。springBoot提供了此种问题的解决方式:Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed。即采用@Primary注解在多个构造时选取特定的一个。而某高人修改了此类的构造器注入方式为注解注入,也解决了这个问题。
- SpringBoot部署到WAS上的问题小结
- Linux下was上部署项目遇到的问题
- 开发部署到was服务器上
- 关于SpringBoot部署上的一些坑
- SpringBoot进行部署到云的Tomcat
- WAS上日志的问题
- # 在Linux下的was服务器上部署web应用遇到问题
- springboot部署到centos6
- springboot项目打成war包部署到tomcat遇到的一些问题
- 应用SpringBoot遇到的问题小结
- 关于springboot项目的部署问题
- Springboot整合swagger2项目的部署问题
- 将项目部署到Weblogic8.1上存在的问题
- flex tomcat部署到服务器上出现的问题
- 把eclipse项目部署到tomcat插件上的问题
- Maven多模块部署到Nexus上的问题
- Django 部署到Apache上CSS消失的问题
- 部署应用到websphere上发现的问题
- 动量投资(Momentum Investing)
- Html静态页面传值(中文传值不乱码)
- bzoj 3238 [Ahoi2013]差异(SAM解法)
- Java集合---HashMap源码剖析
- JDBC的使用方式
- SpringBoot部署到WAS上的问题小结
- 炒股半年亏了一辆车,以后每天好好复盘做功课吧!
- git 与远程仓库的协作(二)
- Linux常用命令——压缩与解压
- MongoDB 3.4 高可用集群搭建(二)replica set 副本集
- 定制适用于ARM平台的Ubuntu rootfs(根文件系统)
- python实现常见算法
- rabbitMQ的交换机类型
- caffe