Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] AJDT icons query & iajc problem

Hi

A couple of questions that I was unable to find answers for in the 
archives.

1) Does the AJDT editor display annotation icons in the gutter for 
   projects that are built using the <iajc> task of Ant?
   - If true, then these are not getting displayed for me.
   - If not, it would be great if the we could have this facility. I know 
     a lot of large projects use Ant for building.

2) I am curious to know the file that AJDT uses to produce the icons and
   the cross-references view. I looked around in my Eclipse workspace and
   did not find any.

3) Non-forking compile using <iajc> in Eclipse is not working and throws 
   an error. It looks like the usual classpath error where aspectjrt.jar 
   is not found. I have included it in the classpath attribute but 
   am still having problems with it. Perhaps I have missed something 
   obvious.
   - There are no problems with the forking or non-forking compile when
     the aspectjTaskdefs.properties is taken from the aspectjtools.jar
     provided with the AspectJ compiler distribution.
   - However when the aspectjTaskdefs.properties is taken from the
     eclipse/plugins/org.aspectj.ajde_1.5.1.20060410063641/ajde.jar
     the Non-forking compile fails but the Forking compile is successful.
   - I followed the instructions for using Ant in AJDT provided in the
     AJDT FAQ at
     http://www.eclipse.org/ajdt/faq.php#q:ant
   - I am using Eclipse 3.1.2 and AJDT 1.3.1. I am providing the relevant
     samples from my Ant build file and the error produced.

4) It would be convenient if a search functionality is added to the 
   mailing list archives. Over the years several questions have been 
   answered and a considerable AspectJ knowledge repository has been 
   created.

I will be grateful for any help with my queries.

Thanks

Venkat

BUILD FILE EXCERPTS:
--------------------

<property name="eclipseplugins.dir" 
          location="/usr/local/eclipse/plugins"/>
<property name="ajdtplugins.dir" 
          location="/home/EclipsePlugins/AJDT/eclipse/plugins" />

<property name="aspectjrt.jar"
          value="${ajdtplugins.dir}/
             org.aspectj.runtime_1.5.1.20060410063641/aspectjrt.jar"/>
<property name="ajde.jar"
          value="${ajdtplugins.dir}/
             org.aspectj.ajde_1.5.1.20060410063641/ajde.jar"/>
<property name="aspectjweaver.jar"
          value="${ajdtplugins.dir}/
             org.aspectj.weaver_1.5.1.20060410063641/aspectjweaver.jar"/>


NOTE: This target is slightly different from the one on the FAQ page. I
      had to introduce the two classpath entries to get this to work.
<target name="init.taskdefs" depends="init.variables">
  <taskdef resource=
           "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
    <classpath>
      <pathelement path="${ajde.jar}" />
      <pathelement path="${aspectjweaver.jar}" />
    </classpath>
  </taskdef>
</target>

NOTE: This is the forking compile target that works. The classpath entries
      are different from the one in the FAQ for it to work.
<target name="forking_compile" depends="init">
  <echo message="FORKING COMPILE: Compiling Java and Aspect files" />
  <iajc destdir="${bin.dir}"
        verbose="true"
        srcdir="${src.dir}"
        fork="true"
        classpath="">

       <forkclasspath>
         <pathelement path="${aspectjrt.jar}" />
         <pathelement path="${ajde.jar}" />
         <pathelement path="${aspectjweaver.jar}" />
         <pathelement path="${eclipseplugins.dir}/
                              org.eclipse.core.runtime_3.1.2.jar" />
       </forkclasspath>

  </iajc>
</target>

NOTE: This is the one not working.
<target name="non_forking_compile" depends="init">
  <echo message="NON-FORKING COMPILE: Compiling Java and Aspect files"/>
  <iajc destdir="${bin.dir}"
        verbose="true"
        srcdir="${src.dir}"
        fork="false">

       <classpath>
         <pathelement path="${aspectjrt.jar}" />
       </classpath>

  </iajc>
</target>

ERROR:
------

compile:

