Cannot instantiate com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory, even on second attempt.
Cannot instantiate com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory, even on second attempt.
java.lang.ClassNotFoundException: com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory
?? ?at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
?? ?at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
?? ?at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
?? ?at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
?? ?at com.p6spy.engine.spy.option.P6OptionsRepository.parse(P6OptionsRepository.java:114)
?? ?at com.p6spy.engine.spy.option.P6OptionsRepository.setSet(P6OptionsRepository.java:169)
?? ?at com.p6spy.engine.spy.P6SpyOptions.setModulelist(P6SpyOptions.java:386)
?? ?at com.p6spy.engine.spy.P6SpyOptions.load(P6SpyOptions.java:101)
?? ?at com.p6spy.engine.spy.P6ModuleManager.loadOptions(P6ModuleManager.java:181)
?? ?at com.p6spy.engine.spy.P6ModuleManager.registerModule(P6ModuleManager.java:153)
?? ?at com.p6spy.engine.spy.P6ModuleManager.<init>(P6ModuleManager.java:118)
?? ?at com.p6spy.engine.spy.P6ModuleManager.initMe(P6ModuleManager.java:65)
?? ?at com.p6spy.engine.spy.P6ModuleManager.<clinit>(P6ModuleManager.java:58)
?? ?at com.p6spy.engine.spy.P6SpyDriver.findPassthru(P6SpyDriver.java:117)
WARNException encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [D:\javaCode\high\target\classes\com\mp\dao\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.ExceptionInInitializerError
?? ?at com.p6spy.engine.spy.P6SpyDriver.connect(P6SpyDriver.java:87)
2020-04-11
同學,你使用的是3.1.2,你看你截的第一幅圖,“modulelist=”這行,你用的是3.2.1以上使用的那個,你應該把這行注釋掉,用那個3.2.1以下使用的那個,把那個被注釋的取消注釋。
2020-04-10
同學,你的MP使用的是什么版本?有可能是低版本的MP沒有相關的包引起的,你換一個高版本的試試。