Discussion:
[tycho-user] LinkageError when running Tycho Surefire tests
Setya Djajadinata
2017-03-15 02:57:31 UTC
Permalink
Hi all,

We're running Eclipse RAP based application tests using Tycho which throws
the following errors:

java.lang.LinkageError: loader constraint violation: loader (instance of
org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated
loading for a different type with name
"org/eclipse/swt/widgets/Control"

Using -verbose:class reveals that org.eclipse.swt.widgets.Control class was
loaded by 2 different classloaders, i.e:

[Loaded org.eclipse.swt.widgets.Control from
file:/home/setya/.m2/repository/p2/osgi/bundle/org.eclipse.rap.rwt/3.0.2.20160201-1220/org.eclipse.rap.rwt-3.0.2.20160201-1220.jar]

and

[Loaded org.eclipse.swt.widgets.Control from
file:/home/setya/.m2/repository/p2/osgi/bundle/org.eclipse.swt.gtk.linux.x86_64/3.104.2.v20160212-1350/org.eclipse.swt.gtk.linux.x86_64-3.10
4.2.v20160212-1350.jar]

Obviously we only want it loaded by RWT classloader, not SWT one.

The tests run fine when executed by RAP Tooling.

How to instruct Tycho to resolve this ?

Any help would be greatly appreciated.

Thanks & Regards,
Setya
Sievers, Jan
2017-03-15 09:01:58 UTC
Permalink
If I understood you right, you don’t want the SWT fragment org.eclipse.swt.gtk.linux.x86_64 at all in your target platform

Check https://wiki.eclipse.org/Tycho/Target_Platform on how to control the content of your target platform

Regards
Jan

On 15/03/2017, 03:57, "tycho-user-***@eclipse.org on behalf of Setya Djajadinata" <tycho-user-***@eclipse.org on behalf of ***@gmail.com> wrote:

Hi all,


We're running Eclipse RAP based application tests using Tycho which throws the following errors:


java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated loading for a different type with name
"org/eclipse/swt/widgets/Control"


Using -verbose:class reveals that org.eclipse.swt.widgets.Control class was loaded by 2 different classloaders, i.e:


[Loaded org.eclipse.swt.widgets.Control from file:/home/setya/.m2/repository/p2/osgi/bundle/org.eclipse.rap.rwt/3.0.2.20160201-1220/org.eclipse.rap.rwt-3.0.2.20160201-1220.jar]


and


[Loaded org.eclipse.swt.widgets.Control from file:/home/setya/.m2/repository/p2/osgi/bundle/org.eclipse.swt.gtk.linux.x86_64/3.104.2.v20160212-1350/org.eclipse.swt.gtk.linux.x86_64-3.10
4.2.v20160212-1350.jar]


Obviously we only want it loaded by RWT classloader, not SWT one.


The tests run fine when executed by RAP Tooling.


How to instruct Tycho to resolve this ?


Any help would be greatly appreciated.


Thanks & Regards,
Setya
Setya Djajadinata
2017-03-16 09:55:16 UTC
Permalink
Hi Jan,

Thank you for your information.

I've added the following:

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<filters>
<filter>
<type>eclipse-plugin</type>
<id>org.eclipse.swt</id>
<removeAll/>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>

And the problem is solved.

Regards,
SetNug
If I understood you right, you don’t want the SWT fragment
org.eclipse.swt.gtk.linux.x86_64 at all in your target platform
Check https://wiki.eclipse.org/Tycho/Target_Platform on how to control
the content of your target platform
Regards
Jan
Hi all,
We're running Eclipse RAP based application tests using Tycho which throws
java.lang.LinkageError: loader constraint violation: loader (instance of
org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated
loading for a different type with name
"org/eclipse/swt/widgets/Control"
Using -verbose:class reveals that org.eclipse.swt.widgets.Control class
[Loaded org.eclipse.swt.widgets.Control from file:/home/setya/.m2/
repository/p2/osgi/bundle/org.eclipse.rap.rwt/3.0.2.
20160201-1220/org.eclipse.rap.rwt-3.0.2.20160201-1220.jar]
and
[Loaded org.eclipse.swt.widgets.Control from file:/home/setya/.m2/
repository/p2/osgi/bundle/org.eclipse.swt.gtk.linux.x86_64/
3.104.2.v20160212-1350/org.eclipse.swt.gtk.linux.x86_64-3.10
4.2.v20160212-1350.jar]
Obviously we only want it loaded by RWT classloader, not SWT one.
The tests run fine when executed by RAP Tooling.
How to instruct Tycho to resolve this ?
Any help would be greatly appreciated.
Thanks & Regards,
Setya
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Loading...