ServerRpc in Vaadin 7.1.1

After i updated my Project to Vaadin 7.1.1 i saw that there were some changes in regards to the way ServerRpcs are handled and i couldn’t find any documentation on it yet.

The main thing i discovered was that now there is no more ServerRpc class but several classes instead like the
ServerRpcHandler
and the
ServerRpcManager
.

Is the way to do Server-RPCs in 7.0.0 still valid with the exception that you have to use another class like the Handler (
wiki thread
)? Is there already a tutorial for the new way/new features in planing?

Best Regards,
M R

PS: So i just found out that the ServerRpc class still exist in Vaadin 7.1.1 i only forgot to declare my rpc as interface and not as class.
Still i’m wondering about the new mechanism/classes and would like to hear if there are any tutorials planned.

The user-facing side of the RPC mechanism shouldn’t have changed at all - the backend just got refactored. ServerRpcManager was already in 7.0; ServerRpcHandler was simply factored out from the old monolithic AbstractCommunicationManager. If you encounter any changes to API or behaviour compared to 7.0, please report them as bugs.

I do not know if this is the correct place, but, I cannot access the vaadin application. when I am hitting on button, I am getting following exception. I have seen a solution that says adding commons-io-2.2 zip solves the problem. But it did not solve the problem at all… Any help is appreciated.

Aug 07, 2013 7:36:08 PM com.vaadin.server.DefaultErrorHandler doDefault
SEVERE:
com.vaadin.server.ServerRpcManager$RpcInvocationException: Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:170)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)
at com.vaadin.server.communication.ServerRpcHandler.handleBurst(ServerRpcHandler.java:214)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:111)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:91)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:37)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1329)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:168)
… 25 more
Caused by: com.vaadin.event.ListenerMethod$MethodException: Invocation of method buttonClick in com.rockwell.perfmgr.ui.main.view.MainViewImpl failed.
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:528)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:167)
at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:968)
at com.vaadin.ui.Button.fireClick(Button.java:368)
at com.vaadin.ui.Button$1.click(Button.java:57)
… 30 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1911)
at com.rockwell.perfmgr.utility.PageLocationHelper.setPageLocation(PageLocationHelper.java:12)
at com.rockwell.perfmgr.ui.main.view.MainViewImpl.buttonClick(MainViewImpl.java:149)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
… 34 more

Thanks
Harshita

Here, the problem is clearly in your listener code (or in PageLocationHelper.setPageLocation() which it calls), which calls String.substring(…) with an invalid parameter value. Check your code or put a breakpoint there and use a debugger.

but, I am able to run the application on TOMEE in eclipse… I am able to connect to fat client which is jboss in my case. I have exported war from eclipse. did not use any build tool…

when I deploy the exported war in my tomee/webapps, I am able to deploy but cannot get login screen to connect to jboss. I have turned debug onfor my vaadin application… I dont remember what it said… I will post that tomorrow

Well your problem clearly lies in line 12 of your PageLocationHelper class. In that line you’re executing the substring and it is crashing.
At this point we can’t know what you’re trying to do in that line and as a result we have no idea why it’s not working when you deploy your war.

You need to read the code of your classes to find out why PageLocationHelper.setPageLocation(…) on line 12 can give an invalid index to String.toString(). The invalid value might come from MainViewImpl.buttonClick (the call is on line 149).
Look at those lines of your code
, that is where the answer (or at least a starting point for finding one) is.

Thanks Henri and Marius. I understood that something was not getting passed properly to the program. BUt I did not ask you guys my question properly. Sorry for that. When I am able to run on a TOMEE instance in my eclipse, why I am unable to get it when I deploy as a war. I h ad deploying problems since last week. It has been complaining about beans.xml in cdi jar and other jars. even then the case was same. I was not able to deploy. Finally we were able to find the reason(Extra JBOSS jars were added which were conflicting). Similarly, I just wondered if there could be any other problem that is making my program not able to send requests properly when deployed on server.

Thanks anyway. That was widgetset compilation problem I guess…

Thanks
Harshita