Java Spring Tomcat:架构元素中不允许使用非空白字符。锯子';301永久移动';

Java Spring Tomcat:架构元素中不允许使用非空白字符。锯子';301永久移动';,java,spring,tomcat,hazelcast,Java,Spring,Tomcat,Hazelcast,我正在尝试使用tomcat服务器,但在加载Springbeans的定义时遇到了问题。applicationContext.xml内容如下: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"

我正在尝试使用tomcat服务器,但在加载Springbeans的定义时遇到了问题。
applicationContext.xml
内容如下:

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
   xmlns:tx="http://www.springframework.org/schema/tx"
   xmlns:aop="http://www.springframework.org/schema/aop" xmlns:task="http://www.springframework.org/schema/task" xmlns:hz="http://www.hazelcast.com/schema/spring"
   xmlns:mongo="http://www.springframework.org/schema/data/mongo"
   xmlns:solr="http://www.springframework.org/schema/data/solr" xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
   xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
    http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.5.xsd
    http://www.hazelcast.com/schema/spring META-INF/hazelcast-spring-2.0.xsd

    http://www.springframework.org/schema/data/solr http://www.springframework.org/schema/data/solr/spring-solr.xsd


    http://www.springframework.org/schema/data/elasticsearch http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd">
    ..
    ..
    ..
    ..

我做错了什么?我没有碰这个文件。

我解决了它。问题是applicationContext.xml“META-INF/hazelcast-spring-2.0.xsd”中提到的hazelcast模式版本与我使用的实际jar不同,我认为我的jar是2.4,因此将其更改为“META-INF/hazelcast-spring-2.4.xsd”解决了问题。 原因是spring首先在JAR中搜索XSD,然后在internet上搜索。因此,由于版本错误,它没有在jar中找到它,而是访问了互联网。

也有同样的问题,并通过在maven依赖项中添加版本3.5的hazelcast all而不是简单的hazelcast解决了它

<dependency>
    <groupId>com.hazelcast</groupId>
    <artifactId>hazelcast-all</artifactId>
    <version>3.5</version>
</dependency>

com.hazelcast
黑兹卡斯特
3.5

为什么要添加
**
?这在语法上是不正确的。那只是为了照明。将删除它,因为它可能会使用混淆尝试设置此文件的绝对路径而不是相对路径(作为第一个测试,如果路径或文件本身有问题)@LearningToDesign您解决过这个问题吗?我也有同样的问题?你解决过这个问题吗?我也有同样的问题!
<dependency>
    <groupId>com.hazelcast</groupId>
    <artifactId>hazelcast-all</artifactId>
    <version>3.5</version>
</dependency>