Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] Queries from a newbie..


Hi Sathya,

You've just discovered a new bug!  The jar has not been built correctly - the Eclipse export wizard is using the javac ant task to build the jar, which means that the .aj file is not compiled and is copied over as a resource instead.  The workaround for this is to build the jar file manually from the contents of the bin directory.

I will raise a bug on Bugzilla for a new 'Export JAR' wizard with AspectJ support and look at implementing it as soon as possible.  

Sian January





Sathya <imsathya@xxxxxxxxx>
Sent by: aspectj-dev-admin@xxxxxxxxxxx

13/08/2004 12:11

Please respond to
aspectj-dev

To
aspectj-dev@xxxxxxxxxxx
cc
Subject
RE: [aspectj-dev] Queries from a newbie..





> You don't. You deploy the class-files and they are
> purely Java compliant.

By "class" files, do you mean the .aj files as such ?
Here is what I did :

1. Created aspect classes and built the project
("Build Project" option of course)
2. Export my project from Eclipse as a jar

The contents of the jar (just sample) :

sathya$ jar -tvf PersonBeanWithAspect.jar
   25 Fri Aug 13 16:32:42 IST 2004
META-INF/MANIFEST.MF
 1437 Fri Aug 13 16:32:14 IST 2004
test/ejb/PersonBean.class
 1991 Fri Aug 13 16:32:14 IST 2004
test/ejb/TestPersonBean.class
 1212 Fri Aug 13 16:27:24 IST 2004
test/ejb/AspectBeforeFind.aj
...

3. I deploy this jar now and start up my server. When
the event occurs I get this error :

java.lang.NoClassDefFoundError:
test/ejb/AspectBeforeFind
       at
test.ejb.TestPersonBean.getFirstNameWithID(TestPersonBean.java:186)
       at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at
java.lang.reflect.Method.invoke(Method.java:324)

But when I go to command line, and compile the aspect
class with ajc, I get the .class file which now works
fine when deployed.

Do I need to change any preferences ? In the  AspectJ
preferences in Eclipse, I also tried checking the "No
weaving" option which is described as generating class
files. But I dont see any class files being generated.


Pl help me out.

Thanks so much,
Sathya

=====
Happiness is purely a state of mind that is in no way related to external factors.


                                 
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-dev


Back to the top