springboot备忘

1.springboot中有ApplicationRunner类,如果项目中的启动类名称也是ApplicationRunner,单元测试时需要注意:import不要import到springboot的类了

@RunWith(SpringJUnit4ClassRunner.class)

@SpringBootTest(classes = ApplicationRunner.class)

import org.springframework.boot.ApplicationRunner;

2.Could not open windows registry node SoftwareJavaSoftPrefs at root 0x80000002 

=>regedit:HKEY_LOCAL_MACHINE->SOFTWARE->JavaSoft->Prefs

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration.errorPath;
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Cannot access specified node path [error.path:];
Caused by: java.util.prefs.BackingStoreException: Could not open windowsregistry node SoftwareJavaSoftPrefs at root 0x80000002.

参考:https://blog.csdn.net/u011393781/article/details/79930334

原文地址:https://www.cnblogs.com/cdfive2018/p/9516196.html