Bug 137235 - AJC can't resolve non-jar classpath entries
Summary: AJC can't resolve non-jar classpath entries
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 1.5.2   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-18 11:17 EDT by Emanuel Bulic CLA
Modified: 2012-04-03 16:09 EDT (History)
1 user (show)

See Also:


Attachments
aspectj-maven-plugin created this ajc argument file. notice one of the classpath entries is a .bndl file (5.53 KB, text/plain)
2006-04-18 11:23 EDT, Emanuel Bulic CLA
no flags Details
Multi-module patch to fix & test this (54.20 KB, patch)
2006-05-02 22:17 EDT, Ron Bodkin CLA
no flags Details | Diff
Binary files needed by the patch for test data. (7.66 KB, application/zip)
2006-05-02 22:21 EDT, Ron Bodkin CLA
no flags Details
Weaver module patch (2.64 KB, patch)
2006-05-03 11:40 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff
Util module patch (2.51 KB, patch)
2006-05-03 11:41 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff
Patch for tests module (17.47 KB, patch)
2006-05-03 11:43 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff
Testing module patch (5.20 KB, patch)
2006-05-03 11:44 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff
Taskdefs module patch (2.67 KB, patch)
2006-05-03 11:45 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff
org.aspectj.ajdt.core module patch (8.19 KB, patch)
2006-05-03 11:47 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff
loadtime module patch (2.45 KB, patch)
2006-05-03 11:48 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff
AJDE module patch (3.64 KB, patch)
2006-05-03 11:48 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emanuel Bulic CLA 2006-04-18 11:17:10 EDT
I am currently using the maven aspectj plugin, and all of my jar artifacts are are re-named to .bndl (for reasons beyond my control).  Using the aj compiler, I am getting errors when using these .bndl artifacts in the classpath.  I would expect that ajc would behave consistently with javac, and not make a distinction solely based on the extension of the classpath entry.  Furthermore, I should be able to name an output directory "classes.jar", and be able to use it as a classpath entry.  The message "directory classpath entry does not exist" is inaccurate, since the .bndl entry isn't a directory and it does exist.

C:\NGST\app\java\util\maven-target>ajc -verbose @classesbuilddef.lst

zipfile classpath entry does not exist: C:\j2sdk1.4.2_10\jre\lib\i18n.jar

directory classpath entry does not exist: C:\j2sdk1.4.2_10\jre\classes

directory classpath entry does not exist: C:\NGST\app\java\logging\maven-target\logging-1.20-SNAPSHOT.bndl

compiling C:\NGST\app\java\util\src\com\dcx\NGST\beancontainer\BeanFactoryLevel.java

compiling C:\NGST\app\java\util\src\com\dcx\NGST\core\exceptions\UnSupportedMethodException.java
Comment 1 Emanuel Bulic CLA 2006-04-18 11:23:32 EDT
Created attachment 38800 [details]
aspectj-maven-plugin created this ajc argument file.  notice one of the classpath entries is a .bndl file
Comment 2 Ron Bodkin CLA 2006-05-02 11:28:59 EDT
In a related problem, the WeavingAdaptor won't accept jars with nonstandard extensions, e.g., here's a simple example.

set CLASSPATH=odd.bndl;ren.bndl;%CLASSPATH%
java OddJar
Hello Java

set ASPECTPATH=odd.bndl;ren.bndl
aj OddJar
error bad aspect library: 'C:\devel\scratch\oddJar\odd.bndl'
Error occurred during initialization of VM
java.lang.Error: org.aspectj.bridge.AbortException: bad aspect library: 'C:\deve
l\scratch\oddJar\odd.bndl'

public class OddJar {
    public static void main(String args[]) {
        System.out.println("Hello "+getName());
    }
    public static String getName() { return "Java"; }
}

public aspect Rename {
    String around() : execution(* getName()) {
        return "AspectJ";
    }
}
Comment 3 Ron Bodkin CLA 2006-05-02 22:17:44 EDT
Created attachment 40157 [details]
Multi-module patch to fix & test this

This is an Eclipse multi-project patch (across several of the AspectJ modules) with all the changes I made to support jars/zips with nonstandard extensions and directories ending in .jar. This includes a variety of tests including unit, integration, and load-time weaving tests. It also includes some binary files (copies of existing files that were named foo.jar or in top-level directories). I tested applying the patch and unfortunately it corrupts the jar files, causing tests to break. I will attach the binary files that break to be copied over as a zip file in a separate attachment.

To allow testing this, I added support for a special variable $sandbox that can be used in classpaths for compile & run specs.
Comment 4 Ron Bodkin CLA 2006-05-02 22:21:15 EDT
Created attachment 40158 [details]
Binary files needed by the patch for test data.
Comment 5 Andrew Clement CLA 2006-05-03 06:28:51 EDT
*sigh* - won't apply for me.  patches only tests/util/weaver even though I can see it contains changes to other modules.
Comment 6 Andrew Clement CLA 2006-05-03 06:42:01 EDT
what level  of eclipse did you create the patch on Ron? I'm attempting to apply it on 3.2RC2
Comment 7 Ron Bodkin CLA 2006-05-03 11:10:59 EDT
I created the patch using 3.2 RC1. Are you serious: it doesn't work on RC2?!?! It is using the Eclipse multi-project patch format. I could resubmit as a bunch of module-level patches...
Comment 8 Andrew Clement CLA 2006-05-03 11:38:13 EDT
it may not be the fact that i'm on RC2, it could be something else - i dont use workspace level patches very often. All i know is it patched just 3 modules and not the rest with no indication as to why...
Comment 9 Ron Bodkin CLA 2006-05-03 11:40:51 EDT
Created attachment 40225 [details]
Weaver module patch
Comment 10 Ron Bodkin CLA 2006-05-03 11:41:50 EDT
Created attachment 40226 [details]
Util module patch
Comment 11 Ron Bodkin CLA 2006-05-03 11:43:50 EDT
Created attachment 40227 [details]
Patch for tests module
Comment 12 Ron Bodkin CLA 2006-05-03 11:44:34 EDT
Created attachment 40228 [details]
Testing module patch
Comment 13 Ron Bodkin CLA 2006-05-03 11:45:34 EDT
Created attachment 40229 [details]
Taskdefs module patch
Comment 14 Ron Bodkin CLA 2006-05-03 11:47:19 EDT
Created attachment 40230 [details]
org.aspectj.ajdt.core module patch
Comment 15 Andrew Clement CLA 2006-05-03 11:48:02 EDT
thanks ron!  You could have put them together in a zip tho ;)
Comment 16 Ron Bodkin CLA 2006-05-03 11:48:13 EDT
Created attachment 40231 [details]
loadtime module patch
Comment 17 Ron Bodkin CLA 2006-05-03 11:48:57 EDT
Created attachment 40233 [details]
AJDE module patch
Comment 18 Ron Bodkin CLA 2006-05-03 11:53:47 EDT
Ok, next time I will put them in a zip. Note that the binary files needed still has to be unzipped to create/modify files in the workspace so that all the tests will pass.
Comment 19 Andrew Clement CLA 2006-05-04 03:24:31 EDT
patches committed. I hope they are ok on Linux and the Mac ... I'll wait for Adrian to scream.
Comment 20 Adrian Colyer CLA 2006-05-04 03:49:18 EDT
All clear on the mac :)
Comment 21 Andrew Clement CLA 2006-05-04 08:06:46 EDT
fix available.