내 mvc-dispatcher-servlet.xml에서 스프링 프로필을 사용하고 있습니다. 그러나 점점 오류 : 나는이 두 프로필에 사용되는 원하는XML의 스프링 프로필 오류
cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'. One of '{"http://www.springframework.org/schema/beans":beans}' is expected.
내가 프로필에 다른 콩을 추가하고 있지 않다. 오류를 해결하는 데 도움이 필요합니다. 다음은 내 XML이며, 오류가 = "의 transactionManager" 클래스 = "org.springframework.orm.hibernate5.HibernateTransactionManager"> 라인 - 콩 ID에오고있다 :
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- Specifying base package of the Components like Controller, Service,
DAO -->
<context:component-scan base-package="com.mycompany.saas.*" />
<!-- Getting Database properties -->
<context:property-placeholder location="classpath:db.properties" />
<!-- Getting Configuration properties -->
<!-- <context:property-placeholder location="classpath:config.properties"
/> -->
<mvc:annotation-driven />
<beans profile="default">
<!-- DataSource -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="${database.driverClass}" />
<property name="jdbcUrl" value="${database.url}" />
<property name="user" value="${database.username}" />
<property name="password" value="${database.password}" />
<property name="acquireIncrement" value="${connection.acquireIncrement}" />
<property name="minPoolSize" value="${connection.minPoolSize}" />
<property name="maxPoolSize" value="${connection.maxPoolSize}" />
<property name="maxIdleTime" value="${connection.maxIdleTime}" />
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<!-- <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> -->
<prop key="hibernate.default_schema">${hibernate.default_schema}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.connection.shutdown">true</prop>
</props>
</property>
<property name="packagesToScan" value="com.mycompany.saas.model"></property>
</bean>
</beans>
<beans profile="test">
<!-- DataSource -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="${database.driverClass}" />
<property name="jdbcUrl" value="${database.url}" />
<property name="user" value="${database.username}" />
<!-- <property name="password" value="${database.password}" /> -->
<property name="acquireIncrement" value="${connection.acquireIncrement}" />
<property name="minPoolSize" value="${connection.minPoolSize}" />
<property name="maxPoolSize" value="${connection.maxPoolSize}" />
<property name="maxIdleTime" value="${connection.maxIdleTime}" />
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.connection.shutdown">true</prop>
</props>
</property>
<property name="packagesToScan" value="com.mycompany.saas.model"></property>
</bean>
</beans>
<!-- Transaction -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="applicationContextProvder" class="com.mycompany.saas.util.ApplicationContextProvider" />
<bean id="mcSaasUserDAO" class="com.mycompany.saas.dao.mcSaasUserDAOImpl"></bean>
<bean id="mcUserService" class="com.mycompany.saas.service.mcUserServiceImpl"></bean>
<bean id="emailContentGenerator" class="com.mycompany.saas.notifier.mcEmailContentGenerator">
<constructor-arg value="classpath:/mail.html" />
</bean>
</beans>
메시지에 회선/열 번호가 포함되어 있습니까? (해당되는 경우 항상 ENTIRE 메시지와 스택 추적을 포함하십시오). 행/열 번호가있는 경우 XML에있는 위치를 지적하십시오. –
@JimGarrison 질문이 업데이트되었습니다. – user3396729