Topic
2 replies Latest Post - ‏2010-07-06T13:58:26Z by SystemAdmin
SystemAdmin
SystemAdmin
126 Posts
ACCEPTED ANSWER

Pinned topic Accessing OSGI service exposed via SCA

‏2010-06-21T09:02:57Z |
I have an osgi service surfaced in an SCA component. The bla containing the eba and sca composite definition file starts up ok and composite information looks fine.

However when I try to use the service as a reference from another SCA component it can't find it. The SCA configuration all looks ok and within WAS I can view the domain details which reflects both components as I would expect:

<domain name="sinead-desktopNode01Cell" >
<component name="GatewayEBAComponent" mapTarget="WebSphere:cell=sinead-desktopNode01Cell,node=sinead-desktopNode01,server=server1" >
<service name="GatewayBroker" > </service>
<httpurlendpoints name="endpoints" uri="" />
</component>
<component name="GatewayClientComponent" mapTarget="WebSphere:cell=sinead-desktopNode01Cell,node=sinead-desktopNode01,server=server1" >
<service name="GatewayClient" >
<interface.java interface="com.cybersource.gateway.test.client.GatewayClient" />
</service>
<reference name="broker" target="GatewayEBAComponent/GatewayBroker" />
<httpurlendpoints name="endpoints" uri="" />
</component>
</domain>

However when I try to start the bla containing the client sca component I see the following error in the SystemOut.log:

16/06/10 12:30:55:936 BST 00000021 SCAContainerC I CWSOA0001I: The Service Component Architecture (SCA) composite is starting in the GatewayClientComposite application.
16/06/10 12:30:56:298 BST 00000021 ComponentRefe W Component reference target not found, it might be a remote service running elsewhere in the SCA Domain: Composite = {http://com.cybersource.gateway.client}GatewayClientComposite Service = GatewayEBAComponent/GatewayBroker

Is there anything additional I need to do to access the osgi service?

Does anyone have a sample app I can take a look at?

We've been using SCA for a while so this looks like it's particular to the OSGI/SCA interoperability.

Thanks,
Sinead
Updated on 2010-07-06T13:58:26Z at 2010-07-06T13:58:26Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    126 Posts
    ACCEPTED ANSWER

    Re: Accessing OSGI service exposed via SCA

    ‏2010-06-21T14:40:45Z  in response to SystemAdmin
    As I can't get an SCA reference to my component working I tried to look up the service using the CurrentCompositeContext. Should this work for OSGI services exposed through SCA components?

    When I try to access the service as follows:

    CompositeContext compCtx = CurrentCompositeContext.getContext();
    GatewayBroker broker = (GatewayBroker)compCtx.getService(GatewayBroker.class, "GatewayBroker");

    I get the following error:

    FFDC Exception:org.osoa.sca.ServiceRuntimeException SourceId:org.apache.tuscany.sca.core.context.CallableReferenceImpl ProbeId:193 Reporter:org.apache.tuscany.sca.core.context.ServiceReferenceImpl@648e648e
    org.osoa.sca.ServiceRuntimeException: org.osoa.sca.ServiceUnavailableException: Service GatewayBroker/GatewayBroker is installed but currently not available, could be stopped
    at org.apache.tuscany.sca.core.context.CallableReferenceImpl.getRuntimeWire(CallableReferenceImpl.java:161)
    at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.<init>(JDKInvocationHandler.java:104)
    at org.apache.tuscany.sca.core.invocation.JDKProxyFactory.createProxy(JDKProxyFactory.java:62)
    at org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createProxy(ExtensibleProxyFactory.java:74)
    at org.apache.tuscany.sca.core.context.CallableReferenceImpl.createProxy(CallableReferenceImpl.java:204)
    at org.apache.tuscany.sca.core.context.CallableReferenceImpl.getProxy(CallableReferenceImpl.java:191)
    at org.apache.tuscany.sca.core.context.CallableReferenceImpl.getService(CallableReferenceImpl.java:210)
    at com.ibm.websphere.sca.context.impl.CurrentCompositeContextImpl$CompositeContextImpl.getService(CurrentCompositeContextImpl.java:85)
    at com.ibm.websphere.sca.context.impl.CurrentCompositeContextImpl$CompositeContextImpl.getService(CurrentCompositeContextImpl.java:67)
    at com.cybersource.gateway.test.client.GatewayClientImpl.processRequest(GatewayClientImpl.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    However the bla containing my eba and the corresponding sca composite definition is up and running. Also when I access the aries console directly and view the bundle details I can see that the service I'm trying to access has been started.
  • SystemAdmin
    SystemAdmin
    126 Posts
    ACCEPTED ANSWER

    Re: Accessing OSGI service exposed via SCA

    ‏2010-07-06T13:58:26Z  in response to SystemAdmin
    IBM provided us with a working sample which we were able to use to get our EBA working. However we're not sure exactly which one of the changes made the difference. However it's worth noting that the error message in the SystemOut.log is still shown even when the reference is resolved. This had thrown us off a bit when diagnosing the problem.