Migrating from GWT project to vaadin

Hello,

I have an old project that was using a wrapper for GWT, called GWT material design, which is much like Vaadin I believe, but not so very developed. As a consequence I now want to use Vaadin instead, because it seems much more well developed and documented. Because I do not simply which to redo all the functionality in the old project I have chosen to remove all dependencies that it has on GWT material design and exported a .jar file containing all the functionality.

Now to my issue. I have started working a bit with Vaadin in Eclipse using the Vaadin plugin and now have a basic vaadin project that uses GWT 2.8 and is able to run. However, when I add the .jar file to the classpath and use one of its classes and then rerun I get the following error:



java.lang.NoClassDefFoundError: com/google/gwt/core/client/GWTBridge
at se.alkit.stroke.client.AppControler.(AppControler.java:86)
at se.alkit.kol.MyUI.init(MyUI.java:42)
at com.vaadin.ui.UI.doInit(UI.java:733)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:216)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1464)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:381)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:225)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1174)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)

In other words, it seems that the server is trying to use GWT code designed for the client.

As I am very new to Maven and vaadin I am not entirely certain as to why it is compiled in this way. Should client and server side code not be compiled seperately? Very glad for all help I can get.

Attached you can see the project structure and maven dependencies I have.

32906.png
32907.png

According to the stacktrace it is your se.alkit.kol.MyUI.init(MyUI.java:42) class that causes the exception.
The vaadin method called at com.vaadin.ui.UI.doInit(UI.java:733) is abstract.

Can you post your MyUI Class?

Apperently we have missunderstood how Vaadin works and that it is mainly server-sided. The old project we had used gwt client dependencies so obviously when we try to use that code in Vaadin we get the error displayed above, since it is run on the server and not the client. As a consequence we have decided to migrate the GWT code by hand and not through a .jar file. We will also most likely be integrating our old server project that contains a lot of http servlets into the Vaadin project as it does not really make sense to have multiple server-sided projects for one application.

So if anyone who is new to Vaadin and is used to some other GWT based framework, like smartGWT, reads this: Vaadin is quite different in the sense that basicly everything it does is server-sided so you can’t use any client specific dependencies as easy as you would in smartGWT. However, since you are already server side, you don’t need to fiddle with data requests to any server (like you normally would client-side), just talk directly to your database.