我在“tx:annotation-driven”行中得到了上面的错误,但是我已经在bean文件的顶部声明了命名空间,为什么下面的XML会导致这个错误?
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing
infrastructure -->
<!-- Enables the Spring MVC @Controller programming model -->
<tx:annotation-driven transaction-manager="hibernateTransactionManager"/>
<!-- Handles HTTP GET requests for /resources/** by efficiently serving
up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />
<!-- Resolves views selected for rendering by @Controllers to .jsp resources
in the /WEB-INF/views directory -->
<beans:bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<beans:property name="driverClassName" value="com.mysql.jdbc.Driver" />
<beans:property name="url" value="jdbc:mysql://localhost/assessme" />
<beans:property name="username" value="assessme" />
<beans:property name="password" value="assessme" />
</beans:bean>
<beans:bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<beans:property name="annotatedClasses">
<beans:list>
<beans:value>org.assessme.com.entity.User</beans:value>
</beans:list>
</beans:property>
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="packagesToScan" value="org.assessme.com.controller.entity" />
<beans:property name="hibernateProperties">
<beans:props>
<beans:prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</beans:prop>
<beans:prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</beans:prop>
<beans:prop key="hibernate.show_sql">true</beans:prop>
<beans:prop key="hibernate.hbm2ddl.auto">update</beans:prop>
</beans:props>
</beans:property>
</beans:bean>
<context:component-scan base-package="org.assessme.com." />
<beans:bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<beans:property name="mediaTypes">
<beans:map>
<beans:entry key="html" value="text/html" />
<beans:entry key="json" value="application/json" />
</beans:map>
</beans:property>
<beans:property name="defaultViews">
<beans:list>
<beans:bean
class="org.springframework.web.servlet.view.json.MappingJacksonJsonView">
<beans:property name="prefixJson" value="true" />
</beans:bean>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="hibernateTransactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<beans:property name="sessionFactory" ref="sessionFactory" />
</beans:bean>
</beans:beans>
就像您的其他xmlns:定义一样,您需要一个用于xmlns:tx的定义
xmlns:tx="http://www.springframework.org/schema/tx"
问题内容: 我在“ tx:annotation-driven”行上收到上述错误,但是我在Bean文件的顶部声明了名称空间,为什么以下XML导致此错误? 问题答案: 就像其他xmlns:定义一样,您需要一个xmlns:tx
我在我的“tx:注解驱动”行上得到了上面的错误,但是我已经在bean文件的顶部声明了命名空间,为什么以下XML会导致这个错误?
jaxb 将所有标签分组为一个,我需要每个标签都有自己的命名空间。 具有: 需要: 将命名空间添加到@XmlElement没有帮助 包装信息:
我试图使用以下命令将文件部署到远程存储库: 我收到了这个错误消息: 在当前项目和插件组[org.apache.maven.plugins,org.codehaus.mojo]中找不到前缀“–Durl=http”的插件,这些插件可从中央存储库[local(/Users/ssurendran/.m2/repository]获得(https://repo.maven.apache.org/maven2)
我想为spring批处理使用不同的数据源,并创建了下面的配置类,并根据文档将我所需的数据源自动连接到该类。 我使用的是spring boot(2.2.6)和spring batch版本4.2.1。释放 但当我用它启动应用程序时,它从不应用setTablePrefix,并且总是会失败,出现table not found错误。 我需要使用上面的方法,因为我有两个不同的数据源,我需要spring批处理来