ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29978] - No way to run Apt processor for JDK 1.5
Date Mon, 11 Apr 2005 21:19:09 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29978>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29978


mortench2004@yahoo.dk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Additional Comments From mortench2004@yahoo.dk  2005-04-11 23:18 -------
I discovered some problems/bugs that are probably linked to
changes in the brand new JDK 1.5.0_02. I think I manged to fix one
problem but have another problem (see 2 below) that I hope someone can
help with.

The ant task for apt does NOT work with 1.5.0_02 because:
1) First of all, the apt method entry point appear to have changed.
Javap on com.sun.tools.apt.Main gives:
public class com.sun.tools.apt.Main extends java.lang.Object{
   public com.sun.tools.apt.Main();
   public static void main(java.lang.String[]);
   public static int process(java.lang.String[]);
   public static int process(java.io.PrintWriter, java.lang.String[]);
   public static int process(com.sun.mirror.apt.AnnotationProcessorFactory, jav
a.lang.String[]);
   public static int process(com.sun.mirror.apt.AnnotationProcessorFactory, jav
a.io.PrintWriter, java.lang.String[]);
   static {};
}

Note that there is no method called "compile" that is used in
the ANT task. There is a method "process" that appears to be the one
to use instead. I tried to replace this in the code and than ran into
the next problem below.

2) APT complains about missing the com/sun/mirror/apt/AnnotationProcess
orFactory class even though tools.jar IS on the classpath, even if it
can indeed find the main entry point class also in tools.jar AND even
if the AnnotationProcess
orFactory class is verified to be also present (I can see it using
javap so it has not disappeared). This strange classpath error can be
seen below:

     [apt] Compiling 1 source file
     [apt] An exception has occurred in apt (1.5.0_02). Please file a bug at th
e Java Developer Connection (http://java.sun.com/webapps/bugreport)  after check
ing the Bug Parade for duplicates. Include your program and the following diagno
stic in your report.  Thank you.
     [apt] java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcess
orFactory
     [apt]     at java.lang.ClassLoader.defineClass1(Native Method)
     [apt]     at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
     [apt]     at java.security.SecureClassLoader.defineClass(SecureClassLoader
.java:124)
     [apt]     at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
     [apt]     at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
     [apt]     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
     [apt]     at java.security.AccessController.doPrivileged(Native Method)
     [apt]     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     [apt]     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     [apt]     at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
     [apt]     at com.sun.tools.apt.comp.Apt.main(Apt.java:287)
     [apt]     at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java
:458)
     [apt]     at com.sun.tools.apt.main.Main.compile(Main.java:1075)
     [apt]     at com.sun.tools.apt.main.Main.compile(Main.java:938)
     [apt]     at com.sun.tools.apt.Main.processing(Main.java:95)
     [apt]     at com.sun.tools.apt.Main.process(Main.java:43)
     [apt]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [apt]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
     [apt]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
     [apt]     at java.lang.reflect.Method.invoke(Method.java:585)
     [apt]     at org.apache.tools.ant.taskdefs.compilers.AptCompilerAdapter.ex
ecute(Unknown Source)
     [apt]     at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:936)
     [apt]     at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:758)
     [apt]     at org.apache.tools.ant.taskdefs.Apt.execute(Unknown Source)
     [apt]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
     [apt]     at org.apache.tools.ant.Task.perform(Task.java:364)
     [apt]     at org.apache.tools.ant.Target.execute(Target.java:341)
     [apt]     at org.apache.tools.ant.Target.performTasks(Target.java:369)
     [apt]     at org.apache.tools.ant.Project.executeTarget(Project.java:1214)

     [apt]     at org.apache.tools.ant.Project.executeTargets(Project.java:1062
)
     [apt]     at org.apache.tools.ant.Main.runBuild(Main.java:673)
     [apt]     at org.apache.tools.ant.Main.startAnt(Main.java:188)
     [apt]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
     [apt]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

Hope someone can fix this.

P.S Note the brand new APT features in 1.5.0_02 like "
-XclassesAsDecls          " that treat both class and source files as
declarations to process. It would be nice if such options can somehow
be passed to the ANT task as well.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message