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

JIRA | luoxinwei1 | 4 years ago
  1. 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)
  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

    ClassNotFoundException for GWT 2.5-RC2

    GitHub | 4 years ago | duns
    java.lang.NoClassDefFoundError: com/google/gwt/core/ext/GeneratorExt
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    What NoClassDefFoundError and wrong name means to JPA?

    Stack Overflow | 3 years ago | huahsin68
    java.lang.NoClassDefFoundError: WEB-INF/classes/org/huahsin/WebEngineering/Role (wrong name: org/huahsin/WebEngineering/Role)
  6. 0

    Eclipse plugin with JOGL - ClassNotFoundException

    Stack Overflow | 5 years ago | asarium
    java.lang.NoClassDefFoundError: com/jogamp/common/type/WriteCloneable

  1. davidvanlaatum 1 times, last 5 months ago
  2. DannyDBag 12 times, last 6 months ago
11 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.defineClass
    1. java.lang.ClassLoader.defineClass1(Native Method)
    2. java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    3. java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    3 frames