org.springframework.amqp.AmqpAuthenticationException:
com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
连接RabbitMQ是报错异常!!
这种错误是属于账号密码错误,回到rabbitMQ中去查看自己的账号密码,是否和配文文件中定义的一致。
java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not presentat java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[na:na]
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[na:na]
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
at java.base/sun.reflect.generics.repository.ClassRepository.computeSuperInterfaces(ClassRepository.java:117) ~[na:na]
at java.base/sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:95) ~[na:na]
at java.base/java.lang.Class.getGenericInterfaces(Class.java:1143) ~[na:na]
at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:629) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:625) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.core.spi.factory.ContextResolverFactory.getParameterizedType(ContextResolverFactory.java:202) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.core.spi.factory.ContextResolverFactory.init(ContextResolverFactory.java:89) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1332) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193) ~[jersey-core-1.19.1.jar:1.19.1]
eureka注册中心 java9.0以上版本需要导入jaxb-api
org.apache.catalina.LifecycleException: Protocol handler start failed
Caused by: java.net.BindException: Address already in use: bind
端口占用了 cmd运行 netstat -ano 找到占用的程序PID 然后任务管理器杀死
git remote add origin https://gitee.com/anrushaonian/fight-for-the-sunset.git
fatal: remote origin already exists.
Git上传失败
生成ssh私钥上传到仓库私钥管理
Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
启动spring爆红信息 不影响启动结果
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'name' in 'class java.lang.String'
category查询
mapper自定义中属性名和传入属性名不同
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'name' in 'class java.lang.String'
mybatis映射文件不对 修改$为#才行
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
sql语句写错了 多了一个)
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
生成JWT令牌时候出错 诡异的错误
忙活一个小时发现 这是因为JDK版本过高导致的 降低JDK版本或者导入 javax/xml/bind这个依赖才能解决
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
进入openresty容器失败
说是容器端口占用但是 netstat -ant | grep 80并没有发现占用
结果没管 第二天睡醒开机以后发现又能进入了 查看nginx.conf文件类配置的端口
ua entry thread aborted: runtime error: /usr/local/openresty/lualib/resty/mysql.lua:236: attempt to perform arithmetic on field 'packet_no' (a nil value)
stack traceback:
coroutine 0:
/usr/local/openresty/lualib/resty/mysql.lua: in function '_send_packet'
/usr/local/openresty/lualib/resty/mysql.lua:781: in function 'close'
/usr/example/ad-update.lua:20: in main chunk, client: 192.168.23.1, server: localhost, request: "GET /ad_update?position=web_index_lb HTTP/1.1", host: "192.168.23.32:8989"
openresty访问报错 似乎是mysql问题
后来自己就好了 不知道怎么解决
Resource interpreted as Stylesheet but transferred with MIME type applicatio
把项目导入到openresty中的nginx下 通过nginx访问出现样式不能成功加载
通过勇哥帮助 最后发现吧html头部的声明删去就能解决
SkuFeign#findSkuListBySpuid(String) timed-out and no fallback available
大量数据导入es时报错
好像是因为Hystrix熔断器的时间设置的原因
真的是熔断器的问题
feign:
hystrix:
enabled: false
设置成false就能解决 因为熔断器超过一秒就中断了 查询大量数据需要好几分钟 所以会一直报错 关掉就行了
2019-06-17 16:26:28.388 ERROR 11768 --- [nio-9009-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.alibaba.fastjson.JSONException: parseLong error, field : spuId] with root cause
com.alibaba.fastjson.JSONException: can not cast to long, value : 10000001516600
json反序列化时候报错 不能解析这个long类型
最开始怀疑10000001516600长度过大 查了资料显示long类型最大为19位的数字
检查了类型 也没有问题
百度说版本问题
查看了版本信息 没有问题
未能解决 自己好了 懵逼
Failed to parse configuration class [com.pinxixi.OrderApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'resourceServerConfig' for bean class [com.pinxixi.user.config.ResourceServerConfig] conflicts with existing, non-compatible bean definition of same name and class [com.pinxixi.order.config.ResourceServerConfig]
启动orderapplication 疯狂报错resourceServerConfig的bean已经存在了 不知道为啥存在了
排查了一遍 是因为之前偷懒没有导入API依赖而是直接导入com.pinxixi.user依赖
应该导入com.pinxixi.user.api依赖
Field cartService in com.pinxixi.order.controller.CartController required a bean of type 'com.pinxixi.order.service.CartService' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.pinxixi.order.service.CartService' in your configuration.
启动orderaplication
没有找到bean
查看serviceimpl中发现cartservice实体类没有添加@Service注解
[root@oracle ~]# docker start mongo
Error response from daemon: driver failed programming external connectivity on endpoint mongo (13b02b17b291e959321d65cd7daa84bffb648a67c434eea3d64a967e844c59d1): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 27016 -j DNAT --to-destination 172.17.0.2:27017 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1))
Error: failed to start containers: mongo
端口映射错误 直接重启
systemctl restart docker
Failed to execute operation: No such file or directory
执行操作失败:没有这样的文件或目录
执行systemctl enable docker 出现这个错误
发现所有的systemctl xxxx docekr 都不能执行 也找不到docker.service服务
因为是解压安装的 所以docker.service没有注册在服务器里? docker可以正常运行
后来没有解决 决定重装 重新拉取的rpm的docker包安装
之前是通过tgz的包安装的
换成rpm来 通过yum localinstall -y docker*.rpm安装出错
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http:/ /mirrorlist. centos. org/ ?release=7&arch=x86
64&repo=os&infra=stock error was
14: curl#6 一"Could not resolve host: mirrorlist. centos.org; 未知的错误"
因为服务器没有外网 yum命令会有问题
后来采用rpm -ivh docke* --force --nodeps 强制安装了
安装成功了以后用 systemctl start docker启动docker结果报错
Job for docker . service failed because the control process exited with error code. See "systemctl status d....
应该是之前的tgz安转的docker没有卸载干净 于是关闭重启
运行了mongo以后 通过docker stats mongo查看mongo的应用内存占用出现
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/0 BLOCK I/0 PIDS mongo
- - -- - - - -- - - - - - --- -
怀疑mongo没有起来
docker ps查看
[ root@locathost ~]# docker ps
CONTAINER IDIMAGE COMMAND CREATED STATUS PORTS NAMES
a265c7930186 mongo:4.4.2 " docker- ent rypoint. 9 minutes ago Up Less than a secon
0.0.0.0:27017->27017/tcp mongo
发现mongo的STATUS状态是Up Less than a second 一直再重启 不明白为什么会重启
查看docker logs mongo
standard init linux.go 178: exec user process caused "permission denied"
standard init linux.go 178: exec user process caused "permission denied"
发现是权限不够
临时关闭权限后再看
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
可以运行了 但是服务器的防火墙是不能关的
最后找到在创建容器的时候给他一个--privileged=true参数
因为挂载到宿主机上以后会对宿主机的挂载目录进行操作 会导致权限不够 所以创建容器的时候就给与一个创建权限就可以了
2021-01-12 18:07:51.490 ERROR 9753 --- [nio-8089-exec-1] com.myclod.file.util.FastDFSClient : FastDFS Client Init Fail!
java.io.FileNotFoundException: class path resource [fdfs_client.conf] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/root/myclod/java/file-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/fdfs_client.conf
在idea中可以运行 打成jar包以后用java -jar 运行出错 提示是说无法获取绝对路径 因为打包以后路径地址变化了
查看源代码
String filePath = new ClassPathResource("conf/fdfs_client.conf").getFile().getAbsolutePath();
ClientGlobal.init(filePath);
改成
Properties properties = new Properties();
ClassPathResource classPathResource = new ClassPathResource("fdfs_client.properties");
InputStream inputStream = classPathResource.getInputStream();
properties.load(inputStream);
ClientGlobal.initByProperties(properties);
用了ClientGlobal另一种方法初始化客户端
15:13:06.679 [restartedMain] ERROR o.s.b.d.LoggingFailureAnalysisReporter - [report,40] -
***************************
APPLICATION FAILED TO START
***************************
Description:
Field sysDictTypeService in com.atm.ccms.busi.service.impl.DataInfServiceImpl required a bean of type 'com.atm.platform.busi.service.ISysDictTypeService' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.atm.platform.busi.service.ISysDictTypeService' in your configuration.
在IDEA中启动就提示找不到bean 但是打成了jar包以后可以正常运行
盲猜应该是导入出了问题 把两个项目放在一起运行就没问题了
14:58:15.822 [http-nio-8090-exec-1] INFO o.a.c.c.C.[.[.[/ccms] - [log,173] - Initializing Spring DispatcherServlet 'dispatcherServlet'
14:58:17.066 [http-nio-8090-exec-1] DEBUG c.a.c.b.m.S.addScoreSheet - [debug,159] - ==> Preparing: insert all into ATM_SCORE_ITEMSFORM (ID,scoring_name, formula, status)values ((ITEAMSFORM.nextval),1,1,1) into ATM_SCORE_CHECK_FORM (itemsid, checkid, seq) VALUES ((ITEAMSFORM.currval+1),1,1) into ATM_SCORE_CHECK_FORM (itemsid, checkid, seq) VALUES ((ITEAMSFORM.currval+1),1,1) into ATM_SCORE_CHECK_FORM (itemsid, checkid, seq) VALUES ((ITEAMSFORM.currval+1),1,1) into ATM_SCORE_CHECK_FORM (itemsid, checkid, seq) VALUES ((ITEAMSFORM.currval+1),1,1) SELECT * FROM DUAL
14:58:17.081 [http-nio-8090-exec-1] DEBUG c.a.c.b.m.S.addScoreSheet - [debug,159] - ==> Parameters:
14:58:17.098 [http-nio-8090-exec-1] ERROR c.a.p.c.w.e.GlobalExceptionHandler - [handleException,83] - null
java.lang.NullPointerException: null
空指针异常 添加了序号 结果报出了空指针异常
盲猜是 mybatis未能获取到ITEAMSFORM.nextval的值 百度未果
想要换成select ITMESCHECKID.nextval from dual试试
直接用命令执行sql语句成功 但是转向mybatis就不行
然后怀疑是mybatis没有进行计算 去掉计算后还是无法成功
又怀疑是insert all的问题呢 改回成insert into 依旧报错
最后思考应该是标签问题 标签从select改回insert 添加useGeneratedKeys属性为false
总结 :在insert all时 标签为select能够成功 但是再加入序列以后标签要改回insert 如果改回insert 报错
应该添加添加useGeneratedKeys属性为false
seGeneratedKeys
取值范围true|false
含义:设置是否使用JDBC的getGenereatedKeys方法获取主键并赋值到keyProperty设置的领域模型属性中。MySQL和SQLServer执行auto-generated key field,因此当数据库设置好自增长主键后,可通过JDBC的getGeneratedKeys方法获取。但像Oralce等不支持auto-generated key field的数据库就不能用这种方法获取主键了.
insert all
into ATM_SCORE_ITEMSFORM (ID,SCORING_NAME,FORMULA,STATUS)values (ITEAMSFORM.currval,#{name},#{formula},1)
into ATM_SCORE_CHECK_FORM (ITEMSID,CHECKID,SEQ) VALUES ((ITEAMSFORM.nextval+1),${value})
SELECT *
FROM DUAL
就可以了
05-Feb-2021 15:48:00.027 警告 [RMI TCP Connection(3)-127.0.0.1] org.springframework.beans.factory.support.DefaultListableBeanFactory.getTypeForFactoryBean Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'anesDiagnosisDictMapper' defined in file [G:\working\anaesthesia2.0\anesSystem\target\anesSystem\WEB-INF\classes\com\atm\dbmodel\mapper\AnesDiagnosisDictMapper.class]: Cannot resolve reference to bean 'sqlSessionFactoryDocare' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactoryDocare' defined in class path resource [spring/spring-atm-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [G:\working\anaesthesia2.0\anesSystem\target\anesSystem\WEB-INF\classes\atmSqlMapperXml\form\AnesNewAnesthesiaCommMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Parsing error was found in mapping #{}. Check syntax #{property|(expression), var1=value1, var2=value2, ...}
15:48:00.046 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.apache.ibatis.io.ResolverUtil - Find JAR URL: file:/G:/working/anaesthesia2.0/anesSystem/target/anesSystem/WEB-INF/classes/com/atm/dbmodel/model/AnesAnesthesiaEventType.class