Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ errors in plugin projects.

Hi Matthew,

Thank you for your response. After reading your response, I realize that it
is not exactly an AspectJ problem since project A only needs classes from
project B. However, I am still not able to resolve this problem. This is
what I observed:

- The manifest file is only generated for plugins that are not open in the
development workspace. Since project A is under development, there is no
manifest file generated for it in the \org.eclipse.osgi\manifests folder.
- I removed the project from the development space and realized that I
would have to add project B's class (as a .jar file ) in the class path in
the manifest file for project A.

For that reason, I tried the following:

- Assume class C is the class in project B that is needed by project A.
- Class C has some static variables that are set in by method calls inside
of Project B, but read by aspects in Project A.
-To resolve the run time issue, I exported class C into C.jar and added a
reference to C.jar on A's classpath - which also adds it to the manifest.

The problem now is that the copy of class C used by project B and project A
become different due to C.jar reference in project A. And so the static
variable being set in project B is different instance of the same static
variable being read in Project A.

Adding an entry in the manifest file would have the same issue, since I
need a .jar reference.

I am not sure what I am doing wrong and how else to add the .jar reference
in Project A, but maintain the exact same copy of reference in Project B. I
will appreciate your response.

Also, since this is not an AspectJ issue, please let me know if I should
follow up on this on a different forum.

Thanks for your response.
Irum Godil
WebSphere Integration Developer - ESB Tools
IBM Software Group
irum@xxxxxxxxxx
T/L 969-3634; External +1 (905) 413-3634


                                                                       
             Matthew Webster                                           
             <matthew_webster@                                         
             uk.ibm.com>                                                To
             Sent by:                  aspectj-users@xxxxxxxxxxx       
             aspectj-users-bou                                          cc
             nces@xxxxxxxxxxx                                          
                                                                   Subject
                                       Re: [aspectj-users] AspectJ errors
             12/08/2006 04:08          in plugin projects.             
             AM                                                        
                                                                       
                                                                       
             Please respond to                                         
             aspectj-users@ecl                                         
                 ipse.org                                              
                                                                       
                                                                       





Irum,

Are you using Eclipse, if so which version? In Eclipse 3.0 and later
plug-ins are OSGi bundles so it is the manifest that is used to determine
and resolve dependences. In your cases any packages that contain classes
that are needed outside of the project B will have to be exported while the
manifest for project A must state that it requires B. What functionality
does project A require from B, is it just classes or aspects as well? I am
not sure if this is an AspectJ problem or an OSGi meta-data issue.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/

                                                                       
 Irum Godil <irum@xxxxxxxxxx>                                          
 Sent by:                                                              
 aspectj-users-bounces@xxxxxxxxxx                                       To
 g                                          aspectj-users@xxxxxxxxxxx  
                                                                        cc
                                                                       
 07/12/2006 22:08                                                  Subject
                                            [aspectj-users] AspectJ errors
                                            in plugin projects.        
         Please respond to                                             
     aspectj-users@xxxxxxxxxxx                                         
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       





Hi,

I have an AspectJ plugin project (A) that is using functionality from
another plugin project (B). I have added B's source folder under A's
Aspectpath and inpath.  I have also added a plugin dependency on B in A's
plugin.xml file.

When I run the plugin A, I get the following error:

java.lang.NoClassDefFoundError: B.ClassC

The "ClassC" is declared inside of plugin B. If I add a B.jar on the A's
classpath the error disappears. The problem is that I can only add a .jar
file on A's classpath that is copied in project A. As a result, I end up
with two versions of ClassC.

The project B refers to a different ClassC than the plugin A. Since I am
relying on some static data in ClassC, I am not sure how to maintain one
version of ClassC and link it to my AspectJ project and run it.

I will appreciate your response on this.
Thank you.

Irum Godil
WebSphere Integration Developer - ESB Tools
IBM Software Group
irum@xxxxxxxxxx
T/L 969-3634; External +1 (905) 413-3634

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top