ERROR Failed to load driver
程序员文章站
2022-03-19 22:09:56
...
log4j:ERROR Failed to load driver
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.log4j.jdbc.JDBCAppender.setDriver(JDBCAppender.java:391)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:245)
at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:204)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:169)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
at org.apache.log4j.Logger.getLogger(Logger.java:117)
at top.simba1949.AppTest.<clinit>(AppTest.java:11)
解决方案:
将log4j.properties 中每行后面的空格都删除就解决了.
推荐阅读
-
Linux部署Java-Web,mvn package出现COMPILATION ERROR :Failed to execute goal org.apache.maven.plugins:mave
-
编译安装PHP出现configure: error: mysql configure failed. Plea_PHP教程
-
丢失Android系统库或者Conversion to Dalvik format failed with error 1错误的解决方法
-
丢失Android系统库或者Conversion to Dalvik format failed with error 1错误的解决方法
-
SpringBoot启动报错Failed to determine a suitable driver class
-
mysql出现Error performing load command的解决方法
-
Android添加glide库报错Error: Failed to resolve: com.android.support:support-annotations:26.0.2的解决
-
cannot be run because the QueueReader subsystem failed to load
-
解决Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-f8IeEI/MYSQL-python/
-
Fatal error: session_start(): Failed to initialize storage module: files问题解决方法