Bug 329020 - Fail faster when publishing disallowed services
Summary: Fail faster when publishing disallowed services
Status: NEW
Alias: None
Product: Riena
Classification: RT
Component: communication (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-29 05:17 EDT by Stephan Mann CLA
Modified: 2010-10-29 05:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?