dubbo 常见错误

1. Caused by: java.lang.reflect.MalformedParameterizedTypeException

启动时报错,原因是dubbo 依赖 spring 2.5.6.SEC03,而我项目中有用spring 3.2.4.RELEASE,所以导致冲突。 在maven中把dubbo中的spring依赖去除就可以了。

如果你们项目中也报这个错,很可能也是因为jar包冲突造成的

1
2
3
4
5
6
7
8
9
10
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>dubbo</artifactId>
    <exclusions> 
        <exclusion> 
            <artifactId>spring</artifactId> 
            <groupId>org.springframework</groupId> 
        </exclusion> 
    </exclusions> 
</dependency>

2. Caused by: java.lang.IllegalStateException: Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on JDK 1.5 and higher

at org.springframework.context.config.ContextNamespaceHandler$1.parse(ContextNamespaceHandler.java:65)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
... 22 more

错误原因:http://stackoverflow.com/questions/23813369/spring-java-error-namespace-element-annotation-config-on-jdk-1-5-and-high

因为使用了 jdk1.8, 而dubbo 依赖 Spring 2.5 ,而Spring2.5仅仅支持 jdk1.5 到 jdk 1.7, 所以jdk 1.8 不被识别,所以报错。

3. Caused by: org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 46; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 'dubbo:application' 的声明。

该错误是因为没有引入 dubbo jar包。加上依赖就行了:

1
2
3
4
5
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>dubbo</artifactId>
    <exclusions> 
</dependency>

4. Unsupported major.minor version 52.0 (unable to load class

出现该错误是由于class编译器的JDK版本高于运行期的JDK版本。

比如我在运行Tomcat servlet时出现该错误,是由于tomcat运行时是1.7的JDK,Eclipse编译时则是1.8 

修改方法:保证编译器和运行期的JDK版本一致。

springmvc错误集锦-dubbo包含低版本的spring包,依赖的时候应该排除Caused by: java.lang.reflect.MalformedParameterizedTypeException的更多相关文章

  1. dubbo 常见错误 通配符的匹配很全面, 但无法找到元素 'dubbo:application' java.lang.reflect.MalformedParameterizedTypeException 通配符的匹配很全面, 但无法找到元素 'dubbo:application' 的声明。 Unsupported major.minor version 52.0 (unable to l

    dubbo 常见错误 1. Caused by: java.lang.reflect.MalformedParameterizedTypeException 启动时报错,原因是dubbo 依赖 spr ...

  2. Tomcat启动报Error listenerStart错误 | "beans" 必须匹配 DOCTYPE 根 "null" | java.lang.reflect.MalformedParameterizedTypeException

    maven打包发布工程时,发布上去却报错FAIL - Deployed application at context path /ch but context failed to start 在服务器 ...

  3. Spring+Mybatis+Dubbo报错java.lang.reflect.MalformedParameterizedTypeException

    原因是spring的jar文件冲突,排除spring的文件即可 <dependency> <groupId>com.alibaba</groupId> <ar ...

  4. Java 错误提示org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException

    java 操作excel文件 发布后报错 org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException XSS ...

  5. Caused by: java.lang.ClassCastException: org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer错误解决办法

    严重: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"] java. ...

  6. Caused by: java.lang.ClassNotFoundException: com.alibaba.dubbo.common.Version

    <dependency> <groupId>com.alibaba.boot</groupId> <artifactId>dubbo-spring-bo ...

  7. 错误: java.lang.reflect.InvocationTargetException

    错误: java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke0(N ...

  8. spring-framework-3.2.4.RELEASE 综合hibernate-release-4.3.5.Final一个错误Caused by: java.lang.NoClassDefFound

    LZ一体化的今天spring-framework-3.2.4.RELEASE 综合hibernate-release-4.3.5.Final一个错误Caused by: java.lang.NoCla ...

  9. 关于java.lang.reflect.InvocationTargetException(jar 包缺少或者冲突)的错误

    我在合肥那边运行了的是湖北石首市的项目没有错 可是回武汉之后 运行这个项目 点击这里的时候 就报错java.lang.reflect.InvocationTargetException   不是数据库 ...

随机推荐

  1. 解决maven项目中,缺少 maven dependencies

    因为项目需要将普通项目转换为maven项目,在右键 ’项目‘configure 后,添加maven后,发现缺少 maven dependencies,于是从网上找了一些处理措施,大体上是在.class ...

  2. Apache Commons Email 使用网易企业邮箱发送邮件

    最近使用HtmlEmail 发送邮件,使用网易企业邮箱,发送邮件,死活发不出去!原以为是网易企业邮箱,不支持发送邮箱,后面经过研究发现,是apache htmlEmail 的协议导致,apache E ...

  3. VirtualBox使用Centos7与主机共享文件夹

    最近使用VitrtualBox安装Centos7学习,liunx脚本和一些命令,经过一些研究完成了虚拟机与 主机共享文件夹,虚拟机链接外部网络,主机与虚拟机互相通信.在其中遇到一些我解决的技术问题记录 ...

  4. Heka 的 CMake 编译配置分析

    CMake 是一个跨平台的自动化建构系统,它使用一个名为 CMakeLists.txt 的文件来描述构建过程,可以产生标准的构建文件.   CMakeLists.txt 的语法比较简单,由命令.注释和 ...

  5. python使用元类

    原文:https://blog.csdn.net/youzhouliu/article/details/51906158 type() 动态语言和静态语言最大的不同,就是函数和类的定义,不是编译时定义 ...

  6. java 错误: 未报告的异常错误Exception; 必须对其进行捕获或声明以便抛出

    import java.io.FileInputStream; import java.util.Properties; import java.sql.Connection; import java ...

  7. Effective C++ .17 函数调用时的资源管理

    以书上的代码为例 processWidget(shared_ptr<Widget>(new Widget), priority()) 虽然使用了智能指针来管理资源但是,由于参数值计算顺序的 ...

  8. 54个提高PHP程序运行效率的方法(转载)

    原文地址:http://www.jb51.net/article/69677.htm 1. 如果一个方法可静态化,就对它做静态声明.速率可提升至4倍. 2. echo 比 print 快. 3. 使用 ...

  9. js-TextArea的换行符处理

    js-txt文本处理 写自己主页项目时所产生的小问题拿出来给大家分享分享,以此共勉. ---DanlV TextArea的换行符处理 TextArea文本转换为Html:写入数据库时使用 js获取了t ...

  10. input框中如何添加搜索

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...