Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4986512

(cl) NoClassDefFoundError thrown when loading classes with names containing '/'

XMLWordPrintable

      ###@###.### 2004-01-30

      J2SE Version (please include all output from java -version flag):
       java version "1.5.0-beta"
       Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32)
       Java HotSpot(TM) Client VM (build 1.5.0-beta-b32, mixed mode)

      Does this problem occur on J2SE 1.3, 1.4 or 1.4.1? Yes / No (pick one)
       No, works fine with 1.4.2

      Bug Description:
        Customer has some code that generates classes on the fly, and loads them
        (its a compiler for a scripting language).

        It works fine in JDK 1.4.2, but in 1.5.0, when it tries to load the
        newly generated class, it throws errors like the following:

      java.lang.NoClassDefFoundError: IllegalName: factor/compiler/write__143
              at java.lang.ClassLoader.preDefineClass(ClassLoader.java:459)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:598)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
              at factor.FactorWordDefinition$SimpleClassLoader._defineClass(FactorWordDefinition.java:257)
              at factor.FactorWordDefinition.compile(FactorWordDefinition.java:194)
              at factor.FactorWord.compile(FactorWord.java:74)
              at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:494)
              at factor.FactorJava.jinvoke(FactorJava.java:439)
              at factor.FactorPrimitive$P_jinvoke.eval(FactorPrimitive.java:365)
              at factor.FactorInterpreter.eval(FactorInterpreter.java:329)
              at factor.FactorInterpreter.run(FactorInterpreter.java:189)
              at factor.FactorInterpreter.runBootstrap(FactorInterpreter.java:150)
              at factor.FactorInterpreter.init(FactorInterpreter.java:118)
              at factor.FactorInterpreter.main(FactorInterpreter.java:76)

      Step to Reproduce:
        Hard to get a narrow down test case. just attached a zip file which
        contains 143 automatically generated classes. They all work fine with
        1.4.2, but in 1.5 they all fail to load with an error; check the above
        stack traces.


      ###@###.### 2004-02-03

      Test case attached - ASMTest.jar.

      run java ASMTest and get the following error:

      Exception in thread "main" java.lang.NoClassDefFoundError: IllegalName: foo/bar/baz/quux
              at java.lang.ClassLoader.preDefineClass(ClassLoader.java:459)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:598)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
              at ASMTest$SimpleClassLoader._defineClass(ASMTest.java:46)
              at ASMTest.main(ASMTest.java:30)


      but, works fine with 1.4.2.

            iris Iris Clark
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: