我正在尝试从 Spring 3 (Java 1.8.X) 迁移到 Spring 6 (openJDK 19) 应用程序。当我尝试在服务器上运行应用程序时,我收到此警告:
ResourceEntityResolver - DTD/XSD XML entity [https://www.springframework.org/schema/tx/spring-tx.xsd] not found, falling back to remote https resolution
这在我们开发 Spring 3 版本时从未发生过。我读了几篇关于这个的帖子,都指出我必须检查包spring-tx
是否确实在项目中并加载模式文件。
这是我的弹簧配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="..."
xmlns:xsi="..."
xmlns:p="..."
xmlns:aop="..."
xmlns:tx="http://www.spring framework.org/schema/tx"
xmlns:context="..."
xsi:schemaLocation="http://www.spring framework.org/schema/tx https://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="sessionFactory">...</bean>
<bean name="transactionManager"
class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="dataSource"/>...</bean>
<context:annotation-config />
<tx:annotation-driven transaction-manager="transactionManager" />
<context:component-scan base-package="foo.bar.dao" />
<context:component-scan base-package="foo.bar.services" />
</bean>
我尝试检查和更改项目的 spring-tx.xsd 文件的版本。我仍然不知道我应该尝试什么。
我不得不省略大部分引用 xml 位置的行,因为它将他的问题标记为垃圾邮件。
结果发现项目中虽然加载了依赖,但并没有部署到Eclipse的Tomcat服务器中。我不得不从服务器上删除该项目,清理 tomcat 工作区,然后再次发布它。