migration to vaadin 7

Hi,
I have migrate my application from 6 to 7.
My main entry point is now a com.vaadin.ui.UI, I have replaced com.vaadin.Application and I have not used LegacyApplication…
Why are still used LegacyComponent and LegacyPaint??

Hi,

this is because not everything in Vaadin 7 has yet been migrated to use the new communication methods. I’m sure this will happen eventually, but in the meantime we just need to live with the deprecation warnings.

ok but now I have a problem with the combobox…
when I try to put an item in the combobox I have this error:

Nov 05, 2013 2:43:11 PM com.vaadin.server.DefaultErrorHandler doDefault
SEVERE:
java.lang.IllegalStateException: A connector should not be marked as dirty while a response is being written.
at com.vaadin.ui.ConnectorTracker.markDirty(ConnectorTracker.java:397)
at com.vaadin.server.AbstractClientConnector.markAsDirty(AbstractClientConnector.java:138)
at com.vaadin.ui.AbstractSelect.fireItemSetChange(AbstractSelect.java:1679)
at com.vaadin.ui.AbstractSelect.containerItemSetChange(AbstractSelect.java:1646)
at com.vaadin.ui.ComboBox.containerItemSetChange(ComboBox.java:447)
at com.vaadin.data.util.AbstractContainer.fireItemSetChange(AbstractContainer.java:242)
at com.vaadin.data.util.AbstractContainer.fireItemSetChange(AbstractContainer.java:228)
at com.vaadin.data.util.AbstractInMemoryContainer.filterAll(AbstractInMemoryContainer.java:405)
at com.vaadin.data.util.AbstractInMemoryContainer.addFilter(AbstractInMemoryContainer.java:500)
at com.vaadin.data.util.AbstractBeanContainer.addContainerFilter(AbstractBeanContainer.java:380)
at com.vaadin.ui.ComboBox.getOptionsWithFilter(ComboBox.java:368)
at com.vaadin.ui.ComboBox.paintContent(ComboBox.java:217)
at com.vaadin.server.LegacyPaint.paint(LegacyPaint.java:65)
at com.vaadin.server.communication.LegacyUidlWriter.write(LegacyUidlWriter.java:81)
at com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:106)
at com.vaadin.server.communication.UidlRequestHandler.writeUidl(UidlRequestHandler.java:149)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:97)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:37)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1371)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:724)

Please post the snippet of code that results in that exception. Without any code it’s impossible to say definitely what is wrong.

If I start a new project I have no problem, I have this error only after the migration…

I have already seen other posts like these:
http://dev.vaadin.com/ticket/12085
http://dev.vaadin.com/ticket/10544?cversion=0&cnum_hist=1

 @Override
    public Field<?> addComponent(String textfield, Boolean bind,
            AbstractField<?> field, int x, int y, int x2, int y2,
            Validator validator, Boolean required) {
        Field<?> f = super.addComponent(textfield, bind, field, x, y, x2, y2,
                validator, required);

        if (f != null) {
            if ((textfield.equals("customer") || textfield.equals("company"))
                    && f instanceof ComboBox) {
                ComboBox cmb = ((ComboBox) f);
                cmb.setReadOnly(false);
                cmb.setNullSelectionAllowed(false);
                cmb.setImmediate(true);
                cmb.setNewItemsAllowed(true);
                cmb.setNewItemHandler(new NewItemHandlerSelect(cmb));             
                cmb.setContainerDataSource(containerCompany);
                cmb.setItemCaptionMode(ItemCaptionMode.PROPERTY);
                cmb.setItemCaptionPropertyId("cname");

                ProfessionalExperience pro = ((BeanItem<ProfessionalExperience>) item)
                        .getBean();

                if (textfield.equals("company")) {
                    if (pro.getCompany() != null)
                        cmb.setValue(pro.getCompany());
                } else if (textfield.equals("customer")) {
                    if (pro.getCustomer() != null)
                        cmb.setValue(pro.getCustomer());
                }

                if (!super.editable)
                    cmb.setReadOnly(true);            
        }

        return f;
    }

The problem happen when sharing the same container between many components…
The solution is in the post
http://dev.vaadin.com/ticket/10544?cversion=0&cnum_hist=1

:bump: This issue is still open :wink:

But another problem related to this: When this problem appears the DefaultErrorHandler is handling this error. But I have set my custom error handler at my UI implementation.
You could say it’s because the tracker lost somehow the connection but the default error message is shown (“internal error”). Is there a even more global solution to set the error handler? I set the error handler at overridden method of com.vaadin.ui.UI.init(VaadinRequest)

Hm, maybe I have set the ErrorHandler at wrong position?
The problem is actually my custom error handler always work except at this specific situation. I don’t see a special background thread. It’s just a request to vaadin. Can someone help me?