java.lang.NoClassDefFoundError: HelloWorld (wrong name: org/xuwei/HelloWorld)

JIRA | luoxinwei1 | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Exception in thread "main" java.lang.NoClassDefFoundError错误解决 - xwdreamer的专栏 - 博客频道 - CSDN.NET

    csdn.net | 12 months ago
    java.lang.NoClassDefFoundError: HelloWorld (wrong name: org/xuwei/HelloWorld)
  2. 0

    Since 1.1.7, LS introduce introduced a flusher thread so as to flush the last event in multiline filter. However, the flusher would bring in unexpected event break. For example, supposing we have below log to tail: {code} Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld (wrong name: org/xuwei/HelloWorld) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: HelloWorld. Program will exit. {code} When first 4 rows is loaded into multiline filter and flusher runs, the event will be break down into two events: {code} Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld (wrong name: org/xuwei/HelloWorld) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) {code} {code} at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: HelloWorld.  Program will exit. {code} Original code: {code:title=filterworker.rb|borderStyle=solid} @flusher = Thread.new { interval(5) { flusher } } {code} {code:title=multiline.rb|borderStyle=solid} # Flush any pending messages. This is generally used for unit testing only. public def flush events = [] @pending.each do |key, value| value.uncancel events << value end # pending messages as well as fresh messages were flushed @pending.clear return events end # def flush {code} PS: I'm currently using below code in my instance. The idea is to, in the end of every flush take a snapshot of the pending messages in multiline filter (1st flush won't flush any message), in the next flush if a message is unchanged, then we can flush it safely. {code:title=multiline.rb|borderStyle=solid} public def initialize(config = {}) ... @capture = Hash.new end # def initialize # Flush pending messages public def flush events = [] @pending.each do |key, value| # flushes keys that're not changed in last 5s next unless value == @capture[key] @pending.delete(key) value.uncancel events << value end # capture current keys in @pending @capture = @pending.clone return events end # def flush {code}

    JIRA | 4 years ago | luoxinwei1
    java.lang.NoClassDefFoundError: HelloWorld (wrong name: org/xuwei/HelloWorld)
  3. 0

    Since 1.1.7, LS introduce introduced a flusher thread so as to flush the last event in multiline filter. However, the flusher would bring in unexpected event break. For example, supposing we have below log to tail: {code} Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld (wrong name: org/xuwei/HelloWorld) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: HelloWorld. Program will exit. {code} When first 4 rows is loaded into multiline filter and flusher runs, the event will be break down into two events: {code} Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld (wrong name: org/xuwei/HelloWorld) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) {code} {code} at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: HelloWorld.  Program will exit. {code} Original code: {code:title=filterworker.rb|borderStyle=solid} @flusher = Thread.new { interval(5) { flusher } } {code} {code:title=multiline.rb|borderStyle=solid} # Flush any pending messages. This is generally used for unit testing only. public def flush events = [] @pending.each do |key, value| value.uncancel events << value end # pending messages as well as fresh messages were flushed @pending.clear return events end # def flush {code} PS: I'm currently using below code in my instance. The idea is to, in the end of every flush take a snapshot of the pending messages in multiline filter (1st flush won't flush any message), in the next flush if a message is unchanged, then we can flush it safely. {code:title=multiline.rb|borderStyle=solid} public def initialize(config = {}) ... @capture = Hash.new end # def initialize # Flush pending messages public def flush events = [] @pending.each do |key, value| # flushes keys that're not changed in last 5s next unless value == @capture[key] @pending.delete(key) value.uncancel events << value end # capture current keys in @pending @capture = @pending.clone return events end # def flush {code}

    JIRA | 4 years ago | luoxinwei1
    java.lang.NoClassDefFoundError: HelloWorld (wrong name: org/xuwei/HelloWorld)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Current cucumber-scala 1.0.14 doesn't work with the newest Scala 2.10.0-RC1 release

    GitHub | 4 years ago | skipoleschris
    java.lang.NoClassDefFoundError: scala/runtime/AbstractFunction1$mcZL$sp
  6. 0

    Doppio doesn't check full classname of main class

    GitHub | 4 years ago | jvilk
    java.lang.NoClassDefFoundError: Chatterbot (wrong name: classes/demo/Chatterbot)

  1. andyglick 2 times, last 6 days ago
  2. bamboomy 1 times, last 2 weeks ago
  3. Handemelindo 4 times, last 2 months ago
  4. Hronom 1 times, last 2 months ago
  5. batwalrus76 6 times, last 3 months ago
8 more registered users
87 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NoClassDefFoundError

    HelloWorld (wrong name: org/xuwei/HelloWorld)

    at java.lang.ClassLoader.defineClass1()
  2. Java RT
    ClassLoader.loadClass
    1. java.lang.ClassLoader.defineClass1(Native Method)
    2. java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    3. java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    4. java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    5. java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    6. java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    7. java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    8. java.security.AccessController.doPrivileged(Native Method)
    9. java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    10. java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    11. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    12. java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    12 frames