![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
代码出错总结
小白要变大牛
努力努力再努力,卷不死同行就累不死自己
展开
-
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
在编写的时候遇到了这个问题,原因是在Map中提取值,然后强转为Integer,然后就报了这个错了,原因 Object必须要先转成String类型才能再转成Integer错的方式:Integer page = (Integer) map.get("page");;Integer perPage = (Integer) map.get("page");正确的是先转化为String然后再转化为Integer String pageString = (String) map.get("p..原创 2021-11-29 10:50:04 · 9148 阅读 · 0 评论 -
JVM is using the client VM [Java HotSpot Client VM] but should be using a server VM for the best pe
意思是当前jvm是Java HotSpot Client VM(-client),而应该使用的是Java HotSpot Server VM(-server),前者如其名称,应该适合在客户端使用,后者则适合在服务器环境中使用。所以只需要从Java HotSpot Client VM(-client)切换到Java HotSpot Server VM(-server)就行。找到jre目录,切换到该下cd /usr/local/jdk/jdk1.8.0_05/jre然后修改 ./lib/i386/jv原创 2021-11-23 16:46:20 · 400 阅读 · 0 评论 -
解决:ElasticsearchException[X-Pack is not supported and Machine Learning is not available for
在config/elasticsearch.yml添加一条配置:xpack.ml.enabled: false原创 2021-11-23 16:42:34 · 1839 阅读 · 0 评论 -
unable to load JNA native support library, native methods will be disabled.java.lang.UnsatisfiedLin
运行这个出错,博客看是Elasticsearchelasticsearch中的lib的Elasticsearchjna-x.x.x.jar这个包错了解决:将这个包删除,然后在终端cd进去lib目录然后输入wgethttps://repo1.maven.org/maven2/net/java/dev/jna/jna/x.x.x/jna-x.x.x.jar...原创 2021-11-23 15:45:42 · 2535 阅读 · 0 评论 -
com.netflix.zuul.exception.ZuulException: Forwarding error at org.springfram
网上说是因为设置的时间的问题,解决办法:在zuul网关中加入 ribbon.ReadTimeout=60000 ribbon.SocketTimeout=60000原创 2021-10-21 15:13:29 · 607 阅读 · 0 评论 -
Service引入Mapper出错问题
@Autowired 自动注入,首先要求被自动注入的类必须在spring容器中注册为bean,,也就是该类必须为@Controller、@Service、@Repository、@Component等注解注释,而springboot-mybatis框架中,我们的持久化层为mybatis的Mapper接口层,一般的我们会在接口层上加注@Mapper注解,或者直接在启动类上加注@MapperScan(basePackages/value=…)注解,而@Mapper和@MapperScan并不是spri...原创 2021-10-21 09:59:07 · 2530 阅读 · 0 评论 -
java.lang.IllegalArgumentException: Schema specific part is opaque
原创 2021-10-14 15:19:48 · 356 阅读 · 0 评论 -
Field dxQyweixinWelcomeService in com.infoepoch.controller.DxQyweixinWelcomeController required a be
因为在DxQyweixinWelcomeServiceImpl中没有加@Service,加上一个这个注解就可以运行了原创 2021-09-24 09:04:45 · 144 阅读 · 0 评论