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

时间:2015-08-04 09:51:32

标签: java spring tomcat hazelcast

我正在尝试启动一个tomcat服务器,并且面临加载spring bean定义的问题。 @extends('master') @section('content') <div class="row"> <div class="col-md-3"> @yield('column') </div> <div class="col-md-9"> @yield('content') </div> </div> @stop 内容如下:

@extends('column')

@section('column')
    content in column section
@stop

@section('content')
    content in col-md-9 div
@stop

IDE(Idea)表示无法解析文件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">
    ..
    ..
    ..
    ..

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

2 个答案:

答案 0 :(得分:2)

我解决了。问题是applicationContext.xml“http://www.hazelcast.com/schema/spring META-INF / hazelcast-spring-2.0.xsd”中提到的hazelcast模式版本与我使用的实际jar不同,我认为我的是2.4,所以改变它“http://www.hazelcast.com/schema/spring META-INF / hazelcast-spring-2.4.xsd”解决了这个问题。 解释是春天首先在罐子里搜索xsds然后在互联网上搜索。因为错误的版本它没有在罐子里找到它,而是在上网。

答案 1 :(得分:1)

http://www.hazelcast.com/schema/spring/hazelcast-spring-3.5.xsd有同样的问题,并通过在maven依赖项中添加版本3.5的hazelcast-all而不是简单的hazelcast来解决它。

someTask.ContinueWith((task) => TaskRunning=true;);