뚜또
10
2020-05-23 02:34:24
4
85

spring 에러질문드립니다...) cvc-complex-type.2.3: Element 'beans:beans' cannot have character [children], because the type's content type is element-only.


코드는 이러는데 http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"><!--이줄에서 에러 --> 이줄에서 에러가 납니다ㅠㅠ


구글링해서 jdk버전도 확인했고 프로젝트 maven 업데이트도 해보고 .m2->repository도 삭제해보고 이클립스 재기동도 해보고 오타도 확인해봤는데 안없어지네요ㅠㅠㅠㅠ혹시 아시는 분 있을까요????

<?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 https://www.springframework.org/schema/mvc/spring-mvc.xsd
		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"><!--이줄에서 에러 -->

	's request-processing infrastructure -->
	
	<!-- Enables the Spring MVC @Controller programming model -->
	<annotation-driven />

	<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
	<resources mapping="/resources/**" location="/resources/" /> <!-- 디스패처가 가로채지말고 리소스폴더로 가라 -->
	<resources mapping="/img/**" location="/resources/img/" />
	<resources mapping="/css/**" location="/resources/css/" />
	<resources mapping="/js/**" location="/resources/js/" />
	<resources mapping="/vendor/**" location="/resources/vendor/" />

	<!-- 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>
	
<context:component-scan base-package="iducs.spring.blog201712043" />
    <beans:bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<beans:property name="locations">
            <beans:list>
           <!-- <beans:value>/WEB-INF/spring/appServlet/oracle.properties</beans:value> -->
				<beans:value>/WEB-INF/classes/application.properties</beans:value>
			</beans:list>
		</beans:property>
	</beans:bean>
    <!--<context:property-placeholder location="oracle.properties" />-->
<beans:bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
	<beans:property name="driverClass" value="${jdbc.driverClassName}" />
	<beans:property name="url" value="${jdbc.url}" />
	<beans:property name="username" value="${jdbc.username}" />
	<beans:property name="password" value="${jdbc.password}" />
</beans:bean>

    <beans:bean id="blogRepository" class="iducs.spring.blog201712043.repository.BlogRepositoryImpl">
		<beans:constructor-arg ref="dataSource" />
	</beans:bean>
	
    <beans:bean id="blogService" class="iducs.spring.blog201712043.service.BlogServiceImpl">
   		<beans:constructor-arg ref="blogRepository" />
    </beans:bean>|
</beans:beans>


0
0
  • 답변 4

  • 시닙이
    852
    2020-05-23 02:37:51

    중간에 


    's request-processing infrastructure -->부분 주석 처리 잘못된거 아닌가요
    0
  • 뚜또
    10
    2020-05-23 03:03:00

    엇 아니에요....저기엔 왜짤렸지ㅠ

    <?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 https://www.springframework.org/schema/mvc/spring-mvc.xsd
    		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
    		http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"> <!-- 에러 -->
    
    	<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
    	
    	<!-- Enables the Spring MVC @Controller programming model -->
    	<annotation-driven />
    
    	<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
    	<resources mapping="/resources/**" location="/resources/" /> <!-- 디스패처가 가로채지말고 리소스폴더로 가라 -->
    	<resources mapping="/img/**" location="/resources/img/" />
    	<resources mapping="/css/**" location="/resources/css/" />
    	<resources mapping="/js/**" location="/resources/js/" />
    	<resources mapping="/vendor/**" location="/resources/vendor/" />
    
    	<!-- 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>
    	
    <context:component-scan base-package="iducs.spring.blog201712043" />
        <beans:bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    		<beans:property name="locations">
                <beans:list>
               <!-- <beans:value>/WEB-INF/spring/appServlet/oracle.properties</beans:value> -->
    				<beans:value>/WEB-INF/classes/application.properties</beans:value>
    			</beans:list>
    		</beans:property>
    	</beans:bean>
        <!--<context:property-placeholder location="oracle.properties" />-->
    <beans:bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
    	<beans:property name="driverClass" value="${jdbc.driverClassName}" />
    	<beans:property name="url" value="${jdbc.url}" />
    	<beans:property name="username" value="${jdbc.username}" />
    	<beans:property name="password" value="${jdbc.password}" />
    </beans:bean>
    
        <beans:bean id="blogRepository" class="iducs.spring.blog201712043.repository.BlogRepositoryImpl">
    		<beans:constructor-arg ref="dataSource" />
    	</beans:bean>
    	
        <beans:bean id="blogService" class="iducs.spring.blog201712043.service.BlogServiceImpl">
       		<beans:constructor-arg ref="blogRepository" />
        </beans:bean>|
    </beans:beans>
    

    ㅠㅠ주석처리는 제대로 되어있습니다ㅠㅠ

    0
  • 시닙이
    852
    2020-05-23 03:06:52
    0
  • 뚜또
    10
    2020-05-23 03:11:05

    아니에요ㅠㅠㅠ감사합니다 하핳...근데 저것도 해봐서....;ㅡ;

    0
  • 로그인을 하시면 답변을 등록할 수 있습니다.