Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] partially OT, AJDT & RAD

Hello Matt,
    i am gettin gback  so late after holidays.... still couldn't get 2 aspects for 2 different projects to intercommunicate...
i really appreciate if you could try to test this 2 aspects on 2 different projects......
 
here's the situation..
i have 2 projects, ngenEJB and ngenWeb.
both of them are aspectJ enabled.
i have written one aspect in ngenWeb and one aspect in ngenEJB project
 
what i need is to have the aspect in ngenEJB to call a method on the aspect in ngenWeb.
 
I have tried to
- set the aspectPath of ngenEJB to      ngenWeb\sources\com.myaspect
- set the aspectInPath of ngenEJB to   ngenWeb\WEB-INF\classes\com (since i have also other packages under classes)
 
but still when i compile my ngenEJB aspect, i got a  com.myaspect could not be resolved....
 
i attach both aspects, though the real prblem i suspect are the settings....
i am using RAD 6.0 wtih AJDT 1.2.0
 
would you mind giving me little help?
 
thanx in advance and regards
   marco
 
 
 


 
On 8/20/05, Matt Chapman <mpchapman@xxxxxxxxx> wrote:
Hi Marco,

Sorry to hear things aren't going smoothly for you.
You probably want to use "ngenWeb/Webcontent/WEB-INF/classes" as the
path (without the "com" at the end) if that is the root of the class
path folder.
To refer to aspects from the other project, rather than just apply
them, you also need to make them available on the regular classpath.
If you still have problems, please create test projects representative
of your setup and attach them to a bugzilla report, and we can then
try to get them working ourselves.

Regards,

Matt.

