Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » PDE Eclipse Application and Equinox Weaving AspectJ(Running aspects with bundles)
PDE Eclipse Application and Equinox Weaving AspectJ [message #1759146] Thu, 06 April 2017 23:31 Go to next message
Daniel San Martín is currently offline Daniel San MartínFriend
Messages: 21
Registered: October 2012
Junior Member
Hello,

I am trying to run aspects when some methods are called by the application. I followed a lot of tutorials spread in the internet but they are too old so I do not know if they are still correct.

Ok this is what I have in my project

index.php/fa/28995/0/

Where RE and UI are eclipse applications developed with SWT. So, to lunch the application the user chose a java project with the second button of the mouse and run my application by means a menu. The utils project is a plug-in that contains my aspects and target application has all bundles needed in order to execute properly my application.

The manifest of utils (containing the aspects) is the following:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Utils
Bundle-SymbolicName: br.ufscar.SaS.utils
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: br.ufscar.sas.utils.Activator
Require-Bundle: org.eclipse.core.runtime,
 org.aspectj.runtime,
 org.eclipse.emf.ecore
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: br.ufscar.sas.aspects;aspects="AddReturn"
Eclipse-SupplementBundle: br.ufscar.sas.createKDM
Bundle-ClassPath: lib/BaseX853.jar,


The aspect that I am trying to execute is the following:

package br.ufscar.sas.aspects;
import org.eclipse.emf.ecore.resource.Resource;

public aspect AddReturn {

	pointcut callCreateKDM(): call(private void createKDMFile(Resource, String));
	
	after() : callCreateKDM() {
		System.out.println("It works!");
	}
}


And the code that I want to crosscut is the following :

package br.ufscar.sas.createKDM;
...
...
//Generates the KDM file
		try 
		{
			createKDMFile(javaResource, javaProjectName);
		} catch (IOException e) {e.printStackTrace();}


I performed all the configurations needed, for example,

index.php/fa/28996/0/

and

index.php/fa/28997/0/

Then I try to run it, and in the console these messages are shown:

index.php/fa/28998/0/

So I think all is correct.

Then I run the application:

index.php/fa/28999/0/

And the message "It works" must appear after the method is called, but nothing occurs,

Please help me because I am stuck in this several days.

Thank you,

Daniel.
  • Attachment: 1.png
    (Size: 18.44KB, Downloaded 96 times)
  • Attachment: 2.png
    (Size: 44.12KB, Downloaded 96 times)
  • Attachment: 3.png
    (Size: 28.43KB, Downloaded 110 times)
  • Attachment: 4.png
    (Size: 19.17KB, Downloaded 95 times)
  • Attachment: 5.png
    (Size: 75.60KB, Downloaded 101 times)
Re: PDE Eclipse Application and Equinox Weaving AspectJ [message #1759212 is a reply to message #1759146] Sat, 08 April 2017 03:15 Go to previous message
Daniel San Martín is currently offline Daniel San MartínFriend
Messages: 21
Registered: October 2012
Junior Member
Hello,

I got it!, it was a stupid error, in Eclipse-SupplementBundle, I wrote the package name instead of the bundle Razz

Thank you!.
Previous Topic:Odd StackMap error with 1.8.9 and wrapping new calls
Next Topic:Aspect not getting detected by Apache Tomcat 8.5.x
Goto Forum:
  


Current Time: Sat Dec 16 20:43:24 GMT 2017

Powered by FUDForum. Page generated in 0.01884 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software