Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Problem with Remote Services

Hi Wojciech,

Wojciech Galanciak wrote:
I found a small bug in filter declaration:
context.createFilter("(&("+org.osgi.framework.Constants.OBJECTCLASS+"=" + IHello.class.getName() +")(" + REMOTE + "=*))");
There should be REMOTE_INTEFACE instead of REMOTE.

Thanks.

Can you explain how to run consumer and host applications on two machines?

I believe the likely problem here is that the r-OSGi instance *within Eclipse* is starting and grabbing 9278 (for the host), and then the r-osgi on the host app must use 9279, so the consumer can't reach the host (but rather reaches the r-OSGi instance running within Eclipse....which isn't running any remote services).

I will try to get some workaround information into the wiki today on the getting started page. Basically, it means disabling the r-OSGi instance automatically running within Eclipse.

Scott

I suppose that I should change container creating in consumer activator: ContainerFactory.getDefault().createContainer("ecf.r_osgi.peer", new Object[] { IDFactory.getDefault().createStringID("r-osgi://localhost:9278") }); where localhost should be an address of the machine where host is running but it doesn't work.

2009/6/1 Scott Lewis <slewis@xxxxxxxxxxxxxxxxx <mailto:slewis@xxxxxxxxxxxxxxxxx>>

    Hello Wojciech,

    Thanks for the report.

    The 'error' (i.e. No IDiscoveryAdvertiser available to handle this
    publication) is/was changed to warning as per this bug:

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=278149.  All it
    indicates is that there is no container available within the host
    process to receive the proxy create notification.  It's not an
    actual error.

    The conflict you are seeing when running both consumer and host on
    the same machine is most likely a port-level conflict with r-OSGi.
     r-OSGi tries to use port 9278 by default and if an instance is
    already running on the host (e.g. within Eclipse), then running
    the example consumer and client will conflict, and things won't work.

    I need to add documentation to this effect on the wiki...and to
    provide workarounds for single-host testing.

    There is also this bug report
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=267521 germane to
    this issue.

    Scott

    Wojciech Galanciak wrote:


        I didn't recognize that client doesn't work. When I run
        customer and host on the same machine it works only if I change:
        helloServiceTracker = new
        ServiceTracker(context,createRemoteFilter(),this) to
        helloServiceTracker = new ServiceTracker(context,
        IHello.class.getName(), this). If I try to connect with remote
        service consumer does nothing. When I run host I see
        information below:

        [log;+0200 2009.06.01
        12:58:41:531;ERROR;org.eclipse.ecf.osgi.services.discovery;org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.discovery;code=4;message=handleServicePublication:ignoring
        {org.osgi.service.discovery.ServicePublication}={osgi.remote.discovery.publication.service.properties={},
        ecf.rsvc.ns=ecf.namespace.r_osgi.remoteservice,
        osgi.remote.service.interfaces=[org.eclipse.ecf.examples.remoteservices.hello.IHello],
        ecf.rsvc.id <http://ecf.rsvc.id> <http://ecf.rsvc.id>=[52,54],
        ecf.sp.cid=r-osgi://LENOVO-C361DC82:9278, service.id
        <http://service.id> <http://service.id>=47}. No
        IDiscoveryAdvertiser available to handle this
        publication;severity4;exception=null;children=[]]]


        Host: Hello Service Registered

        The same error I have during each of tests in
        org.eclipse.ecf.tests.osgi.services.distribution r-osgi tests.

        2009/5/30 Wojciech Galanciak <wojciech.galanciak@xxxxxxxxx
        <mailto:wojciech.galanciak@xxxxxxxxx>
        <mailto:wojciech.galanciak@xxxxxxxxx
        <mailto:wojciech.galanciak@xxxxxxxxx>>>


           Consumer:
           <?xml version="1.0" encoding="UTF-8" standalone="no"?>
           <launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
           <booleanAttribute key="append.args" value="true"/>
           <booleanAttribute key="automaticAdd" value="false"/>
           <booleanAttribute key="automaticValidate" value="false"/>
           <stringAttribute key="bootstrap" value=""/>
           <stringAttribute key="checked" value="[NONE]"/>
           <booleanAttribute key="clearConfig" value="false"/>
           <stringAttribute key="configLocation"
