我正在将应用程序从Tomcat8迁移到WildFly 14,但过程中出现的错误很少,并且部署因这些错误而失败。
java.lang.RuntimeException:org.springframework.beans.factory.BeanCreationException
**Could not autowire field: private javax.sql.DataSource
.config.AppConfigurationServiceConfig: Invocation of init method failed
nested exception is javax.naming.NameNotFoundException: env/jdbc/datasource
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: javax.naming.NameNotFoundException: env/jdbc/dataSource**
我已经创建了以下jboss-web.xml文件:
<context-root>/</context-root>
</jboss-web>
另外,我已经按照以下步骤操作:
下载了驱动程序:ojdbc7.jar 创建的子文件夹[WILDFLY_HOME] / modules / system / layers / base / com / oracle / main /
将下载的ojdbc7.jar复制到新创建的文件夹中 在与上述相同的文件夹中创建了一个文件module.xml。
在配置文件standalone.xml中添加了以下条目:
<driver name="oracle" module="com.oracle">
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
</driver>
,并在Standalone.xml中配置了数据源。 我通过直接将war文件放置在部署文件夹中进行部署。
要获得上述错误,可能还缺少其他哪些配置或代码更改?