手欠升级后的各种异常处理

几天前手欠,忍不住升级了Mac系统到10.13,结果原来正常的项目启动各种报错,期间本着破罐破摔的原则顺手把Itellij Idea升级到2017.3,又把JRebel插件升级到了7.1.3,结果弄了4、5天才从坑里爬出来:

quartz方法不匹配的异常

原来正常的项目,报异常无法启动了,异常信息没记录,大意是调用com.quartz.scheduler.getTrigger方法时参数个数不匹配,因为代码完全没动过,判断肯定是包不兼容了,果然把quartz和quartz-all两个jar包都更新之后异常消失了,我找到的最新版本分别是:quartz-2.2.3.jar和quartz-all-2.1.5.jar。

Server is not connected. Deploy is not available.

接下来的错误更狠,直接报上面的信息,Tomcat都启动不了了,看了网上的说法

  • 去掉catalina.sh中的JAVA_OPTS设置,没好用
  • 去掉tomcat/bin下的setenv.*文件,我的环境里没有这个文件
  • 安装了Tomat8.5版本,好了

后续:
- 重新启动了整个系统之后,改回到Tomcat7,也不报错了,原因未知
- 取消了JAVA_OPTS之后,启动时报PermGen space,在Idea的Tomcat设置中修改:在Edit Run/Debug Configurations的Server-VM Options中增加虚拟机缓存代码:
-server -XX:PermSize=512M -XX:MaxPermSize=512m

Activiti spring循环注入异常

再次启动项目,报异常

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daizheCL': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.activiti.engine.TaskService com.sdr.daizhe.controller.DaizheCL.taskService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine' defined in URL [file:/Users/venice/Project/canteen/src/dr/out/artifacts/dr_war_exploded/WEB-INF/classes/spring/activiti-context.xml]: Cannot resolve reference to bean 'processEngineConfiguration' while setting bean property 'processEngineConfiguration'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineConfiguration' defined in URL [file:/Users/venice/Project/canteen/src/dr/out/artifacts/dr_war_exploded/WEB-INF/classes/spring/activiti-context.xml]: Cannot resolve reference to bean 'activityBehaviorFactory' while setting bean property 'activityBehaviorFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activityBehaviorFactory': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.activiti.engine.TaskService com.sdr.activiti.ProcessActivityBehaviorFactory.taskService; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'taskService': Requested bean is currently in creation: Is there an unresolvable circular reference?

主要是最后这句Is there an unresolvable circular reference
系统框架用的是spring批注方式,因此修改spring配置文件,把activiti框架需要的bean的扫描放在activiti配置文件前面,其他的bean扫描放后面,类似这样:

<context:component-scan base-package="com.jy.service"/>
<context:component-scan base-package="com.sdr.activiti"/>

"spring-datasource.xml"/>
"activiti-context.xml"/>

<context:component-scan base-package="com.sdr"/>
<context:component-scan base-package="com.jy"/>
<context:component-scan base-package="cn.daizhe"/>

JRebel启动报错

再次启动又报错了

2017-12-11 11:01:28 -13625 [RMI TCP Connection(2)-127.0.0.1] ERROR – Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/private/var/folders/zz/tdnd4gps5td9cg64nzcr30wm0000gn/T/jrebel6-temp/jrebel.jar!/com/zeroturnaround/javarebel/gwa.class]; nested exception is java.lang.IllegalStateException: Expecting .,<, or ;, but found / while unpacking Object;>Lcom/zeroturnaround/javarebel/gvp.com/zeroturnaround/javarebel/gwk;
……

这个肯定是升级JRebel的问题,在解决前面问题的时候一度放弃,把环境转移到win7虚拟机里面,也是同样的版本号,项目代码是直接粘贴过去的,在启动时也报了jrebel6的错误,可惜当时没记录过程,只是顺着错误信息的线索找到了jrebel6目录,直接删掉就好了。
但是win下的Idea看起来太难看了,尤其字体实在受不了,只好又回到Mac,解决了上面的各种问题后,遇到上面的保存感觉应该还是JReble的版本配置问题,果然最后在Idea的Peferences-jrebel-advenced中找到了“use jrebel.jar from the path specified”,选中之后把路径改为‘/Users/*/Library/Application Support/IntelliJIdea2017.3/jr-ide-idea/lib/jrebel/jrebel.jar’而不是‘……/jrebel6/jrebel.jar’就好了。

最后,以后一定要控制控制再控制,千万别轻易升级了……

你可能感兴趣的:(开发环境)