Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] ECF3.2 using Spring

Hi Scott
  Thanks a lot for your response
I have 3 osgi bundles  Consumer bundle,Remote Interface Bundle(contain the raw remote interface) and RemoteService bundle(containing the implementation of remote interface)

consumer and remote interface bundle is running in client machine and RemoteService ,remote interface bundles running in server machine.

from consumer bundle i am making a remote service call ..which is sucessful .In both the side i am able to see proxy bundle geting created.

then i stopped the RemoteService bundle from osgi console(using command -  stop  80(bundle no)) .I am able to see proxy bundles are geting removed from both the sides.(client and server machine's osgi).

Now i started the server bundle using command  start 80(bundle no of RemoteService bundle).And a new proxy bundle gets created in both the side.But surprisingly when my consumer bundle failed to make the service call again.While debugging i found discovery is happening in client osgion restart of RemoteService bundle ....and reregistering is failing as the new modified service doesnt have service.uri   which was being checked by FilterImpl class and failing to register the newly up bundle because of this.I am not sure whether this is the problem.I changed the ChannelEndpointImpl 

old code

case LeaseUpdateMessage.SERVICE_MODIFIED: {
final Dictionary newProps = (Dictionary) suMsg.getPayload()[1];
final ServiceRegistration reg = (ServiceRegistration) proxiedServices
.get(serviceID);
if (reg != null) {
reg.setProperties(newProps);
}

final RemoteServiceReferenceImpl ref = getRemoteReference(getRemoteAddress()
.resolve("#" + serviceID).toString()); //$NON-NLS-1$
ref.setProperties(newProps);
RemoteOSGiServiceImpl
.notifyRemoteServiceListeners(new RemoteServiceEvent(
RemoteServiceEvent.MODIFIED, ref));
return null;
}


my changes:

case LeaseUpdateMessage.SERVICE_MODIFIED: {
final Dictionary newProps = (Dictionary) suMsg.getPayload()[1];
final ServiceRegistration reg = (ServiceRegistration) proxiedServices
.get(serviceID);
if (reg != null) {
reg.setProperties(newProps);
}

final RemoteServiceReferenceImpl ref = getRemoteReference(getRemoteAddress()
.resolve("#" + serviceID).toString()); //$NON-NLS-1$
                                 ///--------------------------------- newProps doesnt have service.uri  --------------------------
                                 String uri = getRemoteAddress().resolve("#" + serviceID);
                                newProps.put(RemoteOSGiService.SERVICE_URI, uri.toString());
ref.setProperties(newProps);
                                 /////--------------------------------------code added ----------------------------------------------------
RemoteOSGiServiceImpl
.notifyRemoteServiceListeners(new RemoteServiceEvent(
RemoteServiceEvent.MODIFIED, ref));
return null;
}


After this changes sometimes service call became successful but sometimes its throwing Serialization exception .I am shocked how this change is impacting it...Please suggest how to go with fixing this problem


Thanks in advance

Ab

On Sat, May 8, 2010 at 7:13 PM, Scott Lewis <slewis@xxxxxxxxxxxxx> wrote:
Hi Abhisek,


abhisek saikia wrote:
Hi all
 I am using ecf3.2 and r-osgi as provider.I am able to inject the remote service through spring and able to estublish the remote call from client to server.But when i stop the server bundle and start it again,a new proxy is geting created with new fragment,but the service calls started failing.Any idea how to solve this?

A couple of questions to help understand what's going on here.

When you say 'stop the server bundle', what/which bundle(s) are you referring to?  How do you stop this/these bundles?  (e.g. console, via Spring, etc)?

I'm not familiar with the details of Spring's handling of unregistering services (remote or otherwise)...is there some way to have Spring call  the remote service's ServiceRegistration.unregister() during server shutdown?  Is it doing this?

On the proxy side...do both the old proxy and new proxy fail?  Do they fail with the same/any exception?  If it is generating an exception could you report that exception here?  Thanksinadvance.

BTW, since 3.2 we've changed the proxy policy for automatic container creation (i.e. bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=303979) and this may make integration with Spring even easier...because no ECF-specific code is needed (even in the default case) to get container creation on the consumer/proxy.  This will be in ECF 3.3/Helios.

Thanks,

Scott

_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev


Back to the top