Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Communications Framework (ECF) » Linkage error with R-OSGI
Linkage error with R-OSGI [message #624346] Wed, 26 November 2008 14:28 Go to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 181
Registered: July 2009
Senior Member
We are trying to implement a remote DAO infrastructure to move all db
related calls to the server and we are having some issues.

After making some progress we are now getting the following error:
java.lang.LinkageError: loader constraint violation: loader (instance of
org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously
initiated loading for a different type with name
"com/castortech/iris/core/db/modelobjects/IAddress"

What we have as a service is:
public interface IAddressDAO extends GenericDAO<IAddress, Integer> {
IAddress build();
}

here is the call:
final IAddressDAO proxy = (IAddressDAO)service.getProxy();
final IAddress address = proxy.build();

and the error occurs on the client side at the end of the remote call to
build(). We can see that call returns an instance of Address (which
implements IAddress) and that now goes through correctly (had many
issues earlier with class not found here).

But it appears that when it tries to cast back to an IAdress here in the
proxy:
public IAddress build() {
return
(IAddress)this.endpoint.invokeMethod("r-osgi://127.0.0.1:9278#131",
"build()Lcom/castortech/iris/core/db/modelobjects/IAddress;", new
Object[0]));
}

that is gives the error.

BTW, I have modified the code a bit and I am saving the jar that is
produced, and other than the proxy, it contains IAddress and its 2
superinterfaces as well as the IAddressDAO and its superinterface & the
eclipse IAdaptable.

My research has been pretty unsuccessful at getting anywhere with this,
other than this could be related to tales of class loaders (where I am
very clueless and I've lost countless hours in the past). Otherwise, the
only other clue is that this could be related to the jar instrumentation
when dealing with interfaces.

So, I am deferring to the experts. Please help.

Thanks
Alain
Re: Linkage error with R-OSGI [message #624439 is a reply to message #624346] Wed, 03 December 2008 01:01 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 971
Registered: July 2009
Senior Member
Alain,

After looking around a little bit, it seems that others have experienced
similar LinkageErrors when they have two versions of a single interface
class (i.e. IAddress) within the same runtime (i.e. perhaps in two other
bundles?). Is it possible that two versions of IAddress class exist in
your runtime and that this is causing a similar problem?

Scott


Alain Picard wrote:
> We are trying to implement a remote DAO infrastructure to move all db
> related calls to the server and we are having some issues.
>
> After making some progress we are now getting the following error:
> java.lang.LinkageError: loader constraint violation: loader (instance of
> org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously
> initiated loading for a different type with name
> "com/castortech/iris/core/db/modelobjects/IAddress"
>
> What we have as a service is:
> public interface IAddressDAO extends GenericDAO<IAddress, Integer> {
> IAddress build();
> }
>
> here is the call:
> final IAddressDAO proxy = (IAddressDAO)service.getProxy();
> final IAddress address = proxy.build();
>
> and the error occurs on the client side at the end of the remote call to
> build(). We can see that call returns an instance of Address (which
> implements IAddress) and that now goes through correctly (had many
> issues earlier with class not found here).
>
> But it appears that when it tries to cast back to an IAdress here in the
> proxy:
> public IAddress build() {
> return
> (IAddress)this.endpoint.invokeMethod("r-osgi://127.0.0.1:9278#131",
> "build()Lcom/castortech/iris/core/db/modelobjects/IAddress;", new
> Object[0]));
> }
>
> that is gives the error.
>
> BTW, I have modified the code a bit and I am saving the jar that is
> produced, and other than the proxy, it contains IAddress and its 2
> superinterfaces as well as the IAddressDAO and its superinterface & the
> eclipse IAdaptable.
>
> My research has been pretty unsuccessful at getting anywhere with this,
> other than this could be related to tales of class loaders (where I am
> very clueless and I've lost countless hours in the past). Otherwise, the
> only other clue is that this could be related to the jar instrumentation
> when dealing with interfaces.
>
> So, I am deferring to the experts. Please help.
>
> Thanks
> Alain
Previous Topic:[CDO] [ECF] Invoking EMF operations remotely (client - server)
Next Topic:JSR166 (java.util.concurrent) backport for Orbit
Goto Forum:
  


Current Time: Sat Nov 22 05:17:17 GMT 2014

Powered by FUDForum. Page generated in 0.01817 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software