没有实现 [org.springframework.beans.factory.xml.NamespaceHandler] 接口

Posted

技术标签:

【中文标题】没有实现 [org.springframework.beans.factory.xml.NamespaceHandler] 接口【英文标题】:does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface 【发布时间】:2019-10-07 16:46:03 【问题描述】:

我收到以下错误:- Caused by: org.springframework.beans.FatalBeanException: Class [org.springframework.transaction.config.TxNamespaceHandler] for namespace [http://www.springframework.org/schema/tx] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:128) ~[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE] 我检查了 lib 文件夹,它是 spring-beans-3.2、spring-tx 和 spring-context-3.2 jar 文件。我使用了以下命名空间:- http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.2.xsd.

Classpath 有所需的 jars 文件。

请帮助解决错误。

Windows 7

【问题讨论】:

让我猜猜部署到像 WebLogic 这样的应用服务器? 我不确定您的 spring-context 依赖项是否不匹配。如果可能,请在您的问题中添加 pom.xml 或添加完整的堆栈跟踪 @M.Deinum 是的,它发生在 weblogic 12cR2 上,任何帮助将不胜感激。 【参考方案1】:

试试这个xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/tx https://www.springframework.org/schema/tx/spring-tx.xsd。如果您得到相同的结果,请从上下文和 bean 中删除版本 -3.2

【讨论】:

更改 xsd 声明无助于解决这个问题。

以上是关于没有实现 [org.springframework.beans.factory.xml.NamespaceHandler] 接口的主要内容,如果未能解决你的问题,请参考以下文章

org.springframework.security:org.springframework.security.web:jar:3.0.5.RELEASE 的 POM 丢失,没有可用的依赖信息

如何使用 org.springframework.jdbc.object 实现可重用的 ddl 语句?

引起:org.springframework.dao.IncorrectResultSizeDataAccessException:查询没有返回唯一结果:3

org.springframework.beans.factory.NoSuchBeanDefinitionException:没有定义名为“transactionManager”的bean

原因:没有为 org.springframework.security.authentication.UsernamePasswordAuthenticationToken 找到 Authentica

没有可用的“org.springframework.jdbc.core.JdbcTemplate”类型的合格bean