Aspectj export fails because IMessageHandler cannot be found [message #482870] |
Fri, 28 August 2009 08:02  |
Eclipse User |
|
|
|
Hi,
I'm trying to export an aspectj feature/plugin and I get following exception:
org.eclipse.core.runtime.CoreException: C:\iloncar\workspaces\uredsko\.metadata\.plugins\org.eclipse .pde.core\temp\org.eclipse.pde.container.feature\build.xml:3 3:
The following error occurred while executing this line:
C:\iloncar\workspaces\uredsko\.metadata\.plugins\org.eclipse .pde.core\temp\org.eclipse.pde.container.feature\build.xml:1 4:
The following error occurred while executing this line:
C:\iloncar\workspaces\uredsko\net.croz.aspect\build.xml:188: The following
error occurred while executing this line:
C:\iloncar\workspaces\uredsko\net.croz.aspect\build.xml:140: taskdef A class
needed by class org.aspectj.tools.ant.taskdefs.AjcTask cannot be found: org/aspectj/bridge/IMessageHandler
Generated build.xml does not have aspectjweaver.jar in ajde.classpath:
136: <!-- compile the source code -->
137: <path id="ajde.classpath">
138: <pathelement path="../../ajdt/org.aspectj.ajde/ajde.jar"/>
139: </path>
140: <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties ">
141: <classpath refid="ajde.classpath" />
142: </taskdef>
143: <property name="ajcArgFile" value=""/>
144: <iajc destDir="${temp.folder}/@dot.bin" failonerror="true" argfiles="${ajcArgFile}"
verbose="true" fork="true" maxmem="512m" debug="${javacDebugInfo}" bootclasspath="${bundleBootClasspath}"
source="${bundleJavacSource}" target="${bundleJavacTarget}">
145: <forkclasspath refid="@dot.classpath" />
146: <forkclasspath refid="ajde.classpath" />
147: <src path="src/" />
148: </iajc>
This is a recent AJDT from 1.7 branch.
If it's relevant: I use custom target that contains aspectjruntime and aspectjweaver.jar
AJDE depends on aspectjweaver, but it's not added to the classpath.
It seems that AJModelBuildScriptGenerator#bundleToCP doesn't export required
dependencies:
BundleDescription[] prereqs = bundle.getResolvedRequires();
returns nothing, but
bundle.getRequiredBundles()
contains
[Require-Bundle: org.apache.ant; bundle-version="0.0.0", Require-Bundle:
org.eclipse.core.resources; bundle-version="0.0.0", Require-Bundle: org.eclipse.core.runtime;
bundle-version="0.0.0", Require-Bundle: org.eclipse.core.runtime.compatibility;
bundle-version="0.0.0", Require-Bundle: org.eclipse.text; bundle-version="0.0.0",
Require-Bundle: org.aspectj.weaver; bundle-version="92.2.29"]
Shouldn't those bundles be included when calculating ajde.classpath?
--
Ivica Loncar
|
|
|
|
Re: Aspectj export fails because IMessageHandler cannot be found [message #482942 is a reply to message #482871] |
Fri, 28 August 2009 11:22   |
Eclipse User |
|
|
|
Hello Ivica,
>> It seems that AJModelBuildScriptGenerator#bundleToCP doesn't export
>> required
>> dependencies:
>> BundleDescription[] prereqs = bundle.getResolvedRequires();
>> returns nothing, but
>> bundle.getRequiredBundles()
>> contains [Require-Bundle: org.apache.ant; bundle-version="0.0.0",
>> Require-Bundle: org.eclipse.core.resources; bundle-version="0.0.0",
>> Require-Bundle: org.eclipse.core.runtime; bundle-version="0.0.0",
>> Require-Bundle: org.eclipse.core.runtime.compatibility;
>> bundle-version="0.0.0", Require-Bundle: org.eclipse.text;
>> bundle-version="0.0.0", Require-Bundle: org.aspectj.weaver;
>> bundle-version="92.2.29"]
>> Shouldn't those bundles be included when calculating ajde.classpath?
>>
> Hmm.. ajde bundle is not resolved.
>
> Should ajde bundle be resolved before
> org.eclipse.ajdt.core.exports.AJModelBuildScriptGenerator.bu ndleToCP(B
> undleDescription)
>
> is called?
The problem occurs only when I use custom target platform.
It seems that ajde is not resolved when ajde.classpath is generated, and
it's causing the problem.
I don't think bundles have to be resolved in order to be added to ajde.classpath,
so I have replaced:
// now add prerequisite bundles
BundleDescription[] prereqs = bundle.getResolvedRequires();
for (int i = 0; i < prereqs.length; i++) {
String[] pcp = bundleToCP(prereqs[i]);
pathList.addAll(Arrays.asList(pcp));
}
with:
BundleSpecification[] prereqs = bundle.getRequiredBundles();
for (int i = 0; i < prereqs.length; i++) {
BundleDescription prereqBundle = getModel(prereqs[i].getName(), null);
if (prereqBundle != null ) {
String[] pcp = bundleToCP(prereqBundle);
pathList.addAll(Arrays.asList(pcp));
}
}
I'm not sure if this has more implications.
--
Ivica Loncar
|
|
|
|
|
|
|
|
Re: Aspectj export fails because IMessageHandler cannot be found [message #483036 is a reply to message #482994] |
Sat, 29 August 2009 13:35  |
Eclipse User |
|
|
|
Hello Andrew,
> I believe that the weaver and aspectj runtime are required by ajde and
> so must be in the target platform as well.
>
I do have weaver and runtime in the target platform.
Unfortunately build still fails since AJDE is not resolved.
There are additional dependencies that need to be deployed into target platform:
org.apache.ant_1.7.1.v20090120-1145
org.eclipse.core.runtime.compatibility_3.2.0.v20090413.jar
org.eclipse.text_3.4.0.v20080605-1800.jar
Cost me some time.. no I have to figure out how to do headless build...
--
Ivica Loncar
|
|
|
Re: Aspectj export fails because IMessageHandler cannot be found [message #600535 is a reply to message #482870] |
Fri, 28 August 2009 08:09  |
Eclipse User |
|
|
|
> It seems that AJModelBuildScriptGenerator#bundleToCP doesn't export
> required
> dependencies:
> BundleDescription[] prereqs = bundle.getResolvedRequires();
> returns nothing, but
> bundle.getRequiredBundles()
> contains [Require-Bundle: org.apache.ant; bundle-version="0.0.0",
> Require-Bundle: org.eclipse.core.resources; bundle-version="0.0.0",
> Require-Bundle: org.eclipse.core.runtime; bundle-version="0.0.0",
> Require-Bundle: org.eclipse.core.runtime.compatibility;
> bundle-version="0.0.0", Require-Bundle: org.eclipse.text;
> bundle-version="0.0.0", Require-Bundle: org.aspectj.weaver;
> bundle-version="92.2.29"]
>
> Shouldn't those bundles be included when calculating ajde.classpath?
Hmm.. ajde bundle is not resolved.
Should ajde bundle be resolved before org.eclipse.ajdt.core.exports.AJModelBuildScriptGenerator.bu ndleToCP(BundleDescription)
is called?
--
Ivica Loncar
|
|
|
Re: Aspectj export fails because IMessageHandler cannot be found [message #600550 is a reply to message #482871] |
Fri, 28 August 2009 11:22  |
Eclipse User |
|
|
|
Hello Ivica,
>> It seems that AJModelBuildScriptGenerator#bundleToCP doesn't export
>> required
>> dependencies:
>> BundleDescription[] prereqs = bundle.getResolvedRequires();
>> returns nothing, but
>> bundle.getRequiredBundles()
>> contains [Require-Bundle: org.apache.ant; bundle-version="0.0.0",
>> Require-Bundle: org.eclipse.core.resources; bundle-version="0.0.0",
>> Require-Bundle: org.eclipse.core.runtime; bundle-version="0.0.0",
>> Require-Bundle: org.eclipse.core.runtime.compatibility;
>> bundle-version="0.0.0", Require-Bundle: org.eclipse.text;
>> bundle-version="0.0.0", Require-Bundle: org.aspectj.weaver;
>> bundle-version="92.2.29"]
>> Shouldn't those bundles be included when calculating ajde.classpath?
>>
> Hmm.. ajde bundle is not resolved.
>
> Should ajde bundle be resolved before
> org.eclipse.ajdt.core.exports.AJModelBuildScriptGenerator.bu ndleToCP(B
> undleDescription)
>
> is called?
The problem occurs only when I use custom target platform.
It seems that ajde is not resolved when ajde.classpath is generated, and
it's causing the problem.
I don't think bundles have to be resolved in order to be added to ajde.classpath,
so I have replaced:
// now add prerequisite bundles
BundleDescription[] prereqs = bundle.getResolvedRequires();
for (int i = 0; i < prereqs.length; i++) {
String[] pcp = bundleToCP(prereqs[i]);
pathList.addAll(Arrays.asList(pcp));
}
with:
BundleSpecification[] prereqs = bundle.getRequiredBundles();
for (int i = 0; i < prereqs.length; i++) {
BundleDescription prereqBundle = getModel(prereqs[i].getName(), null);
if (prereqBundle != null ) {
String[] pcp = bundleToCP(prereqBundle);
pathList.addAll(Arrays.asList(pcp));
}
}
I'm not sure if this has more implications.
--
Ivica Loncar
|
|
|
Re: Aspectj export fails because IMessageHandler cannot be found [message #600565 is a reply to message #482942] |
Fri, 28 August 2009 12:22  |
Eclipse User |
|
|
|
Hi Ivica,
org.aspectj.ajde must be in the target platform in order for the build to
work. So, add that bundle to the target platform and it should work.
>
> The problem occurs only when I use custom target platform.
> It seems that ajde is not resolved when ajde.classpath is generated, and
> it's causing the problem.
>
> I don't think bundles have to be resolved in order to be added to
> ajde.classpath,
> so I have replaced:
>
> // now add prerequisite bundles
> BundleDescription[] prereqs = bundle.getResolvedRequires();
> for (int i = 0; i < prereqs.length; i++) {
> String[] pcp = bundleToCP(prereqs[i]);
> pathList.addAll(Arrays.asList(pcp));
> }
> with:
>
> BundleSpecification[] prereqs = bundle.getRequiredBundles();
> for (int i = 0; i < prereqs.length; i++) {
> BundleDescription prereqBundle = getModel(prereqs[i].getName(), null);
> if (prereqBundle != null ) {
> String[] pcp = bundleToCP(prereqBundle);
> pathList.addAll(Arrays.asList(pcp));
> }
> }
>
> I'm not sure if this has more implications.
>
|
|
|
Re: Aspectj export fails because IMessageHandler cannot be found [message #600570 is a reply to message #482949] |
Fri, 28 August 2009 12:49  |
Eclipse User |
|
|
|
Hello Andrew,
> org.aspectj.ajde must be in the target platform in order for the build
> to work. So, add that bundle to the target platform and it should
> work.
Thanks Andrew. I will do that.
Btw. Isn't that a little bit unexpected: we don't have to include PDE in
the target platform in order to compile a product.
Don't you think this should be documented?
--
Ivica Loncar
|
|
|
Re: Aspectj export fails because IMessageHandler cannot be found [message #600581 is a reply to message #482949] |
Fri, 28 August 2009 13:18  |
Eclipse User |
|
|
|
Hello Andrew,
> Hi Ivica,
>
> org.aspectj.ajde must be in the target platform in order for the build
> to work. So, add that bundle to the target platform and it should
> work.
>
Hi Andrew,
I have tried to add ajde to the target platform and it doesn't work.
I have added ajde to the target platform and generated build.xml looks like
this:
<!-- compile the source code -->
<path id="ajde.classpath">
<pathelement path=" ../uredsko_platform_341/ajde/org.aspectj.ajde_1.6.5.20090618 034232/ajde.jar "/>
</path>
<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties ">
<classpath refid="ajde.classpath" />
</taskdef>
<property name="ajcArgFile" value=""/>
<iajc destDir="${temp.folder}/@dot.bin" failonerror="true" argfiles="${ajcArgFile}"
verbose="true" fork="true" maxmem="512m" debug="${javacDebugInfo}" bootclasspath="${bundleBootClasspath}"
source="${bundleJavacSource}" target="${bundleJavacTarget}">
<forkclasspath refid="@dot.classpath" />
<forkclasspath refid="ajde.classpath" />
<src path="src/" />
</iajc>
iajc fails with error:
net.croz.aspect\build.xml:139: taskdef A class needed by class org.aspectj.tools.ant.taskdefs.AjcTask
cannot be found: org/aspectj/bridge/IMessageHandler
Total time: 281 milliseconds
If we just get ajde dependencies without trying to resolve them ajde.classpath
will be created as expected.
Why ${ajde.classpath} bundles have to be resolved from the target platform?
--
Ivica Loncar
|
|
|
|
Re: Aspectj export fails because IMessageHandler cannot be found [message #600599 is a reply to message #482960] |
Fri, 28 August 2009 19:40  |
Eclipse User |
|
|
|
I believe that the weaver and aspectj runtime are required by ajde and so
must be in the target platform as well.
On 28/08/09 10:18 AM, in article
d8d722417b058cbf62b78ca7f10@news.eclipse.org, "Ivica Loncar"
<iloncar.mlIQTEST@gmail.com> wrote:
> Hello Andrew,
>
>> Hi Ivica,
>>
>> org.aspectj.ajde must be in the target platform in order for the build
>> to work. So, add that bundle to the target platform and it should
>> work.
>>
>
> Hi Andrew,
>
> I have tried to add ajde to the target platform and it doesn't work.
>
> I have added ajde to the target platform and generated build.xml looks like
> this:
>
> <!-- compile the source code -->
> <path id="ajde.classpath">
> <pathelement
> path=" ../uredsko_platform_341/ajde/org.aspectj.ajde_1.6.5.20090618 034232/ajde.
> jar"/>
> </path>
> <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties ">
> <classpath refid="ajde.classpath" />
> </taskdef>
> <property name="ajcArgFile" value=""/>
> <iajc destDir="${temp.folder}/@dot.bin" failonerror="true"
> argfiles="${ajcArgFile}"
> verbose="true" fork="true" maxmem="512m" debug="${javacDebugInfo}"
> bootclasspath="${bundleBootClasspath}"
> source="${bundleJavacSource}" target="${bundleJavacTarget}">
> <forkclasspath refid="@dot.classpath" />
> <forkclasspath refid="ajde.classpath" />
> <src path="src/" />
> </iajc>
>
>
> iajc fails with error:
>
> net.croz.aspect\build.xml:139: taskdef A class needed by class
> org.aspectj.tools.ant.taskdefs.AjcTask
> cannot be found: org/aspectj/bridge/IMessageHandler
>
> Total time: 281 milliseconds
>
> If we just get ajde dependencies without trying to resolve them ajde.classpath
> will be created as expected.
> Why ${ajde.classpath} bundles have to be resolved from the target platform?
>
|
|
|
Re: Aspectj export fails because IMessageHandler cannot be found [message #600611 is a reply to message #482994] |
Sat, 29 August 2009 13:35  |
Eclipse User |
|
|
|
Hello Andrew,
> I believe that the weaver and aspectj runtime are required by ajde and
> so must be in the target platform as well.
>
I do have weaver and runtime in the target platform.
Unfortunately build still fails since AJDE is not resolved.
There are additional dependencies that need to be deployed into target platform:
org.apache.ant_1.7.1.v20090120-1145
org.eclipse.core.runtime.compatibility_3.2.0.v20090413.jar
org.eclipse.text_3.4.0.v20080605-1800.jar
Cost me some time.. no I have to figure out how to do headless build...
--
Ivica Loncar
|
|
|
Powered by
FUDForum. Page generated in 0.47670 seconds