Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
cvc elt.1:找不到元素';豆子';-Spring 4.0.2_Spring_Tomcat - Fatal编程技术网

cvc elt.1:找不到元素';豆子';-Spring 4.0.2

cvc elt.1:找不到元素';豆子';-Spring 4.0.2,spring,tomcat,Spring,Tomcat,虽然我已经尝试了很多方法来解决这个问题,但还没有成功 我在“dispatcher servlet.xml”文件中遇到错误“cvc elt.1:找不到元素“beans”的声明” 我的pom.xml文件是: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apach

虽然我已经尝试了很多方法来解决这个问题,但还没有成功

我在“dispatcher servlet.xml”文件中遇到错误“cvc elt.1:找不到元素“beans”的声明”


我的pom.xml文件是:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.b2b</groupId>
    <artifactId>b2b</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>b2b</name>
    <description>Blog to Blog</description>

    <!-- Plugin needs to be added in the project so that these will be available with the war file for ever. -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <!-- Dependencies Version -->
    <properties>
        <springframework.version>4.0.2.RELEASE</springframework.version>
        <javax.servlet.version>3.1.0</javax.servlet.version>
        <commons.logging.version>1.2</commons.logging.version>
        <hibernate-validator>5.1.3.Final</hibernate-validator>
        <aspectj.version>1.7.4</aspectj.version>
    </properties>


    <dependencies>
        <!-- Spring base dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>${springframework.version}</version>
        </dependency>

        <!-- Spring Other dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${springframework.version}</version>
        </dependency>

        <!-- Javax Http Servlet Dependency -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${javax.servlet.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Commons Logging -->
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>${commons.logging.version}</version>
        </dependency>

        <!-- Hibernate Validator -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>${hibernate-validator}</version>
        </dependency>

        <!-- Aspectj Dependency -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectj.version}</version>
        </dependency>

    </dependencies>

</project>

4.0.0
com.b2b
b2b
0.0.1-快照
战争
b2b
博客到博客
org.apache.tomcat.maven
tomcat7 maven插件
2.2
org.apache.maven.plugins
maven编译器插件
3.3
1.7
1.7
4.0.2.1发布
3.1.0
1.2
5.1.3.最终版本
1.7.4
org.springframework
弹簧芯
${springframework.version}
org.springframework
spring上下文
${springframework.version}
org.springframework
春豆
${springframework.version}
org.springframework
弹簧式
${springframework.version}
org.springframework
春季方面
${springframework.version}
org.springframework
弹簧网
${springframework.version}
org.springframework
SpringWebMVC
${springframework.version}
org.springframework
春季aop
${springframework.version}
org.springframework
spring上下文支持
${springframework.version}
javax.servlet
javax.servlet-api
${javax.servlet.version}
假如
公用记录
公用记录
${commons.logging.version}
org.hibernate
休眠验证器
${hibernate验证程序}
org.aspectj
aspectjweaver
${aspectj.version}

有人能看看我的问题吗。

您正在为
beans
元素使用一个不固定的名称,但是您已经将相关的名称空间绑定到了一个前缀

xmlns:beans="http://www.springframework.org/schema/beans"
您可能希望使用默认名称空间声明
xmlns=“…”
,而不是
xmlns:beans=“…”
,或者使用前缀作为元素名称

<beans:beans ...>

change
xmlns:beans=”http://www.springframework.org/schema/beans“
xmlns=”中的
http://www.springframework.org/schema/beans“


尝试禁用语言服务器错误:进入首选项->语言服务器并将其全部关闭。
<beans:beans ...>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">

    <context:component-scan base-package="com.b2b.controller" />

</beans>