- 浏览: 505911 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (449)
- java细节 (186)
- javascript (6)
- tomcat (2)
- java基础 (17)
- extjs (1)
- java 开源 (17)
- java-bug (5)
- 电脑软件 (16)
- oracle-dba (8)
- oracle (6)
- java 精神 (17)
- SSH (6)
- 常用开源 (29)
- Mysql (22)
- 电脑学习 (8)
- jsp (12)
- html5 (6)
- hadoop (3)
- webos (2)
- web前端开发 (7)
- java实践 (2)
- 其它 (19)
- python (4)
- c++ (1)
- linux (2)
- css3+h5 (9)
- bootstrap (12)
- ps (1)
- vue (5)
- android (3)
最新评论
-
springdata_springmvc:
java inputstream demo教程源代码下载:ht ...
文件的读写 -- java FileInputStream -
hukaimiao:
[/c佛挡[size=x-small][color=darkr ...
文件的读写 -- java FileInputStream -
wwm4851186:
可惜这是中国
10大技能 让你坐享10万美元薪酬 -
zhubo357087527:
楼主,这样写可以吗?用“Process proc = Runt ...
在java中如何调用linux的ctrl+c指令?
activemq 5.2
最近项目要用到JMS,因为用tomcat容器,所以采用了开源的ActiveMQ 消息中间件提供JMS支持。但是在spring2.5和activemq5.2集成的时候出现了点问题,首先列出activemq-import-beans.xml的内容:
Java代码
1.<beans xmlns="http://www.springframework.org/schema/beans"
2. xmlns:amq="http://activemq.org/config/1.0"
3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
5. http://activemq.org/config/1.0 http://activemq.apache.org/schema/core/activemq.xsd">
运行测试程序出现以下异常:
Java代码
1.Caused by: org.xml.sax.SAXParseException: TargetNamespace.1: Expecting namespace 'http://activemq.org/config/1.0', but the target namespace of the schema document is 'http://activemq.apache.org/schema/core'.
2. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
3. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
4. at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
5. at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2525)
6. at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:768)
7. at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:569)
8. at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:552)
9. at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2408)
10. at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1753)
11. at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
12. at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
13. at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
14. at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
15. at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
16. at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
17. at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
18. at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
19. at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
20. at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
21. at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
22. at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
23. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
24. ... 22 more
通过阅读异常信息发现时XSD名称空间不对,所以赶紧打开activemq-core-5.2.0.jar/META-INF/目录中的spring.schemas查看,发现"http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd"
于是乎又打开activemq.xsd查个究竟,以下为activemq5.2的activemq.xsd文件一部分:
Java代码
1.<xs:schema elementFormDefault='qualified'
2. targetNamespace='http://activemq.apache.org/schema/core'
3. xmlns:xs='http://www.w3.org/2001/XMLSchema'
4. xmlns:tns='http://activemq.apache.org/schema/core'>
噢,原来目标名称空间不一致啊。于是赶紧去改activemq-import-beans.xml文件的配置,修改如下:
Java代码
1.<?xml version="1.0" encoding="UTF-8"?>
2.<beans xmlns="http://www.springframework.org/schema/beans"
3.xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
4.xmlns:amq="http://activemq.apache.org/schema/core" //这个地方很关键,amq对应的XSD名称空间名称要和activemq.xsd的一致
5.xsi:schemaLocation="
6.http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
7.http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq.xsd">
呵呵,到这里以为问题已经搞定,但是运行测试后,又发现一个新的问题,异常信息如下:
Java代码
1.org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://activemq.apache.org/schema/core/activemq.xsd', because 1) could not find the document;
2. 2) the document could not be read;
3. 3) the root element of the document is not <xsd:schema>.
查看了异常信息后,发现可能是spring无法定位到http://activemq.apache.org/schema/core/activemq.xsd,于是又一次打开activemq-core-5.2.0.jar/META-INF的spring.schemas,内容如下:
Java代码
1.http\://activemq.org/config/1.0=activemq.xsd
2.http\://activemq.org/config/1.0/1.0.xsd=activemq.xsd
3.http\://activemq.apache.org/schema/core=activemq.xsd
4.http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd
呵呵,发现问题了吗?初看没啥问题,但是仔细一看,噢,原来http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd 与http://activemq.apache.org/schema/core/activemq.xsd 不匹配,呵呵,知道问题根源了,现在时解决办法,解决办法有两种:
第一种:修改activemq-import-beans.xml文件的“http://activemq.apache.org/schema/core/activemq.xsd ”这句为:http://activemq.apache.org/schema/core/activemq-core.xsd(这个就是activemq jar包中spring.schemas文件的最后一行,但是注意:http\://要改为http://)
第二种:在classpath目录中,新建META-INF/spring.schemas文件,然后增加一下内容:
Java代码
1.http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd
这个时候重新运行测试,发现一切OK。哈。。
转:http://xmuzyq.iteye.com/blog/365989
最近项目要用到JMS,因为用tomcat容器,所以采用了开源的ActiveMQ 消息中间件提供JMS支持。但是在spring2.5和activemq5.2集成的时候出现了点问题,首先列出activemq-import-beans.xml的内容:
Java代码
1.<beans xmlns="http://www.springframework.org/schema/beans"
2. xmlns:amq="http://activemq.org/config/1.0"
3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
5. http://activemq.org/config/1.0 http://activemq.apache.org/schema/core/activemq.xsd">
运行测试程序出现以下异常:
Java代码
1.Caused by: org.xml.sax.SAXParseException: TargetNamespace.1: Expecting namespace 'http://activemq.org/config/1.0', but the target namespace of the schema document is 'http://activemq.apache.org/schema/core'.
2. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
3. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
4. at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
5. at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2525)
6. at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:768)
7. at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:569)
8. at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:552)
9. at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2408)
10. at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1753)
11. at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
12. at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
13. at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
14. at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
15. at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
16. at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
17. at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
18. at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
19. at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
20. at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
21. at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
22. at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
23. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
24. ... 22 more
通过阅读异常信息发现时XSD名称空间不对,所以赶紧打开activemq-core-5.2.0.jar/META-INF/目录中的spring.schemas查看,发现"http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd"
于是乎又打开activemq.xsd查个究竟,以下为activemq5.2的activemq.xsd文件一部分:
Java代码
1.<xs:schema elementFormDefault='qualified'
2. targetNamespace='http://activemq.apache.org/schema/core'
3. xmlns:xs='http://www.w3.org/2001/XMLSchema'
4. xmlns:tns='http://activemq.apache.org/schema/core'>
噢,原来目标名称空间不一致啊。于是赶紧去改activemq-import-beans.xml文件的配置,修改如下:
Java代码
1.<?xml version="1.0" encoding="UTF-8"?>
2.<beans xmlns="http://www.springframework.org/schema/beans"
3.xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
4.xmlns:amq="http://activemq.apache.org/schema/core" //这个地方很关键,amq对应的XSD名称空间名称要和activemq.xsd的一致
5.xsi:schemaLocation="
6.http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
7.http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq.xsd">
呵呵,到这里以为问题已经搞定,但是运行测试后,又发现一个新的问题,异常信息如下:
Java代码
1.org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://activemq.apache.org/schema/core/activemq.xsd', because 1) could not find the document;
2. 2) the document could not be read;
3. 3) the root element of the document is not <xsd:schema>.
查看了异常信息后,发现可能是spring无法定位到http://activemq.apache.org/schema/core/activemq.xsd,于是又一次打开activemq-core-5.2.0.jar/META-INF的spring.schemas,内容如下:
Java代码
1.http\://activemq.org/config/1.0=activemq.xsd
2.http\://activemq.org/config/1.0/1.0.xsd=activemq.xsd
3.http\://activemq.apache.org/schema/core=activemq.xsd
4.http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd
呵呵,发现问题了吗?初看没啥问题,但是仔细一看,噢,原来http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd 与http://activemq.apache.org/schema/core/activemq.xsd 不匹配,呵呵,知道问题根源了,现在时解决办法,解决办法有两种:
第一种:修改activemq-import-beans.xml文件的“http://activemq.apache.org/schema/core/activemq.xsd ”这句为:http://activemq.apache.org/schema/core/activemq-core.xsd(这个就是activemq jar包中spring.schemas文件的最后一行,但是注意:http\://要改为http://)
第二种:在classpath目录中,新建META-INF/spring.schemas文件,然后增加一下内容:
Java代码
1.http\://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd
这个时候重新运行测试,发现一切OK。哈。。
转:http://xmuzyq.iteye.com/blog/365989
发表评论
-
centos7 下载 安装
2021-11-07 10:28 413下载地址 https://mirrors.cqu.edu.cn ... -
idea 代码规范化工具 checkstyle
2020-08-12 09:54 527https://plugins.jetbrains.com/a ... -
从十大硅谷前沿公司看2016年五大技术趋势 (转)
2016-04-28 16:18 461趋势一:新芯片与生物模拟 趋势二:人工智能与服务机器人 ... -
HIVE运算的时候报HADOOP Name node is in safe mode 错 (已测试)
2015-05-23 14:11 446进入hadoop目录 $./hadoop dfsadmin ... -
jdk7 fork/join 性能测试-不如for循环~~很奇怪
2014-12-16 23:02 897两种方法计算 Fibonacci package jdk7; ... -
15个具有高度影响力的Apache开源项目
2013-10-14 00:07 1071Apache还提供更为宽容的开源许可证。 下面是15个多年来 ... -
ibatis和hibernate 区别分析(转)
2013-08-19 00:23 799Hibernate:“全自动化封装” 提供的方法完成持久层操作 ... -
总结2011年10个最重要的开源软件(转)
2013-06-21 00:11 9822011年是开源领域标志性的一年。正因如此,挑选 10 个最重 ... -
OpenStack,CloudStack与Hadoop的关系
2013-05-25 11:51 2808OpenStack,CloudStack与Hadoop的关系: ... -
flashpaper实现百度文库、豆丁网文档预览功能 - 坑
2012-10-09 23:51 1516最近公司实现一个类似百度文库的功能,发现FlashPaper还 ... -
junit 入门实例
2012-09-28 23:57 993需要在工程中引入junit的jar包,测试sum方法的返回值是 ... -
hibernate 包结构(转)
2012-01-28 01:12 10941. org.hibernate : ... -
hibernate 基于外键的1-1
2012-01-07 13:41 843public class Wife { private Lon ... -
servlet 八个Listener接口,六个Event类别 (转)
2011-12-23 00:24 919Servlet事件监听器 在Servlet技术中已 ... -
spring 事务管理
2011-12-08 00:54 1018事务 包括ACID 四个性质 详见我前面的文章 “acid-事 ... -
ognl 之运算符--string 字符串 计算 表达式
2011-11-01 00:04 3688OGNL 作为struts2的一个表达式,这里只介绍它的运算符 ...
相关推荐
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...
declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document 'http:// code.alibabatech.com/schema/dubbo/dubbo.xsd', because 1) could not find ...
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:resources' 报错
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...
使用 dubbo 时需要添加 dubbo 支持,否则会报错 。cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'.
当我们遇到描述中的错误——"cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:reference'"时,这通常意味着XML解析器在尝试解析配置文件时找不到...
在Spring框架中,配置文件是核心组件之一,它定义了bean的实例化、依赖注入以及其他的设置。当遇到“cvc-elt.1: 找不到元素 'beans' 的声明”这种异常时,通常意味着Spring在尝试解析XML配置文件时遇到了问题。这个...
【sgcWebSockets4源码版】是一个用于Delphi开发的WebSocket库,适用于D7(Delphi 7)到XE10.3.2等多个版本的Delphi IDE。WebSocket是一种在客户端和服务器之间建立持久连接的协议,它允许双向通信,即服务器和客户端...
stylelint声明使用CSS自定义属性一个定制... /* this declaration will be highlighted */ border : 1 px solid rgb ( 0 , 255 , 0 , 0.5 ); /* this declaration will be highlighted */ animation-name : red; /* t
for语句用的是枚举所有情况,你可以自行修改。 对预备工作中自然语言描述的简化C编译器的语言特性的语法,设计上下文无关文法进行描述 借助Yacc工具实现语法分析器 考虑语法树的构造: 1.语法树数据结构的设计:节点...
1. **“statement expected but procedure found”**:这个错误提示表明在编译器尝试找到一个语句的地方,它却找到了一个过程(Procedure)的定义。这通常意味着你在某个过程或函数的定义中忘记了关闭的`end`关键字...
spring-instrument-tomcat-... so Spring provides a custom ClassLoader that can be used by placing spring-instrument-tomcat.jar in $TOMCAT_HOME/lib and putting a loader declaration in META-INF/context.xml.
- **Variable Declaration in For Loop**: Variables can be declared within the for loop. For example: ```scala for (i ; from = 4 - i; j ) println(i * 10 + j) ``` #### Pattern Matching Pattern ...
错误提示:no declaration can be found for element 'dubbo:application'。 根据此错误提示进行修改后的Dubbo文件,已亲测可用。
usually what you want, but there might be situations when you want to exclude files, such as when you have more than one target, like a unit-test target. Most of the time you can just accept the ...
RzBorder.pas Number of elements differs from declaration TRzLEDCharacters 在装完Raize控件之后编译老是出如下错误: [Pascal Error] RzBorder.pas(1429): E2072 Number of elements (125) differs from ...