migrating vaadin 6 to vaadin 7

Hi,

I am trying to migrate our vaadin 6.8.12 application to vaadin 7.0.7 with the help of the LegacyApplication (and LegacyWindow) class.
Part of the application compiles, but starting the application fails.

As far as I know I changed web.xml as described in the migration guide, but I still get the error:

ServletException: … does not implement UI

Should I change LegacyApplication to UI first?

Regards,
Joost

How did you change your web.xml because if you added the ui param it will expect a UI class and not a LegacyApplication class?
Generally i would suggest you to migrate your app directly to UI. It’s not a big change and it will not get you in trouble like the legacy one eventually could.

Hi Marius, thanks for your quick response.

I changed vaadin.terminal.gwt.server.ApplicationServlet into com.vaadin.server.VaadinServlet
and
parameter application into UI
(as specified in the migration guide).

If I don’t change web.xml I get the error
Wrapper cannot find servlet class com.vaadin.terminal.gwt.server.ApplicationServlet or a class it depends on
so I assumed these changes to be required.

Joost

The part with changing from ApplicationServlet to vaadinServlet should be fine but when using a class extending LegacyApplication instead of UI you probably shouldn’t map it to a parameter with the name ui. I don’t use LegacyApplication myself and i would recommend you to switch to UI too but when you insist on using it, you should map it to a parameter called something like “application” (like it was before) or “legacyapplication”.
Again, i never tried this out myself so i’m not sure if that’s the right name.

Only changing ApplicationServlet to vaadinServlet gives the error:
com.vaadin.server.ServiceException: No UIProvider has been added and there is no “UI” init parameter.
No matter whether I use application (as before), legacyapplication (as migt be expected) I get the previously mentioned error.

And yes, I considered changing to UI immediately but my application needs too many changes, so I considered this two phase migration as an alternative …

I just had a look at the JavaDoc for the LegacyApplication class
here
and it seems like there is a LegacyVaadinServlet and LegacyApplicationUIProvider so try using them instead of the normal UI ones.

Hi,

To use LegacyApplication, you use the same “application” init parameter as in Vaadin 6. A basic V6 application should work simply by changing the servlet class in web.xml to com.vaadin.server.LegacyVaadinServlet and changing the Application subclass to extend LegacyApplication instead.

OK, LegacyVaadinServlet is definitely a step in the right direction (with parameter_application = application).
Thanks.

Now however it fails on

Failed to load the widgetset: ./VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/com.vaadin.DefaultWidgetSet.nocache.js?1376311793305

At least some progress …

It seems that I found the solution for the previous problem: add vaadin-client-compiled jar as dependency.