You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Da...@empolis.com on 2008/09/17 18:29:36 UTC

Problems using implementation.osgi with binding.rmi

Hi all it's me again, but with something completely different :-)

I'm trying to combine implementation.osgi with binding.rmi. I have the
following component defined:

<component name="CrawlerControllerComponent">
    <t:implementation.osgi
bundleSymbolicName="org.eclipse.eilf.connectivity.framework"
classes="org.eclipse.eilf.connectivity.framework.impl.CrawlerControllerI
mpl"/>
    <service name="OSGiCrawlerController">
        <interface.java
interface="org.eclipse.eilf.connectivity.framework.CrawlerController" />
    </service>
    <reference name="crawlers" multiplicity="0..n"
target="FileCrawlerComponent WebCrawlerComponent"/>
    <reference name="connectivityManager"
target="ConnectivityManagerComponent">
        <tuscany:binding.rmi
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" host="localhost"
port="8099" serviceName="ConnectivityManagerRMI"/>
    </reference>					
</component>


The targets FileCrawlerComponent and WebCrawlerComponent are defined in
the same composite file, the ConnectivityManagerComponent is defined in
a separate composite file. When I start a SCADomain I get the following
warning:

17.09.2008 18:18:39
org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuild
erImpl
WARNUNG: Component reference target not found, it might be a remote
service running elsewhere in the SCA Domain: Composite =
{http://services}Services Service = ConnectivityManagerComponent
I guess this is quite ok as this component is remote and defined in
another composite file.

If I execute a method on a ServiceReference to
CrawlerControllerComponent the references are initialized. There I get
the following Exception on reference " connectivityManager":

java.lang.NullPointerException
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiImplementationPro
vider.resolveBundle(OSGiImplementationProvider.java:936)
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiImplementationPro
vider.startBundle(OSGiImplementationProvider.java:401)
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiImplementationPro
vider.getScopeContainer(OSGiImplementationProvider.java:1092)
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiTargetInvoker.inv
okeTarget(OSGiTargetInvoker.java:95)
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiTargetInvoker.inv
oke(OSGiTargetInvoker.java:190)
	at
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABind
ingInvoker.java:61)
	at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:287)
	at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:154)
	at $Proxy39.startCrawl(Unknown Source)
	at
org.eclipse.eilf.connectivity.framework.sca.ScaDomainActivator.start(Sca
DomainActivator.java:72)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleC
ontextImpl.java:999)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivato
r(BundleContextImpl.java:993)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleC
ontextImpl.java:974)
	at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHo
st.java:346)
	at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractB
undle.java:350)
	at
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framewor
k.java:1118)
	at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles
(StartLevelManager.java:634)
	at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(Start
LevelManager.java:508)
	at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLev
el(StartLevelManager.java:282)
	at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent
(StartLevelManager.java:468)
	at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventMana
ger.java:195)
	at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventMa
nager.java:297)
org.apache.tuscany.sca.core.factory.ObjectCreationException:
org.apache.tuscany.sca.core.factory.ObjectCreationException:
java.lang.NullPointerException
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiImplementationPro
vider.startBundle(OSGiImplementationProvider.java:446)
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiImplementationPro
vider.getScopeContainer(OSGiImplementationProvider.java:1092)
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiTargetInvoker.inv
okeTarget(OSGiTargetInvoker.java:95)
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiTargetInvoker.inv
oke(OSGiTargetInvoker.java:190)
	at
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABind
ingInvoker.java:61)
	at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:287)
	at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:154)
	at $Proxy39.startCrawl(Unknown Source)
	at
org.eclipse.eilf.connectivity.framework.sca.ScaDomainActivator.start(Sca
DomainActivator.java:72)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleC
ontextImpl.java:999)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivato
r(BundleContextImpl.java:993)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleC
ontextImpl.java:974)
	at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHo
st.java:346)
	at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractB
undle.java:350)
	at
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framewor
k.java:1118)
	at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles
(StartLevelManager.java:634)
	at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(Start
LevelManager.java:508)
	at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLev
el(StartLevelManager.java:282)
	at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent
(StartLevelManager.java:468)
	at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventMana
ger.java:195)
	at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventMa
nager.java:297)
Caused by: org.apache.tuscany.sca.core.factory.ObjectCreationException:
java.lang.NullPointerException
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiImplementationPro
vider.resolveBundle(OSGiImplementationProvider.java:997)
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiImplementationPro
vider.startBundle(OSGiImplementationProvider.java:401)
	... 21 more
Caused by: java.lang.NullPointerException
	at
org.apache.tuscany.sca.implementation.osgi.runtime.OSGiImplementationPro
vider.resolveBundle(OSGiImplementationProvider.java:936)
	... 22 more

This happens because in OSGiImplementationProvider.java:936
wire.getTarget() returns null.
I tried <reference name="connectivityManager" multiplicity="0..1"
target="ConnectivityManagerComponent"> but the error remains.

I could accept such an exception when I call a method on the reference
and the Service is not available, but during initialization ?
At leats if I set multiplicity to 0..1 a missing reference should be no
problem.

Bye,
Daniel