Community
Participate
Working Groups
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.
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.
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?