gpt4 book ai didi

spring - cvc-complex-type.2.4.c : The matching wildcard is strict, 但找不到元素 'tx:annotation-driven' 的声明

转载 作者:行者123 更新时间:2023-12-03 11:29:21 25 4
gpt4 key购买 nike

如果我不粘贴 xmlns:tx="http://www.springframework.org/schema/tx" 则没有问题。但是,如果我确实插入了文本,我会得到一个 cvc-complex-type.2.4.c:匹配的通配符是严格的,但找不到元素 'tx:annotation-driven' 错误的声明。

<beans xmlns:tx="http://www.springframework.org/schema/tx" xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">

<context:annotation-config />
<tx:annotation-driven />
<context:component-scan base-package="ne.projl.server" />

<bean name="security.securityInfo" class="org.geomajas.security.SecurityInfo">
<property name="loopAllServices" value="false" />
<property name="securityServices">
<list>
<bean class="org.geomajas.security.allowall.AllowAllSecurityService" />
</list>
</property>
</bean>

<bean name="puregwt-app" class="org.geomajas.configuration.client.ClientApplicationInfo">
<property name="maps">
<list>
<ref bean="mapOsm" />
<!-- <ref bean="mapWms" /> -->
<!-- <ref bean="mapLegend" /> -->
<!-- <ref bean="mapLayerVisibility" /> -->
<!-- <ref bean="mapCountries" /> -->
<!-- <ref bean="mapEmpty" /> -->
<!-- <ref bean="mapPrinting" /> -->
</list>
</property>
</bean>
<bean class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean" id="entityManagerFactory">
<property name="persistenceUnitName" value="MyPUnit" />
</bean>

<bean class="org.springframework.orm.jpa.JpaTransactionManager" id="transactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
</beans>

我也尝试像这样修改 <tx:annotation-driven />: <tx:annotation-driven transaction-manager="transactionManager"/>

最佳答案

<beans> 标签中从未提供 tx 的模式位置。请注意所提供配置的最后一行的更改。此外,配置混合了 Spring 2.0 和 2.5,我不确定这是否需要,但我想让您意识到这一点。

<beans xmlns:tx="http://www.springframework.org/schema/tx" xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

关于spring - cvc-complex-type.2.4.c : The matching wildcard is strict, 但找不到元素 'tx:annotation-driven' 的声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17566391/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com