Cannot find BeanDefinitionParser for [bean]

I follow along with this tutorial for working with Apache Tiles 3 my servlet-context.xml projects:

<?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.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <!-- DispatcherServlet Context: defines this servlet 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/" /> <!-- 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="ali.arshad.soomro" /> <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer"> <property name="definitions"> <list> <value>/WEB-INF/defs/general.xml</value> </list> </property> </bean> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.tiles3.TilesView" /> </bean> </beans:beans> 

here i ran into an error

A few annotations found on this line: - Configuration problem: cannot find BeanDefinitionParser for [bean] element Abusive resource: file [G: / Spring / java-blog / src / main / webapp / WEB-INF / Spring / appServlet / servlet-context.xml] - Unable to find BeanDefinitionParser for [bean] element - cvc-complex-type.2.4.c: The corresponding template is strict, but no declaration was found for the 'bean' element.

at line class="org.springframework.web.servlet.view.tiles3.TilesConfigurer"
and error

cvc-complex-type.2.4.c: The corresponding template is strict, but no advertisement was found for the 'bean' element.

in the line class="org.springframework.web.servlet.view.UrlBasedViewResolver" .

pom.xml dependencies

 <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-api</artifactId> <version>3.0.3</version> </dependency> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-core</artifactId> <version>3.0.3</version> </dependency> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-jsp</artifactId> <version>3.0.3</version> </dependency> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-servlet</artifactId> <version>3.0.3</version> </dependency> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-template</artifactId> <version>3.0.3</version> </dependency> 

UPDATE after the sentence in the answer below, I made a change to servlet-contex.xml as

 <beans:bean class="org.springframework.web.servlet.view.tiles3.TilesViewResolver"> <beans:property name="viewClass" value="org.springframework.web.servlet.view.tiles3.TilesView"></beans:property> <beans:property name="order" value="0"></beans:property> </beans:bean> <beans:bean class="org.springframework.web.servlet.view.tiles3.TilesConfigurer" id="tilesConfigurer"> <beans:property name="definitions" value="/WEB-INF/spring/tiles.xml"> </beans:property> </beans:bean> 

Now i get this error

Attribute: class The fully-qualified name of the bean class, unless it serves only as the parent definition for the child bean.

Data Type: String

on the line class="org.springframework.web.servlet.view.tiles3.TilesViewResolver" and on the line class="org.springframework.web.servlet.view.tiles3.TilesConfigurer"
Can someone suggest me a solution to these errors?

0
source share
1 answer

Problem with namespace. You must have all tags starting with beans

+1
source

Source: https://habr.com/ru/post/988285/


All Articles