Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » Classloading issue
Classloading issue [message #19945] Fri, 30 January 2009 07:48 Go to next message
Velganesh Subramanian is currently offline Velganesh Subramanian
Messages: 67
Registered: July 2009
Member
I followed the PingPong example as given in Riena RC2 download. I ran and
go the pings!

I tried the same approach to implment my functionality. I also have
common, client, config and server plugins. I am developing a plugin
similar to Eclipse UDC. I want to take advantage of Riena's Attachment to
pass the file to a server.

When I run the client, the config plugin is in RESOLVED state. When I said
start on it, it threw an exception saying that the interface present in
common project is not visible for the class loader. What am I doing wrong?
Should I declare any buddies? I am exposing the package containing the
interface in common plugin's manifest. I also came across the use of
Injector. Do you have an example?
Re: Classloading issue [message #19990 is a reply to message #19945] Fri, 30 January 2009 12:12 Go to previous messageGo to next message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
Velganesh Subramanian schrieb:
> I followed the PingPong example as given in Riena RC2 download. I ran
> and go the pings!
>
> I tried the same approach to implment my functionality. I also have
> common, client, config and server plugins. I am developing a plugin
> similar to Eclipse UDC. I want to take advantage of Riena's Attachment
> to pass the file to a server.
>
> When I run the client, the config plugin is in RESOLVED state. When I
> said start on it, it threw an exception saying that the interface
> present in common project is not visible for the class loader. What am I
> doing wrong? Should I declare any buddies? I am exposing the package
> containing the interface in common plugin's manifest. I also came across
> the use of Injector. Do you have an example?
>
the common bundle needs to define org.eclipse.riena.communication.core as buddy.....Look how that is done
in the pingpong sample.

The injector is explained in detail in the wiki
http://wiki.eclipse.org/Riena_Getting_Started_with_injecting _services_and_extensions

There are also many more documentation wiki pages that you can reach from here......http://wiki.eclipse.org/Riena_Project

- christian
Re: Classloading issue [message #20096 is a reply to message #19990] Fri, 30 January 2009 12:52 Go to previous messageGo to next message
Velganesh Subramanian is currently offline Velganesh Subramanian
Messages: 67
Registered: July 2009
Member
Thanks Christian. I referred all the pages before starting my experiment.

This is what I did. I took CustomerSearchController.java as an example
instead of PingPong since use of Publish and Inject are more elegant.

This is what I am doing.

Server's activator:
UsageLogger logger = new UsageLogger();
context.registerService(IUsageLogger.class.getName(), logger, null);
Publish.service(IUsageLogger.class).usingPath(IUsageLogger.W S_ID).withProtocol( "hessian").andStart(context);

Common:
1. Declare the interface
2. Activator does not have any code

Client's activator:
Within start method-
new RemoteServiceFactory().createAndRegisterProxy(IUsageLogger.c lass,
"http://localhost:8080/hessian" + IUsageLogger.WS_ID,
"hessian", context);

Inject.service(IUsageLogger.class).into(this).andStart(conte xt);

if (loggerService != null) {
loggerService.log("At least now");
System.out.println("loggerService invoked from client");
} else {
System.out.println("loggerService is not injected");
}

When I run the client, the client bundle is in resolved state. When I
start, the trace is like this.

java.lang.IllegalArgumentException: interface com.vel.udc.IUsageLogger is
not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
at
com.caucho.hessian.client.HessianProxyFactory.create(Hessian ProxyFactory.java:394)
at
com.caucho.hessian.client.HessianProxyFactory.create(Hessian ProxyFactory.java:354)

I am using the target downloaded from Riena RC2.
Re: Classloading issue [message #20459 is a reply to message #20096] Fri, 30 January 2009 13:20 Go to previous messageGo to next message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
ok so I say it again "the common bundle needs to define org.eclipse.riena.communication.core as buddy.....Look how that
is done in the pingpong sample."

Look at org.eclipse.riena.communication.sample.pingpong.common in the MANIFEST.MF file

You see a line

Eclipse-RegisterBuddy: org.eclipse.riena.communication.core
Require-Bundle: org.eclipse.riena.communication.core

For Buddy registeration you need to have both lines.

So that is what you have to add to the commons bundle in your example in the MANIFEST.MF file. Then it should work.

christian



Velganesh Subramanian schrieb:
> Thanks Christian. I referred all the pages before starting my experiment.
>
> This is what I did. I took CustomerSearchController.java as an example
> instead of PingPong since use of Publish and Inject are more elegant.
>
> This is what I am doing.
>
> Server's activator:
> UsageLogger logger = new UsageLogger();
> context.registerService(IUsageLogger.class.getName(), logger, null);
> Publish.service(IUsageLogger.class).usingPath(IUsageLogger.W S_ID).withProtocol( "hessian").andStart(context);
>
>
> Common:
> 1. Declare the interface
> 2. Activator does not have any code
>
> Client's activator:
> Within start method-
> new RemoteServiceFactory().createAndRegisterProxy(IUsageLogger.c lass,
> "http://localhost:8080/hessian" + IUsageLogger.WS_ID,
> "hessian", context);
>
> Inject.service(IUsageLogger.class).into(this).andStart(conte xt);
>
> if (loggerService != null) {
> loggerService.log("At least now");
> System.out.println("loggerService invoked from client");
> } else {
> System.out.println("loggerService is not injected");
> }
>
> When I run the client, the client bundle is in resolved state. When I
> start, the trace is like this.
>
> java.lang.IllegalArgumentException: interface com.vel.udc.IUsageLogger
> is not visible from class loader
> at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
> at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
> at
> com.caucho.hessian.client.HessianProxyFactory.create(Hessian ProxyFactory.java:394)
>
> at
> com.caucho.hessian.client.HessianProxyFactory.create(Hessian ProxyFactory.java:354)
>
>
> I am using the target downloaded from Riena RC2.
>
Re: Classloading issue [message #20466 is a reply to message #20459] Sun, 01 February 2009 15:22 Go to previous messageGo to next message
Velganesh Subramanian is currently offline Velganesh Subramanian
Messages: 67
Registered: July 2009
Member
Thanks Christian. I could make it work. I am curious to know on what
basis I need to add the plugins in 'Run Configuration'. When I choose my
plugin alone and press 'Select Required', the list is not sufficient to
run the client or server. This will lead to a problem when packaging a
product. Will you please guide?
Re: Classloading issue [message #20489 is a reply to message #20466] Tue, 03 February 2009 12:01 Go to previous messageGo to next message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
Vel schrieb:
> Thanks Christian. I could make it work. I am curious to know on what
> basis I need to add the plugins in 'Run Configuration'. When I choose my
> plugin alone and press 'Select Required', the list is not sufficient to
> run the client or server. This will lead to a problem when packaging a
> product. Will you please guide?
my recommendation is that you use the global bundle org.eclipse.riena.client for your client and
org.eclipse.riena.server for your server. Now if you press "add required bundles" you
should be fine.

However having said this, riena.client implies that you write a client with riena remote services, the ridgets, the ui
and everything. So maybe that is too much for you.

So if doesnt work for you, give me some examples of what bundles are missing when you click "Add Required"

christian
Re: Classloading issue [message #20513 is a reply to message #20489] Tue, 03 February 2009 12:41 Go to previous messageGo to next message
Eclipse User
Originally posted by: ekkehard.gentz-software.de

Christian Campo schrieb:
> Vel schrieb:
>> Thanks Christian. I could make it work. I am curious to know on what
>> basis I need to add the plugins in 'Run Configuration'. When I choose
>> my plugin alone and press 'Select Required', the list is not
>> sufficient to run the client or server. This will lead to a problem
>> when packaging a product. Will you please guide?
> my recommendation is that you use the global bundle
> org.eclipse.riena.client for your client and org.eclipse.riena.server
> for your server. Now if you press "add required bundles" you
> should be fine.
>
> However having said this, riena.client implies that you write a client
> with riena remote services, the ridgets, the ui and everything. So maybe
> that is too much for you.
>
> So if doesnt work for you, give me some examples of what bundles are
> missing when you click "Add Required"
>
> christian
I always do this without riena.client and riena.server
to understand the riena server and client its worth to look into the
Manifest files to see whats required

and a good way to play around is using OSGI launchers, add the bundle
you think you need, then hit "Validate bundles" it gives you hints which
bundle needs something more

OSGI is great with bundles and dependencies, but you must be carefully
while integrating some frameworks like Riena.

I also always try to remove as much "required-bundle" dependencies and
replace them with "package-import" statements whch is more flexible, but
also more work to do

my 2c

ekke
Re: Classloading issue [message #20543 is a reply to message #20513] Thu, 05 February 2009 13:24 Go to previous message
Velganesh Subramanian is currently offline Velganesh Subramanian
Messages: 67
Registered: July 2009
Member
I made a list of active bundles by looking at the status after running
Ping Pong client and server. It works without any problems.
Re: Classloading issue [message #578332 is a reply to message #19945] Fri, 30 January 2009 12:12 Go to previous message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
Velganesh Subramanian schrieb:
> I followed the PingPong example as given in Riena RC2 download. I ran
> and go the pings!
>
> I tried the same approach to implment my functionality. I also have
> common, client, config and server plugins. I am developing a plugin
> similar to Eclipse UDC. I want to take advantage of Riena's Attachment
> to pass the file to a server.
>
> When I run the client, the config plugin is in RESOLVED state. When I
> said start on it, it threw an exception saying that the interface
> present in common project is not visible for the class loader. What am I
> doing wrong? Should I declare any buddies? I am exposing the package
> containing the interface in common plugin's manifest. I also came across
> the use of Injector. Do you have an example?
>
the common bundle needs to define org.eclipse.riena.communication.core as buddy.....Look how that is done
in the pingpong sample.

The injector is explained in detail in the wiki
http://wiki.eclipse.org/Riena_Getting_Started_with_injecting _services_and_extensions

There are also many more documentation wiki pages that you can reach from here......http://wiki.eclipse.org/Riena_Project

- christian
Re: Classloading issue [message #578398 is a reply to message #19990] Fri, 30 January 2009 12:52 Go to previous message
Velganesh Subramanian is currently offline Velganesh Subramanian
Messages: 67
Registered: July 2009
Member
Thanks Christian. I referred all the pages before starting my experiment.

This is what I did. I took CustomerSearchController.java as an example
instead of PingPong since use of Publish and Inject are more elegant.

This is what I am doing.

Server's activator:
UsageLogger logger = new UsageLogger();
context.registerService(IUsageLogger.class.getName(), logger, null);
Publish.service(IUsageLogger.class).usingPath(IUsageLogger.W S_ID).withProtocol( "hessian").andStart(context);

Common:
1. Declare the interface
2. Activator does not have any code

Client's activator:
Within start method-
new RemoteServiceFactory().createAndRegisterProxy(IUsageLogger.c lass,
"http://localhost:8080/hessian" + IUsageLogger.WS_ID,
"hessian", context);

Inject.service(IUsageLogger.class).into(this).andStart(conte xt);

if (loggerService != null) {
loggerService.log("At least now");
System.out.println("loggerService invoked from client");
} else {
System.out.println("loggerService is not injected");
}

When I run the client, the client bundle is in resolved state. When I
start, the trace is like this.

java.lang.IllegalArgumentException: interface com.vel.udc.IUsageLogger is
not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
at
com.caucho.hessian.client.HessianProxyFactory.create(Hessian ProxyFactory.java:394)
at
com.caucho.hessian.client.HessianProxyFactory.create(Hessian ProxyFactory.java:354)

I am using the target downloaded from Riena RC2.
Re: Classloading issue [message #578414 is a reply to message #20096] Fri, 30 January 2009 13:20 Go to previous message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
ok so I say it again "the common bundle needs to define org.eclipse.riena.communication.core as buddy.....Look how that
is done in the pingpong sample."

Look at org.eclipse.riena.communication.sample.pingpong.common in the MANIFEST.MF file

You see a line

Eclipse-RegisterBuddy: org.eclipse.riena.communication.core
Require-Bundle: org.eclipse.riena.communication.core

For Buddy registeration you need to have both lines.

So that is what you have to add to the commons bundle in your example in the MANIFEST.MF file. Then it should work.

christian



Velganesh Subramanian schrieb:
> Thanks Christian. I referred all the pages before starting my experiment.
>
> This is what I did. I took CustomerSearchController.java as an example
> instead of PingPong since use of Publish and Inject are more elegant.
>
> This is what I am doing.
>
> Server's activator:
> UsageLogger logger = new UsageLogger();
> context.registerService(IUsageLogger.class.getName(), logger, null);
> Publish.service(IUsageLogger.class).usingPath(IUsageLogger.W S_ID).withProtocol( "hessian").andStart(context);
>
>
> Common:
> 1. Declare the interface
> 2. Activator does not have any code
>
> Client's activator:
> Within start method-
> new RemoteServiceFactory().createAndRegisterProxy(IUsageLogger.c lass,
> "http://localhost:8080/hessian" + IUsageLogger.WS_ID,
> "hessian", context);
>
> Inject.service(IUsageLogger.class).into(this).andStart(conte xt);
>
> if (loggerService != null) {
> loggerService.log("At least now");
> System.out.println("loggerService invoked from client");
> } else {
> System.out.println("loggerService is not injected");
> }
>
> When I run the client, the client bundle is in resolved state. When I
> start, the trace is like this.
>
> java.lang.IllegalArgumentException: interface com.vel.udc.IUsageLogger
> is not visible from class loader
> at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
> at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
> at
> com.caucho.hessian.client.HessianProxyFactory.create(Hessian ProxyFactory.java:394)
>
> at
> com.caucho.hessian.client.HessianProxyFactory.create(Hessian ProxyFactory.java:354)
>
>
> I am using the target downloaded from Riena RC2.
>
Re: Classloading issue [message #578428 is a reply to message #20459] Sun, 01 February 2009 15:22 Go to previous message
Velganesh Subramanian is currently offline Velganesh Subramanian
Messages: 67
Registered: July 2009
Member
Thanks Christian. I could make it work. I am curious to know on what
basis I need to add the plugins in 'Run Configuration'. When I choose my
plugin alone and press 'Select Required', the list is not sufficient to
run the client or server. This will lead to a problem when packaging a
product. Will you please guide?
Re: Classloading issue [message #578499 is a reply to message #20466] Tue, 03 February 2009 12:01 Go to previous message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
Vel schrieb:
> Thanks Christian. I could make it work. I am curious to know on what
> basis I need to add the plugins in 'Run Configuration'. When I choose my
> plugin alone and press 'Select Required', the list is not sufficient to
> run the client or server. This will lead to a problem when packaging a
> product. Will you please guide?
my recommendation is that you use the global bundle org.eclipse.riena.client for your client and
org.eclipse.riena.server for your server. Now if you press "add required bundles" you
should be fine.

However having said this, riena.client implies that you write a client with riena remote services, the ridgets, the ui
and everything. So maybe that is too much for you.

So if doesnt work for you, give me some examples of what bundles are missing when you click "Add Required"

christian
Re: Classloading issue [message #578561 is a reply to message #20489] Tue, 03 February 2009 12:41 Go to previous message
Eclipse User
Originally posted by: ekkehard.gentz-software.de

Christian Campo schrieb:
> Vel schrieb:
>> Thanks Christian. I could make it work. I am curious to know on what
>> basis I need to add the plugins in 'Run Configuration'. When I choose
>> my plugin alone and press 'Select Required', the list is not
>> sufficient to run the client or server. This will lead to a problem
>> when packaging a product. Will you please guide?
> my recommendation is that you use the global bundle
> org.eclipse.riena.client for your client and org.eclipse.riena.server
> for your server. Now if you press "add required bundles" you
> should be fine.
>
> However having said this, riena.client implies that you write a client
> with riena remote services, the ridgets, the ui and everything. So maybe
> that is too much for you.
>
> So if doesnt work for you, give me some examples of what bundles are
> missing when you click "Add Required"
>
> christian
I always do this without riena.client and riena.server
to understand the riena server and client its worth to look into the
Manifest files to see whats required

and a good way to play around is using OSGI launchers, add the bundle
you think you need, then hit "Validate bundles" it gives you hints which
bundle needs something more

OSGI is great with bundles and dependencies, but you must be carefully
while integrating some frameworks like Riena.

I also always try to remove as much "required-bundle" dependencies and
replace them with "package-import" statements whch is more flexible, but
also more work to do

my 2c

ekke
Re: Classloading issue [message #578626 is a reply to message #20513] Thu, 05 February 2009 13:24 Go to previous message
Velganesh Subramanian is currently offline Velganesh Subramanian
Messages: 67
Registered: July 2009
Member
I made a list of active bundles by looking at the status after running
Ping Pong client and server. It works without any problems.
Previous Topic:Riena BOF at Eclipse Con 2009
Next Topic:How safe is to send two parameters of the same type?
Goto Forum:
  


Current Time: Thu Oct 30 16:58:28 GMT 2014

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

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