Maven-No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
eclipse默认是运行在jre上的,但是maven插件需要使用jdk。
【Window】-->【Prefrences】-->【Java】-->【Installed JREs】

Missing artifact net.sf.json-lib:json-lib:jar:2.4:compile
原因:json-lib是需要区分jdk版本的,pom.xml中的配置应加上标签classifier指定jdk版本,如用jdk15
修改为:
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier><!--指定jdk版本-->
</dependency>
cmd 执行指令 “mysql -uroot -p” 时提示:“ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)”
Windows服务管理启动MySQL服务时提示:“本地计算机 上的 MySQL 服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止。
--先删除MySQL服务,重新安装后再启动
mysqld --remove
mysqld --install
net start mysql
--在mysql安装目录/bin 下打开命令行,执行初始化 mysqld --initialize,然后启动mysql。
执行 mysqld --initialize时:
D:\Program Files\mysql-5.7.20-winx64\bin>mysqld --initialize
2018-01-16T01:19:15.924342Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-01-16T01:19:15.926335Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2018-01-16T01:19:15.927338Z 0 [ERROR] Aborting
spring boot事物未回滚:
mysql的表需要时innodb才能支持事务;
mysql设置为取消自动提交。
spring boot启动失败:Cannot determine embedded database driver class for database type NONE
resources文件夹设置为resource源:在resources上右键,mark directory as --> Resources Root
bean未注册:org.springframework.beans.factory.NoSuchBeanDefinitionException
ScheduleJobLogBiz scheduleJobLogBiz = (ScheduleJobLogBiz) SpringContextUtils.getBean("scheduleJobLogBiz"); --bean名称小写
this.target = SpringContextUtils.getBean(beanName);
@Component("com.github.wxiaoqi.security.admin.task.BaseManagerTask") --Compontent中的注解需要写全路径
No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) )
这是因为你需要序列化对象有一个属性是一类类型,而你使用了Hibernate的延迟加载所以这里是个Hibernate的代理对象。该代理对象有些属性不能被序列化所以会报错。
java.lang.CloneNotSupportedException:
Arrays.asList() 返回java.util.Arrays$ArrayList, 而不是ArrayList。Arrays$ArrayList和ArrayList都是继承AbstractList,remove,add等 method在AbstractList中是默认throw UnsupportedOperationException而且不作任何操作。ArrayList override这些method来对list进行操作,但是Arrays$ArrayList没有override remove(int),add(int)等,所以throw UnsupportedOperationException。
Error occured while trying to proxy to: localhost:
node -sass 不兼容 node v8的版本
解决方法:
在当前项目下执行npm i node -sass -D
java.io.FileNotFoundException: class path resource [my_saturation.xlsx] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/data/jars/opm-worklog.jar!/BOOT-INF/classes!/my_saturation.xlsx
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:215)
ResouceUtils.getFile()是专门用来加载非压缩和Jar包文件类型的资源,所以它根本不会
去尝试加载Jar中的文件,要想加载Jar中的文件,只要用可以读取jar中文件的方式加载即可,比如 xx.class.getClassLoader().getResouceAsStream()这种以流的形式读取文件的方式.
java.lang.IllegalStateException: RequestParam.value() was empty on parameter 0
使用FeignClient时,get方法的@RequestParam必须填写value
@RequestParam("logId") long logId
MissingPathVariableException: Missing URI template variable
接口参数名不一致导致
@RequestMapping(value = "/list/{contractId}",method = RequestMethod.GET)
@ResponseBody
public ObjectRestResponse getChangeList(@PathVariable long contractId)
eclipse默认是运行在jre上的,但是maven插件需要使用jdk。
【Window】-->【Prefrences】-->【Java】-->【Installed JREs】

Missing artifact net.sf.json-lib:json-lib:jar:2.4:compile
原因:json-lib是需要区分jdk版本的,pom.xml中的配置应加上标签classifier指定jdk版本,如用jdk15
修改为:
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier><!--指定jdk版本-->
</dependency>
cmd 执行指令 “mysql -uroot -p” 时提示:“ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)”
Windows服务管理启动MySQL服务时提示:“本地计算机 上的 MySQL 服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止。
--先删除MySQL服务,重新安装后再启动
mysqld --remove
mysqld --install
net start mysql
--在mysql安装目录/bin 下打开命令行,执行初始化 mysqld --initialize,然后启动mysql。
执行 mysqld --initialize时:
D:\Program Files\mysql-5.7.20-winx64\bin>mysqld --initialize
2018-01-16T01:19:15.924342Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-01-16T01:19:15.926335Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2018-01-16T01:19:15.927338Z 0 [ERROR] Aborting
--删除data文件夹后重新执行,注:会删除数据库文件
MSYQL启动时,报错“系统找不到指定的路径的”——被360隔离了,到恢复区恢复即可
mysqld -remove
mysqld -install
spring boot事物未回滚:
mysql的表需要时innodb才能支持事务;
mysql设置为取消自动提交。
spring boot启动失败:Cannot determine embedded database driver class for database type NONE
resources文件夹设置为resource源:在resources上右键,mark directory as --> Resources Root
bean未注册:org.springframework.beans.factory.NoSuchBeanDefinitionException
ScheduleJobLogBiz scheduleJobLogBiz = (ScheduleJobLogBiz) SpringContextUtils.getBean("scheduleJobLogBiz"); --bean名称小写
this.target = SpringContextUtils.getBean(beanName);
@Component("com.github.wxiaoqi.security.admin.task.BaseManagerTask") --Compontent中的注解需要写全路径
No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) )
这是因为你需要序列化对象有一个属性是一类类型,而你使用了Hibernate的延迟加载所以这里是个Hibernate的代理对象。该代理对象有些属性不能被序列化所以会报错。
java.lang.CloneNotSupportedException:
Arrays.asList() 返回java.util.Arrays$ArrayList, 而不是ArrayList。Arrays$ArrayList和ArrayList都是继承AbstractList,remove,add等 method在AbstractList中是默认throw UnsupportedOperationException而且不作任何操作。ArrayList override这些method来对list进行操作,但是Arrays$ArrayList没有override remove(int),add(int)等,所以throw UnsupportedOperationException。
Error occured while trying to proxy to: localhost:
node -sass 不兼容 node v8的版本
解决方法:
在当前项目下执行npm i node -sass -D
java.io.FileNotFoundException: class path resource [my_saturation.xlsx] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/data/jars/opm-worklog.jar!/BOOT-INF/classes!/my_saturation.xlsx
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:215)
ResouceUtils.getFile()是专门用来加载非压缩和Jar包文件类型的资源,所以它根本不会
去尝试加载Jar中的文件,要想加载Jar中的文件,只要用可以读取jar中文件的方式加载即可,比如 xx.class.getClassLoader().getResouceAsStream()这种以流的形式读取文件的方式.
例:(临时文件存放在resource目录下)
String tempFileName = "test.xml"; tempIS = this.getClass().getClassLoader().getResourceAsStream(tempFileName); File destFile = new File(destPath); destFile.createNewFile(); // 模板文件拷贝到目标文件 os = new FileOutputStream(destFile); IOUtils.copy(tempIS, os);
java.lang.IllegalStateException: RequestParam.value() was empty on parameter 0
使用FeignClient时,get方法的@RequestParam必须填写value
@RequestParam("logId") long logId
MissingPathVariableException: Missing URI template variable
接口参数名不一致导致
@RequestMapping(value = "/list/{contractId}",method = RequestMethod.GET)
@ResponseBody
public ObjectRestResponse getChangeList(@PathVariable long contractId)