VaadinServlet and Jetty

Hi all,

I’ve been happily using V6 for a couple of years and recently started dabbling with V7, with plans to slowly port my code to it. However, I’m having issues with VaadingServlet and Jetty so I’m thinking someone could have a clue to this problem.

The original application was bundling Jetty and Vaadin in a single jar (no web.xml as options were hardcoded); I subclassed
ApplicationServlet
, reimplementing
getNewApplication()
; this setup worked as charm. Now, I’m aware things are changed in V7 and I’m kinda lost here, so I followed Seam integration sample (
https://community.jboss.org/thread/222297?_sscc=t
) and managed to get UI to display the content.

But after application reload, I’m getting:

2014-06-07 23:49:01.881:WARN::/ com.vaadin.server.ServiceException: java.lang.IllegalStateException: This UI instance is already initialized (as UI id 0) and can therefore not be initialized again (as \ UI id 1). Please make sure you are not accidentally reusing an old UI instance. at com.vaadin.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1463) at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1417) at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:23 This exception is always thrown after reload; initial application display working as expected.

Any ideas how to prevent reinitializing UI inside
createServletService()
or
sessionInit()
? Or maybe I’m doing things completely wrong… :slight_smile:

Thanks in advance,
Sanel

Could you post (or push it into GitHub) little bit more code or even simplified test application where you have the issues? It would be easier to see what is going wrong there…

Hi Johannes,

Sorry for late reply; got very busy last two months. The good thing is that I managed to solve it by using
LegacyVaadinServlet
,
LegacyWindow
and
LegacyApplication
; I stumbled on these classes by accident, crawling through 7.x API.

When I catch some time I’ll try again with
UI
and
VaadinServlet
classes and will hopefully have something to show.

Thanks for reply!

Best,
Sanel