dubbo-config-spring cvc-complex-type.2.3错误的解决

研究dubbo2.6时,eclipse总报错:

cvc-complex-type.2.3: Element 'beans' cannot have character [children], because the type's content type is element-only.


经查是因为配置文件有非法字符,有的是”看不见“的字符,需要换为其他字符集,才可以看到乱码字符。我这边的问题也是非法字符,但是多了一个">"符,报错的却是上一行,"<!-- current application configuration -->>"两个">"紧邻,很不容易发现。

原配置文件override-multi-protocol.xml内容如下:

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
       xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
       ">

    <!-- current application configuration -->>
    <dubbo:application name="demo-provider"/>

    <!-- registry center configuration -->
    <dubbo:registry address="N/A"/>

    <!-- protocol configuration -->
    <dubbo:protocol name="dubbo" port="20813"/>
    <dubbo:protocol name="rmi" port="10913"/>

    <dubbo:provider protocol="dubbo,rmi"/>

    <!-- service configuration -->
    <dubbo:service interface="com.alibaba.dubbo.config.spring.api.DemoService" ref="demoService"/>

    <bean id="demoService" class="com.alibaba.dubbo.config.spring.impl.DemoServiceImpl"/>

</beans>

修改后的文件如下:

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
       xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
       ">

    <!-- current application configuration -->
    <dubbo:application name="demo-provider"/>

    <!-- registry center configuration -->
    <dubbo:registry address="N/A"/>

    <!-- protocol configuration -->
    <dubbo:protocol name="dubbo" port="20813"/>
    <dubbo:protocol name="rmi" port="10913"/>

    <dubbo:provider protocol="dubbo,rmi"/>

    <!-- service configuration -->
    <dubbo:service interface="com.alibaba.dubbo.config.spring.api.DemoService" ref="demoService"/>

    <bean id="demoService" class="com.alibaba.dubbo.config.spring.impl.DemoServiceImpl"/>

</beans>
修改完override-multi-protocol.xml后,右键此文件,在弹出菜单点击[validate],Problems框下的错误提示消息
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值