为了账号安全,请及时绑定邮箱和手机立即绑定

在spring中配置sqlsessionfactory,使用了mysql数据库,可以操作数据库输出数据,但是还是会有如下错误,说是找不到oracle驱动,然而我并没有使用oracle数据库,请问这是怎么回事:

log4j:ERROR Failed to load driver

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)


at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)


at org.apache.log4j.jdbc.JDBCAppender.setDriver(JDBCAppender.java:351)

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:206)

at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:165)

at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:130)

at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)

at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)

at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)


at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544)

at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440)

at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)

at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)

at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)

at org.apache.log4j.Logger.getLogger(Logger.java:105)

at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:289)

at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:109)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)


at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1116)

at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:914)

at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)

at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)

at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:310)


at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:270)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)


at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1259)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1998)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)




报错但是项目还能正常运行,其他使用tomcat的项目已经删除

57fe10c90001426c05000070.jpg

57fe10ca0001b91c05000120.jpg


正在回答

0 回答

举报

0/150
提交
取消

在spring中配置sqlsessionfactory,使用了mysql数据库,可以操作数据库输出数据,但是还是会有如下错误,说是找不到oracle驱动,然而我并没有使用oracle数据库,请问这是怎么回事:

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信