具备Java编译11 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路径模块/系统/层/基层/ COM / ORACLE /主要的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>
什么时候是用java 11将depoy正确编译改变EAR应用,因此最好的办法?
ojdbc6
驱动程序不支持Java的11只ojdbc8
与数据库18.3完全支持Java 11,按照What are the Oracle JDBC releases versus JDK versions驱动程序。
无论是升级的驱动程序(和潜在的数据库),或继续使用的Java 8。