Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 259480

Summary: [Discovery][JMDNS] Not all ServiceProperties are valid
Product: [RT] ECF Reporter: Markus Kuppe <bugs.eclipse.org>
Component: ecf.providersAssignee: Markus Kuppe <bugs.eclipse.org>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: slewis
Version: 2.1.0Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

Description Markus Kuppe CLA 2008-12-22 06:00:57 EST
JMDNS currently only accepts String and byte[] values as org.eclipse.ecf.discovery.ServiceProperties.

-- Error Log from JUnit --
Class: org.eclipse.ecf.tests.provider.jmdns.JMDNSDiscoveryServiceTest
Method: testConnect
Actual: null
Expected: null
Stack Trace:
java.lang.IllegalArgumentException: invalid property value: 2147483647
	at javax.jmdns.impl.ServiceInfoImpl.<init>(ServiceInfoImpl.java:123)
	at javax.jmdns.ServiceInfo.create(ServiceInfo.java:57)
	at org.eclipse.ecf.provider.jmdns.container.JMDNSDiscoveryContainer.createServiceInfoFromIServiceInfo(JMDNSDiscoveryContainer.java:483)
	at org.eclipse.ecf.provider.jmdns.container.JMDNSDiscoveryContainer.unregisterService(JMDNSDiscoveryContainer.java:249)
	at org.eclipse.ecf.tests.discovery.DiscoveryTest.tearDown(DiscoveryTest.java:157)
	at junit.framework.TestCase.runBare(TestCase.java:136)
	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 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:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	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(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:574)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:195)
	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:386)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Comment 1 Markus Kuppe CLA 2008-12-22 06:05:52 EST
Workarounds have been added to:

org.eclipse.ecf.tests.provider.jmdns.JMDNSDiscoveryServiceTest.setUp()
org.eclipse.ecf.tests.provider.jmdns.remoteservice.JMDNSRemoteServiceDiscoveryTest.setUp()
Comment 2 Markus Kuppe CLA 2008-12-22 06:06:38 EST
(Test-)Workaround released to HEAD and Release_2_1
Comment 3 Markus Kuppe CLA 2008-12-22 06:06:42 EST
Created attachment 121055 [details]
mylyn/context/zip
Comment 4 Markus Kuppe CLA 2009-02-16 03:00:11 EST
Here is how this influences the discovery tests.

org.eclipse.ecf.tests.provider.discovery.CompositeDiscoveryContainerTest.testGetServices
Error Message

invalid property value: org.eclipse.ecf.discovery.ServiceProperties$ByteArrayWrapper@30700edc

Stacktrace

java.lang.IllegalArgumentException: invalid property value: org.eclipse.ecf.discovery.ServiceProperties$ByteArrayWrapper@30700edc
	at javax.jmdns.impl.ServiceInfoImpl.<init>(ServiceInfoImpl.java:123)
	at javax.jmdns.ServiceInfo.create(ServiceInfo.java:57)
	at org.eclipse.ecf.provider.jmdns.container.JMDNSDiscoveryContainer.createServiceInfoFromIServiceInfo(JMDNSDiscoveryContainer.java:508)
	at org.eclipse.ecf.provider.jmdns.container.JMDNSDiscoveryContainer.registerService(JMDNSDiscoveryContainer.java:233)
	at org.eclipse.ecf.provider.discovery.CompositeDiscoveryContainer.registerService(CompositeDiscoveryContainer.java:292)
	at org.eclipse.ecf.tests.discovery.DiscoveryTest.registerService(DiscoveryTest.java:168)
	at org.eclipse.ecf.tests.discovery.DiscoveryTest.testGetServices(DiscoveryTest.java:254)
	at org.pluginbuilder.autotestsuite.application.AutoTestRunner.run(AutoTestRunner.java:115)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runAllJUnit3Tests(AutoTestApplication.java:151)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runAllJUnitTests(AutoTestApplication.java:134)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runHeadless(AutoTestApplication.java:124)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.run(AutoTestApplication.java:70)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.start(AutoTestApplication.java:44)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
	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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:556)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:511)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1270)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1246)
	at org.eclipse.core.launcher.Main.main(Main.java:30)
Comment 5 Markus Kuppe CLA 2009-02-25 09:15:53 EST
Fixed in HEAD by serializing non string properties.