异常
1、IDEA Error:java: Compilation failed: internal java compiler error
File-->Setting...-->Build,Execution,Deployment-->Compiler-->Java Compiler 设置相应Module的target bytecode version的合适版本(跟你jkd版本一致),把版本改成你所需的
2、找不到jdbc驱动
添加依赖
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.28</version>
<scope>runtime</scope>
</dependency>
3、项目模块本来是放在一个目录下分成了api和ds 两个模块
重新依赖 Reimport All maven projects(大圈)
4、mybatis的mapper autowired 会出现红线 Could not autowire. No beans of 'ShipSubscribeParamMapper' type foun
降低Autowired检测的级别,将Severity的级别由之前的error改成warning
File->Settings->Editor->Inspections->Spring->Spring Core->Code->Autowiring for Bean Class ->Severity->修改成Warning
5、找不到com.alibaba:dubbo:2.8.4 依赖
没有使用含有这个jar包的maven镜像,在每次换了个工程后idea的配置会重置 需要在settings更换maven的配置文件的路径,和encoding的编码方式
6、nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionEx
可能是在dubbo中没有进行配置 导致获取不到对应的bean
添加dubboConsumer.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.1.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<!-- consumer application name 缺少的话会报异常-->
<dubbo:application name="ms" />
<dubbo:registry address="${dubbo.address}" timeout="20000" file="${catalina.home}/.dubbo/ms.cache"/>
<dubbo:consumer check="false"/>
<!--order-->
<dubbo:reference id="importDirectService" interface="com.cargopm.order.service.ImportDirectService" reggroup="${order.ds.reggroup}"/>
</beans>
7、使用BeanUtils 报错 cannot invoke CustomsClearanceConditonDto.setPageSize on bean class 'class dto.CustomsClearanceConditonDto' - null - had objects of type "<null>" but expected signature "int"
null 不能放到 int类型中,使用包装类型Integer
8、org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file xxx nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [nested exception is java.lang.IllegalArgumentException
spring 3.2 只能支持到1.7 通过project structure 把这个module的jdk版本改成1.7
9、project structure中lanuage level自动变成1.5
在父模块中添加properties
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
10、Class.forName("xx")找不到类,创建失败报出异常
需要指明类路径 com.xxx.xxx.xx【带上包路径】
11、Could not copy webapp sources
webapp中的文件被占用 重启
maven
1、 IDEA Error:java: Compilation failed: internal java compiler error
Settings-->Build,Execution,Deployment-->Compiler-->Java Compiler 选择合适的版本
2、Error:(7,28) java: 找不到符号
文件内没有报错,但是maven clean install的时候失败
从他的子依赖组件开始clean install 即这段代码内部的组件开始clean install
tyr/catch
1、在内部处理掉的话,外面无法抓取特定的异常,如果在外面有需要对异常进行的特殊处理,需抛出
例如外部需要内部抛出401,但内部抓取了所以外面的结果是200但是因为凭证过期而无数据