Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用java 11编译的EAR部署错误_Java_Wildfly_Ear_Java 11 - Fatal编程技术网

使用java 11编译的EAR部署错误

使用java 11编译的EAR部署错误,java,wildfly,ear,java-11,Java,Wildfly,Ear,Java 11,使用Java11编译EAR应用程序。 部署到Wildfly 14时,返回以下错误: Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ef' defined in class path resource [application-context.xml]: Cannot resolve reference to

使用Java11编译EAR应用程序。 部署到Wildfly 14时,返回以下错误:

Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ef' defined in class path resource [application-context.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [application-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]

...

Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]
    at deployment.test-1.0.ear//org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:121)
使用Java 8编译的同一应用程序部署起来没有问题(实际上它是从Java 8应用程序开始的)。因此,这似乎不是驱动程序本身的问题

这是Wildfly路径modules/system/layers/base/com/oracle/main中的module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.5" name="com.oracle">
  <resources>
    <resource-root path="ojdbc6.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
  </dependencies>
</module>


更改EAR应用程序的最佳方法是什么,以便在使用java 11编译时能够正确存储?

ojdbc6
驱动程序不支持java 11。根据,只有数据库18.3中的
ojdbc8
驱动程序完全支持Java11


升级驱动程序(可能还有数据库)或继续使用Java 8。

Java中没有版本14。请确定Java的版本可能是Java 1.4??您正在使用的
ojdbc
JAR的版本是什么?标题中有一个键入错误,刚刚更正为Java 11。添加了更多信息,我已经升级/部署了驱动程序(及其在module.xml中的引用)。然而,得到同样的错误。我看到(在错误之前)一些警告:“类路径条目commons-logging-1.2.jar没有为类路径引用指向有效的jar。”可能是因为java 9和模块的EAR结构不好吗?没有线索。您的依赖项不支持Java11。找到一个支持它的更新版本,或者用支持它的替代库替换依赖项。感谢您的帮助,我将在几天内测试并标记问题的答案