AssertError when running with Assertions on

We have created our own VaadinSpringServlet which extens VaadinServlet

In it we have the following method.

@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
super.service(request, response);
ConnectApplicationContext.clear();
}

When we run this with Assertions on (java -ea …) we get the below error.

Some of the blogs I have read are indicating that I shold get a lock before making the call.

Others suggest that this is not required. Just need some guindance.

java.lang.AssertionError

at com.vaadin.server.VaadinSession.getAttribute(VaadinSession.java:1093)

at com.vaadin.spring.server.SpringVaadinServlet.saveParameters(SpringVaadinServlet.java:159)

at com.vaadin.spring.server.SpringVaadinServlet.createVaadinRequest(SpringVaadinServlet.java:131)

at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:347)

Yes, the thread should have the lock which is why you get the exception. The thing is, it should happen automatically. You can lock it yourself from the VaadinSession, but getting access to the session object is tricky.

Any reason why you aren’t using our official Spring add-ons instead?