Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328099

Summary: AspectJ LTW should honor the ProtectionDomain
Product: [Tools] AspectJ Reporter: Fredrik Lindskog <fredrik>
Component: LTWeavingAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: aclement, fredrik
Version: 1.6.9   
Target Milestone: 1.6.12   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Small program to reproduce the problem none

Description Fredrik Lindskog CLA 2010-10-19 04:11:18 EDT
Build Identifier: 

We are having problem running the AspectJ LTW whith signed jars.
It appears to be that the LTW is not honoring the ProtectionDomain when creating the inner classes of the woven class, i.e. $AjcClosure1.

Reproducible: Always

Steps to Reproduce:
Instructions on how to reproduce the problem with the attached zip-file
Prerequisites:
- Maven 2 installed
- java should be on the path

1. Compile and package
> mvn clean package

2. Run without signing the jar
> mvn exec:exec

==> "pre...Foo.bar()...post" is written on stdout.

3. Sign the jar
> mvn jarsigner:sign

4. Run again
> mvn exec:exec

==> ClassNotFoundException!!!
Comment 1 Fredrik Lindskog CLA 2010-10-19 04:14:03 EDT
Created attachment 181157 [details]
Small program to reproduce the problem

A small maven project with code to reproduce the problem.
Please read the README file for instructions.
Comment 2 Fredrik Lindskog CLA 2010-10-20 02:23:19 EDT
Just to be clear: This is preventing us to use the AspectJ, since we're using signed jars.
Comment 3 Andrew Clement CLA 2011-05-02 14:43:28 EDT
fixed!  thanks for the great test program.  The protection domain used for a class that is about to be defined is also used for generated classes (generated during the weaving of that type).