On 19/08/05, Marco Mistroni < mmistroni@xxxxxxxxx> wrote:
> Hello Matt,
>   thanks again for your suggestion.... it's still not working :(
> i m little bit frustrated..... here's situation
> - i have ngenEJB project (Aspectj-enabled project) which contains MyAspect
> - i have ngenWeb project (Aspectj-enabled project) which contains LoginAspect
>
> both aspects work fine on their own... but now i wanted MyAspect to
> get the username from LoginAspect
>
> So, what i did was to set teh AspectJ AspectPath on the ngenEJB
> project to include ngenWeb/Webcontent/WEB-INF/classes/com directory,
> which is hte class directory of the ngenweb project.
>
> when i tried to compile ngenEJB project i got an error in MyAspect
> saying that  'hte import  com.myapp.aspect.ngenweb package cannot be
> resolved.
> That is the package of my aspect in my ngenWeb project...
>
> Could you tell me what could possibly be wrong?
>
> thanks in advance and regards
>   marco
>
>
>
> On 8/18/05, Matt Chapman < mpchapman@xxxxxxxxx> wrote:
> > I guess the classes need to end up in the WEB-INF\classes folder of a
> > web project.
> > So you can either copy them across, or better why not make the marcoWeb project
> > an AspectJ project, and use the aspectpath setting? In Eclipse terms,
> > the "convert to AspectJ project" action *adds* the AspectJ nature to
> > the list of natures associated with the project, so this doesn't stop
> > it also being a web project.
> >
> > Regards,
> >
> > Matt.
> >
> > On 18/08/05, Marco Mistroni <mmistroni@xxxxxxxxx > wrote:
> > > Hello Matt,
> > >  thanks for the reply..
> > > > working exactly? Note that the woven classes go in the output folder
> > > > of the marcoAspect project, so they won't get automatically deployed
> > > > to the app server. The other possible arrangement would be to make
> > >
> > > this is the problem i suppose, because in the 'problem window' i can
> > > see the classes that are going to get woven.
> > >
> > > How can i deploy then my project on the server? when i created it
> > > there was no option to associate it with an .EAR...
> > >
> > > could you help me again?
> > >
> > > thanks in advance and regards
> > >  marco
> > >
> > >
> > >
> > > > marcoWeb an AspectJ project, then use the aspectpath setting to get
> > > > the aspects from the other project.
> > > >
> > > > Regards,
> > > >
> > > > Matt.
> > > >
> > > > On 18/08/05, Marco Mistroni < mmistroni@xxxxxxxxx> wrote:
> > > > > Hello Matt,
> > > > >   sorry, i read that article and even this one but i cannot manage to
> > > > > get my aspects at work.
> > > > > I couldn't manage to understand the difference between AspectJ
> > > > > AspectPath and AspectJ InPath
> > > > >
> > > > > I have created a marcoAspect aspectJ PROJECT which contains 1 aspect.
> > > > > that aspect intercepts calls to a mehtod of a class in my marcoWeb project.
> > > > >
> > > > > marcoWeb is NOT an AspectJ project.
> > > > >
> > > > > what are the settings that i need to do in the marcoAspect project?
> > > > > What i have done so far (which is not working) is to set the
> > > > > marcoAspect project  AspectInPath to include the  WEB-INF\classes of
> > > > > my marcoWeb project.
> > > > >
> > > > > In the Inpath, do ihave to point to directory for sourcecode or for class files?
> > > > >
> > > > > thanks in advance and regards
> > > > >  marco
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 8/16/05, Matt Chapman <mpchapman@xxxxxxxxx> wrote:
> > > > > > Yes, in general a project dependency is not sufficient to control
> > > > > > weaving across projects - you need to use the inpath, aspectpath,
> > > > > > and/or outjar settings.
> > > > > >
> > > > > > Maybe this article is more useful (eventually I'll write a useful one! ;-)
> > > > > > http://www.ibm.com/developerworks/java/library/j-aopwork9/
> > > > > > See the section on "Managing multiple projects". It shouldn't matter
> > > > > > that your projects are EJB and Web projects - if they are
> > > > > > AspectJ-enabled, you can still use the aspectpath setting to weave in
> > > > > > the aspects from the appropriate project.
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > Matt.
> > > > > >
> > > > > > On 16/08/05, Marco Mistroni < mmistroni@xxxxxxxxx> wrote:
> > > > > > > Hello Matt,
> > > > > > >    i htink i have read it already...unfortunately that article just convert
> > > > > > > an existing project to an aspectJ Project
> > > > > > >
> > > > > > > > Could you explain a bit more about your setup? Why not create your
> > > > > > > > aspects in your EJB and Web projects, instead of in a separate AspectJ
> > > > > > > > project?
> > > > > > >
> > > > > > > yes, i can, but it won't help me.
> > > > > > > See, i have to write an aspect that after intercepting certain
> > > > > > > methods, logs some
> > > > > > > data including the user which is logged in.,
> > > > > > > the logged in user is not passed down from the Web to the 'Backend'
> > > > > > > tier, and thus i cannot access it (unless i modify all methods to
> > > > > > > include a new parameters, but if i am correct AOP was made to solve
> > > > > > > this problems).
> > > > > > >
> > > > > > > so i have defined an aspect in the web project which intercepts
> > > > > > > methods where user logs in.
> > > > > > > and i thought that my EJB aspect could retrieve teh user from my Web aspect...
> > > > > > > Possible, yes, but i'll have to make a dependency between my web
> > > > > > > project and my EJB project (where there is already a dependency
> > > > > > > between web and EJB).
> > > > > > > so i thought that if i can creata an AspectJ project, and write all my
> > > > > > > aspect there, then i won't need to create useless dependencies.
> > > > > > > the only problem is that my aspect defined in my aspectj seems not get
> > > > > > > 'woven' with projects that they refer to..
> > > > > > > I have read that i need to change my aspectJ build path or something,
> > > > > > > but i still cannot get it to work..
> > > > > > >
> > > > > > > do you have any suggestions?
> > > > > > >
> > > > > > > thanks and regards
> > > > > > >  marco
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > >
> > > > > > > > Matt.
> > > > > > > >
> > > > > > > > On 16/08/05, Marco Mistroni < mmistroni@xxxxxxxxx> wrote:
> > > > > > > > > hello,
> > > > > > > > >   i am developing apps using RAD from IBM.
> > > > > > > > > recently i installed AJDT plugins to write some aspects.
> > > > > > > > > i have different aspects for both my EJB project and other WEB
> > > > > > > > > projects.. and some of them needs to communicate, so i htought to
> > > > > > > > > create an AspectJ project.
> > > > > > > > > the only problem is hta ti cannot add this project to my EAR.... or
> > > > > > > > > even deploy it..
> > > > > > > > >
> > > > > > > > > anyone could tell me how to do it?
> > > > > > > > >
> > > > > > > > > sorry for the OT and thanks in advance for the reply
> > > > > > > > >  Marco
> > > > > > > > > _______________________________________________
> > > > > > > > > ajdt-dev mailing list
> > > > > > > > > ajdt-dev@xxxxxxxxxxx
> > > > > > > > > https://dev.eclipse.org/mailman/listinfo/ajdt-dev
> > > > > > > > >
> > > > > > > > _______________________________________________
> > > > > > > > ajdt-dev mailing list
> > > > > > > > ajdt-dev@xxxxxxxxxxx
> > > > > > > > https://dev.eclipse.org/mailman/listinfo/ajdt-dev
> > > > > > > >
> > > > > > > _______________________________________________
> > > > > > > ajdt-dev mailing list
> > > > > > > ajdt-dev@xxxxxxxxxxx
> > > > > > > https://dev.eclipse.org/mailman/listinfo/ajdt-dev
> > > > > > >
> > > > > > _______________________________________________
> > > > > > ajdt-dev mailing list
> > > > > > ajdt-dev@xxxxxxxxxxx
> > > > > > https://dev.eclipse.org/mailman/listinfo/ajdt-dev
> > > > > >
> > > > > _______________________________________________
> > > > > ajdt-dev mailing list
> > > > > ajdt-dev@xxxxxxxxxxx
> > > > > https://dev.eclipse.org/mailman/listinfo/ajdt-dev
> > > > >
> > > > _______________________________________________
> > > > ajdt-dev mailing list
> > > > ajdt-dev@xxxxxxxxxxx
> > > > https://dev.eclipse.org/mailman/listinfo/ajdt-dev
> > > >
> > > _______________________________________________
> > > ajdt-dev mailing list
> > > ajdt-dev@xxxxxxxxxxx
> > > https://dev.eclipse.org/mailman/listinfo/ajdt-dev
> > >
> > _______________________________________________
> > ajdt-dev mailing list
> > ajdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/ajdt-dev
> >
> _______________________________________________
> ajdt-dev mailing list
> ajdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ajdt-dev
>
_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ajdt-dev

/*
 * Created on 06-Sep-2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.waersystems.ejb.aspectj;




/**
 * @author Marco
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public aspect EJBAspect {
	
	pointcut traceEJB() :
		call (* com.waersystems.ejb.user.userdetails.UserInfoServerBean.getUser(..));
	
	after() returning: traceEJB() {
		String user = com.waersystems.ngenweb.aspectj.LoginAspect.aspectOf().getUser();
		System.err.println("---- EJBAspect. got User:" + user);
	}
	

}
/*
 * Created on 06-Sep-2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.waersystems.ngenweb.aspectj;

/**
 * @author Marco
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public aspect LoginAspect {
	
	String user = "TestUser";
	
	pointcut traceLogin(String username, String password) :
		call (* com.waersystems.ngenweb.login.LoginAction.login(String,String))
			&& args(username, password);
	
	after(String username, String password) returning : traceLogin(username,password) {
		user = username;
		System.err.println("Got username:" + username);
	}

	
	public String getUser() {
		return user;
	}
	
}

Back to the top