这几天遇到的问题

今天碰到一个问题:在插入数据时需要把id传回来
解决办法:在实体类中在对应的字段上面加个注解:@GeneratedValue(strategy = GenerationType.IDENTITY),然后用get方法取到id

解决了

把相同参数不同名字的类的参数拷贝过去
BeanUtils.copyProperties(bankCard, bankCardInfo);

今天碰到一个问题:cannot be resolved to URL because it does not exist
问题描述:更新了一下代码,然后就无法开启项目,一直报找不到URL
解决办法:在maven里面clean,然后再compile重新编译一下.
因为有人更改了配置,所以需要重新编译

问题:org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/C:/Users/DELL/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.5.8.RELEASE/spring-boot-autoconfigure-1.5.8.RELEASE.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)

解决办法:是因为application.java 文件不能直接放在main/java文件夹下,必须要建一个包把他放进去

posted @ 2018-04-25 21:09  海冠军  阅读(341)  评论(0编辑  收藏  举报