开发者社区> 问答> 正文

提交测试报NoClassDefFoundError

submit topology successfully. /opt/taobao/java/bin/java
Exception in thread "main" java.lang.NoClassDefFoundError: com/alibaba/rocketmq/client/consumer/listener/MessageListenerConcurrently
             at java.lang.ClassLoader.defineClass1(Native Method)
             at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
             at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
             at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)at java.net.URLClassLoader.access$1


本地测试没问题,提交后在结果的地方显示以上错误。以下是pom.xml


<? xml version ="1.0" encoding ="UTF-8" ?>
< project xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"
         xmlns ="http://maven.apache.org/POM/4.0.0"
         xsi :schemaLocation ="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
     < modelVersion >4.0.0 </ modelVersion >
     < groupId >com.alibaba.middleware.race </ groupId >
     < artifactId >preliminary </ artifactId >
     < version >1.0-SNAPSHOT </ version >
     < build >
         < plugins >
             < plugin >
                 < groupId >org.apache.maven.plugins </ groupId >
                 < artifactId >maven-compiler-plugin </ artifactId >
                 < configuration >
                     < source >1.6 </ source >
                     < target >1.6 </ target >
                 </ configuration >
             </ plugin >
             < plugin >
                 < groupId >org.apache.maven.plugins </ groupId >
                 < artifactId >maven-assembly-plugin </ artifactId >
                 < configuration >
                     < appendAssemblyId >false </ appendAssemblyId >
                     < descriptors >
                         < descriptor >src/main/resources/assembly.xml </ descriptor >
                     </ descriptors >
                     < descriptorRefs >
                         < descriptorRef >jar-with-dependencies </ descriptorRef >
                     </ descriptorRefs >
                 </ configuration >
                 < executions >
                     < execution >
                         < id >make-assembly </ id >
                         < phase >install </ phase >
                         < goals >
                             < goal >single </ goal >
                         </ goals >
                     </ execution >
                 </ executions >
             </ plugin >
         </ plugins >
     </ build >

     < dependencies >
         < dependency >
             < groupId >com.alibaba.rocketmq </ groupId >
             < artifactId >rocketmq-client </ artifactId >
             < version >3.2.6 </ version >
             < exclusions >
                 < exclusion >
                     < groupId >org.slf4j </ groupId >
                     < artifactId >slf4j-api </ artifactId >
                 </ exclusion >
                 < exclusion >
                     < groupId >org.slf4j </ groupId >
                     < artifactId >slf4j-log4j12 </ artifactId >
                 </ exclusion >
                 < exclusion >
                     < groupId >org.slf4j </ groupId >
                     < artifactId >slf4j-jdk14 </ artifactId >
                 </ exclusion >
             </ exclusions >
         </ dependency >

         < dependency >
             < groupId >com.alibaba.jstorm </ groupId >
             < artifactId >jstorm-core </ artifactId >
             < version >2.1.1 </ version >
             < scope >provided </ scope >
             < exclusions >
                 < exclusion >
                     < groupId >org.slf4j </ groupId >
                     < artifactId >slf4j-nop </ artifactId >
                 </ exclusion >
                 < exclusion >
                     < groupId >org.slf4j </ groupId >
                     < artifactId >slf4j-jdk14 </ artifactId >
                 </ exclusion >
             </ exclusions >
         </ dependency >

         < dependency >
             < groupId >com.taobao.tair </ groupId >
             < artifactId >tair-client </ artifactId >
             < version >2.3.5 </ version >
             < exclusions >
                 < exclusion >
                     < groupId >org.slf4j </ groupId >
                     < artifactId >slf4j-api </ artifactId >
                 </ exclusion >
                 < exclusion >
                     < groupId >org.slf4j </ groupId >
                     < artifactId >slf4j-log4j12 </ artifactId >
                 </ exclusion >
             </ exclusions >
         </ dependency >
     </ dependencies >
</ project >

展开
收起
windpicker 2016-06-29 13:06:10 5563 0
4 条回答
写回答
取消 提交回答
  • Re提交测试报NoClassDefFoundError
    我也出现了

    为什么呢

    求解决
    2016-07-07 11:20:25
    赞同 展开评论 打赏
  • I like to program and write stuff, making things a reality always make me excited. Now, I am a Apache committer.
    我们用的打包命令为:mvn clean -f ./pom.xml assembly:assembly  -Dmaven.test.skip=true
    请使用该命令进行打包并在本地进行测试。
    2016-07-05 18:00:08
    赞同 展开评论 打赏
  • Re提交测试报NoClassDefFoundError
    请问楼主有解决办法了?
    2016-07-05 16:49:42
    赞同 展开评论 打赏
  • Re提交测试报NoClassDefFoundError
    你好,我也遇到这个问题了,请问你解决了吗?
    2016-07-03 20:28:53
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
移动互联网测试到质量的转变 立即下载
给ITer的技术实战进阶课-阿里CIO学院独家教材(四) 立即下载
F2etest — 多浏览器兼容性测试整体解决方案 立即下载