无法在模块“ deployment.examplapp.war”中定义类oracle.jdbc.OracleDriver

时间:2019-02-26 19:20:40

标签: java oracle hibernate wildfly

我正在使用Hibernate 5.3.6,Oracle DB 12c和Wildfly 12.0.0服务器开发一个Web应用程序。 我可以从测试主方法中测试休眠连接调用方法,但是当尝试进行疯狂部署时,出现以下异常。 我将ojdbc7 jar保留在 web-inf / lib 文件夹

WARN  [org.jboss.modules.define] (MSC service thread 1-1) Failed to define class oracle.jdbc.driver.OracleDriver in Module "deployment.WebSocketExample.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link oracle/jdbc/driver/OracleDriver (Module "deployment.WebSocketExample.war" from Service Module Loader): java/sql/Driver
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:836)
        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:519)
        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
        at org.jboss.modules.Module.loadModuleClass(Module.java:731)
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:836)
        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:519)
        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
        at org.jboss.modules.Module.loadModuleClass(Module.java:731)
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
        at org.jboss.as.connector.deployers.ds.processors.DriverProcessor.deploy(DriverProcessor.java:63)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:144)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1714)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1693)
        at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1540)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
        at java.lang.Thread.run(Thread.java:745)

0 个答案:

没有答案