-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b25
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2123224 | 5.0u4 | Joe Darcy | P3 | Resolved | Fixed | b01 |
The following results in a uncaught error from apt:
mkdir foo
touch foo/bar.class
apt -factory foo/bar
An exception has occurred in apt (1.5.0_01). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NoClassDefFoundError: IllegalName: foo/bar
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:476)
at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.sun.tools.apt.comp.Apt.main(Apt.java:287)
at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:458)
at com.sun.tools.apt.main.Main.compile(Main.java:1075)
at com.sun.tools.apt.main.Main.compile(Main.java:938)
at com.sun.tools.apt.Main.processing(Main.java:95)
at com.sun.tools.apt.Main.process(Main.java:43)
at com.sun.tools.apt.Main.main(Main.java:34)
The cause is the catch blocks for
AnnotationProcessorFactory factory =
(AnnotationProcessorFactory) (aptCL.loadClass(factoryName).newInstance());
list.add(factory);
do not check for the NoClassDefFoundError that can be thrown by the classloader.
mkdir foo
touch foo/bar.class
apt -factory foo/bar
An exception has occurred in apt (1.5.0_01). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NoClassDefFoundError: IllegalName: foo/bar
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:476)
at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.sun.tools.apt.comp.Apt.main(Apt.java:287)
at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:458)
at com.sun.tools.apt.main.Main.compile(Main.java:1075)
at com.sun.tools.apt.main.Main.compile(Main.java:938)
at com.sun.tools.apt.Main.processing(Main.java:95)
at com.sun.tools.apt.Main.process(Main.java:43)
at com.sun.tools.apt.Main.main(Main.java:34)
The cause is the catch blocks for
AnnotationProcessorFactory factory =
(AnnotationProcessorFactory) (aptCL.loadClass(factoryName).newInstance());
list.add(factory);
do not check for the NoClassDefFoundError that can be thrown by the classloader.
- backported by
-
JDK-2123224 apt fails to catch errors thrown by a ClassLoader when loading a factory
- Resolved