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

Bug 329020

Summary: Fail faster when publishing disallowed services
Product: [RT] Riena Reporter: Stephan Mann <stephan.mann>
Component: communicationAssignee: Project Inbox <riena.core-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: Stefan.Liebig
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Stephan Mann CLA 2010-10-29 05:17:08 EDT
If a user tries to publish a service with overloaded methods, he will see a log message like this:

Fri Oct 29 11:04:25 CEST 2010 ERROR [Start Level Event Dispatcher] org.eclipse.riena.communication.publisher.ServicePublishBinder cannot publish protocol=hessian, url=null, interface=de.compeople.services.IService because its interface contains multiple methods with the same name.That is not allowed for remote services (even if they have a different signature).

While the message is very descriptive, it is easy to overlook and there are no further problems until the service is called, which might be much later. The exception that is thrown in this case is not helpful at all: (Note that the method called in this case is not an overloaded method but could be any method that is not overloaded.)

Caused by: java.io.FileNotFoundException: http://localhost:8080/hessian/IService?getEntity&RID-ezkguudw
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
	at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:168)
	... 73 more

In my opinion, the server should not start with such a service. There should be an exception rather than a warning.
Comment 1 Stephan Mann CLA 2010-10-29 05:39:03 EDT
Just to clarify: I'm using org.eclipse.riena.communication.publisher.Publish to publish the service which, as far as I know, is the recommended way to do this in Riena. I would expect a RuntimeException if Publish fails. It is true that I can't really handle this exception but the error would be much more prominent.
Comment 2 Stefan Liebig CLA 2010-10-29 05:48:14 EDT
There is already the method assertServiceConstraints() within the RemoteServiceDescription class, which is not activated (not yet called). This method throws a RemoteFailure when conflicts are detected. 
The statements calling this method are all in comments.

Maybe this would solve this issue?