value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Hello
           Service Consumer"/>
           <booleanAttribute key="default_auto_start" value="true"/>
           <intAttribute key="default_start_level" value="4"/>
           <booleanAttribute key="includeOptional" value="true"/>
           <stringAttribute
        key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"
           value="-os ${target.os} -ws ${target.ws <http://target.ws>
        <http://target.ws>} -arch
           ${target.arch} -nl ${target.nl <http://target.nl>
        <http://target.nl>} -console"/>

           <stringAttribute
           key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"
           value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
           <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
           value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true"/>
           <stringAttribute key="pde.version" value="3.3"/>
           <booleanAttribute key="show_selected_only" value="false"/>
           <stringAttribute key="target_bundles"
value="org.eclipse.equinox.common@2:true,org.eclipse.ecf@default:default,org.objectweb.asm@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.jobs@default:default,org.eclipse.ecf.identity@default:default,javax.servlet@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.runtime.compatibility.registry@default:false"/>
           <booleanAttribute key="tracing" value="false"/>
           <booleanAttribute key="useDefaultConfigArea" value="true"/>
           <stringAttribute key="workspace_bundles"
value="org.eclipse.ecf.osgi.services.distribution@default:default,org.eclipse.ecf.provider.jslp@default:default,ch.ethz.iks.slp@default:default,org.eclipse.ecf@default:default,ch.ethz.iks.r_osgi.remote@default:default,org.eclipse.ecf.sharedobject@default:default,org.eclipse.ecf.remoteservice@default:default,org.eclipse.ecf.osgi.services.discovery@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.jmdns@default:default,org.eclipse.ecf.provider.r_osgi@default:default,org.eclipse.ecf.osgi.services@default:default,org.eclipse.ecf.examples.remoteservices.hello.consumer@default:true,org.eclipse.ecf.examples.remoteservices.hello@default:default,org.eclipse.ecf.discovery@default:default,org.eclipse.ecf.provider@default:default"/>
           </launchConfiguration>

           Host:
           <?xml version="1.0" encoding="UTF-8" standalone="no"?>
           <launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
           <booleanAttribute key="append.args" value="true"/>
           <booleanAttribute key="automaticAdd" value="false"/>
           <booleanAttribute key="automaticValidate" value="false"/>
           <stringAttribute key="bootstrap" value=""/>
           <stringAttribute key="checked" value="[NONE]"/>
           <booleanAttribute key="clearConfig" value="false"/>
           <stringAttribute key="configLocation"
value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Hello
           Service Host"/>
           <booleanAttribute key="default_auto_start" value="true"/>
           <intAttribute key="default_start_level" value="4"/>
           <booleanAttribute key="includeOptional" value="true"/>
           <stringAttribute
        key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"
           value="-os ${target.os} -ws ${target.ws <http://target.ws>
        <http://target.ws>} -arch
           ${target.arch} -nl ${target.nl <http://target.nl>
        <http://target.nl>} -console"/>

           <stringAttribute
           key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"
           value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
           <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
           value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true"/>
           <stringAttribute key="pde.version" value="3.3"/>
           <booleanAttribute key="show_selected_only" value="false"/>
           <stringAttribute key="target_bundles"
value="org.eclipse.equinox.common@2:true,org.eclipse.ecf@default:default,org.objectweb.asm@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.jobs@default:default,org.eclipse.ecf.identity@default:default,javax.servlet@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.runtime.compatibility.registry@default:false"/>
           <booleanAttribute key="tracing" value="false"/>
           <booleanAttribute key="useDefaultConfigArea" value="true"/>
           <stringAttribute key="workspace_bundles"
value="org.eclipse.ecf.osgi.services.distribution@default:default,org.eclipse.ecf.provider.jslp@default:default,ch.ethz.iks.slp@default:default,org.eclipse.ecf@default:default,ch.ethz.iks.r_osgi.remote@default:default,org.eclipse.ecf.sharedobject@default:default,org.eclipse.ecf.remoteservice@default:default,org.eclipse.ecf.osgi.services.discovery@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.jmdns@default:default,org.eclipse.ecf.examples.remoteservices.hello.host@default:true,org.eclipse.ecf.provider.r_osgi@default:default,org.eclipse.ecf.osgi.services@default:default,org.eclipse.ecf.examples.remoteservices.hello@default:default,org.eclipse.ecf.discovery@default:default,org.eclipse.ecf.provider@default:default"/>
           </launchConfiguration>


           2009/5/28 Scott Lewis <slewis@xxxxxxxxxxxxxxxxx
        <mailto:slewis@xxxxxxxxxxxxxxxxx>
           <mailto:slewis@xxxxxxxxxxxxxxxxx
        <mailto:slewis@xxxxxxxxxxxxxxxxx>>>


               Hi Wojciech,

               Would you consider contributing back your launch
        configs for
               the host and consumer?  Since I've been working with the
               bundles in my workspace, the existing launch configs don't
               work (as you discovered)...and it would be much better
        to have
               'clean' launch configs.

               If you wouldn't mind doing this, would you open a bug
        report
               and attach the launch configs to that bug report?

               Thanks much in advance,

               Scott


               Wojciech Galanciak wrote:

                   Thanks for all responses, it works.

                   2009/5/28 Scott Lewis <slewis@xxxxxxxxxxxxxxxxx
        <mailto:slewis@xxxxxxxxxxxxxxxxx>
                   <mailto:slewis@xxxxxxxxxxxxxxxxx
        <mailto:slewis@xxxxxxxxxxxxxxxxx>>
                   <mailto:slewis@xxxxxxxxxxxxxxxxx
        <mailto:slewis@xxxxxxxxxxxxxxxxx>

                   <mailto:slewis@xxxxxxxxxxxxxxxxx
        <mailto:slewis@xxxxxxxxxxxxxxxxx>>>>


                      Wojciech,

                      This indicates that the container type that you are
                   creating (in
                      this case r-osgi) is not present in your runtime
                   configuration.
                       To use r-osgi provider you need:

                      org.eclipse.ecf.provider.r-osgi
                      ch.ethz.iks.r_osgi.remote
                      org.objectweb.asm

                      I've opened this bug to improve the exception
        message
                   so that this
                      is clearer:
                    https://bugs.eclipse.org/bugs/show_bug.cgi?id=278222

                      Thanks,

                      Scott

                      Wojciech Galanciak wrote:


                          Hi,

                          I tried to run tests form
org.eclipse.ecf.tests.osgi.services.distribution but
                          unfortunately it threw:
                          org.eclipse.ecf.core.ContainerCreateException:
                          ContainerTypeDescription cannot be null at
org.eclipse.ecf.core.ContainerFactory.throwContainerCreateException(ContainerFactory.java:218)
                          at
org.eclipse.ecf.core.ContainerFactory.createContainer(ContainerFactory.java:267)
                          at
org.eclipse.ecf.core.ContainerFactory.createContainer(ContainerFactory.java:299)
                          at
org.eclipse.ecf.tests.osgi.services.distribution.r_osgi.R_OSGiServiceRegisterTest.createServer(R_OSGiServiceRegisterTest.java:47)
                          at
org.eclipse.ecf.tests.ContainerAbstractTestCase.createServerAndClients(ContainerAbstractTestCase.java:194)
                          at
org.eclipse.ecf.tests.osgi.services.distribution.r_osgi.R_OSGiServiceRegisterTest.setUp(R_OSGiServiceRegisterTest.java:30)
                          at
                   junit.framework.TestCase.runBare(TestCase.java:128) at
junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124)
                          at
                   junit.framework.TestResult.run(TestResult.java:109) at
junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                          at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                          at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
                          at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
                          at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
                          at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
                          at
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23)
                          at
                   sun.reflect.NativeMethodAccessorImpl.invoke0(Native
        Method)
                          at
                   sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
        Source)
                          at
                   sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
                          Source) at
        java.lang.reflect.Method.invoke(Unknown
                   Source) at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:574)
                          at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
                          at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
                          at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
                          at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
                          at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
                          at
                   sun.reflect.NativeMethodAccessorImpl.invoke0(Native
        Method)
                          at
                   sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
        Source)
                          at
                   sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
                          Source) at
        java.lang.reflect.Method.invoke(Unknown
                   Source) at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
                          at
org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
                          at
org.eclipse.equinox.launcher.Main.run(Main.java:1311) at org.eclipse.equinox.launcher.Main.main(Main.java:1287)


                          I have the same situation with
org.eclipse.ecf.examples.remoteservices.hello.consumer/client
                          example. I didn’t modify any code. Probably it’s
                   very easy to
                          resolve but it’s my first touch with ECF.

------------------------------------------------------------------------



                          _______________________________________________
                          ecf-dev mailing list
                          ecf-dev@xxxxxxxxxxx
        <mailto:ecf-dev@xxxxxxxxxxx> <mailto:ecf-dev@xxxxxxxxxxx
        <mailto:ecf-dev@xxxxxxxxxxx>>
                   <mailto:ecf-dev@xxxxxxxxxxx
        <mailto:ecf-dev@xxxxxxxxxxx> <mailto:ecf-dev@xxxxxxxxxxx
        <mailto:ecf-dev@xxxxxxxxxxx>>>


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


                      https://dev.eclipse.org/mailman/listinfo/ecf-dev


------------------------------------------------------------------------

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



        ------------------------------------------------------------------------

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

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


------------------------------------------------------------------------

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



Back to the top