[echo] NON-FORKING COMPILE: Compiling Java and Aspect files
[iajc] ajc [-d, /home/workspace/Hello_World/bin, -verbose,-classpath,
       /home/EclipsePlugins/AJDT/eclipse/plugins/
                   org.aspectj.runtime_1.5.1.20060410063641/aspectjrt.jar,
       /home/workspace/Hello_World/src/hello/HelloWorld.java,
       /home/workspace/Hello_World/src/hello/Name_Insert_Aspect.aj]
[iajc] info zipfile classpath entry does not exist:
        /usr/local/jdk1.5.0/jre/lib/i18n.jar
[iajc] info zipfile classpath entry does not exist:
        /usr/local/jdk1.5.0/jre/lib/sunrsasign.jar
[iajc] info directory classpath entry does not exist:
        /usr/local/jdk1.5.0/jre/classes
[iajc] abort ABORT -- (NoClassDefFoundError)
        org/aspectj/lang/NoAspectBoundException
[iajc] org/aspectj/lang/NoAspectBoundException
[iajc] java.lang.NoClassDefFoundError: 
        org/aspectj/lang/NoAspectBoundException
[iajc]     at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjB
uildManager.java:849)
[iajc]     at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager
.java:242)
[iajc]     at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildMana
ger.java:161)
[iajc]     at
org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112)
[iajc]     at
org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
[iajc]     at org.aspectj.tools.ajc.Main.run(Main.java:367)
[iajc]     at org.aspectj.tools.ajc.Main.runMain(Main.java:246)
[iajc]     at
org.aspectj.tools.ant.taskdefs.AjcTask.executeInSameVM(AjcTask.java:1262)
[iajc]     at
org.aspectj.tools.ant.taskdefs.AjcTask.execute(AjcTask.java:1056)
[iajc]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[iajc]     at org.apache.tools.ant.Task.perform(Task.java:364)
[iajc]     at org.apache.tools.ant.Target.execute(Target.java:341)
[iajc]     at
org.apache.tools.ant.Target.performTasks(Target.java:369)
[iajc]     at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[iajc]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[iajc]     at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.j
ava:40)
[iajc]     at
org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(Ecli
pseDefaultExecutor.java:32)
[iajc]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[iajc]     at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.ja
va:704)
[iajc]     at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.ja
va:455)
[iajc]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[iajc]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
[iajc]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
[iajc]     at java.lang.reflect.Method.invoke(Method.java:585)
[iajc]     at org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
[iajc]     at
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.runInSame
VM(AntLaunchDelegate.java:234)
[iajc]     at
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.launch(An
tLaunchDelegate.java:196)
[iajc]     at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfigurati
on.java:590)
[iajc]     at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfigurati
on.java:515)
[iajc]     at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfigurati
on.java:152)
[iajc]     at
org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.launchBuild(
ExternalToolBuilder.java:176)
[iajc]     at
org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.doBuildBased
OnScope(ExternalToolBuilder.java:164)
[iajc]     at
org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.build(Extern
alToolBuilder.java:83)
[iajc]     at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:593)
[iajc]     at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java
:1044)
[iajc]     at
org.eclipse.core.runtime.Platform.run(Platform.java:783)
[iajc]     at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:1
68)
[iajc]     at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:2
02)
[iajc]     at
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
[iajc]     at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java
:1044)
[iajc]     at
org.eclipse.core.runtime.Platform.run(Platform.java:783)
[iajc]     at 
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:2
34)
[iajc]     at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:303)
[iajc]     at
org.eclipse.core.internal.resources.Project.build(Project.java:106)
[iajc]     at
org.eclipse.ui.actions.BuildAction.invokeOperation(BuildAction.java:190)
[iajc]     at
org.eclipse.ui.actions.WorkspaceAction.execute(WorkspaceAction.java:133)
[iajc]     at
org.eclipse.ui.actions.WorkspaceAction$2.runInWorkspace(WorkspaceAction.java
:424)
[iajc]     at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspa
ceJob.java:38)
[iajc]     at
org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

BUILD FAILED
/home/workspace/Hello_World/build.xml:76:
fail due to NoClassDefFoundError
"org/aspectj/lang/NoAspectBoundException""ABORT" (1 exceptions)

Total time: 5 seconds



Back to the top