eclipsespringhierarchyvaadinconfigurable

Eclipse The hierarchy of the type ... is inconsistent with @Configurable annotation


I am developing a Spring/Vaadin/Hibernate application.

Everything works but I still have the following error markers in Eclipse STS 2.8.1:

The hierarchy of the type BankView is inconsistent
The hierarchy of the type AbstractEntityView is inconsistent

I have the following structure for my views:

public class BankView extends AbstractEntityView {  
    @Resource private BankService bankService;

    public void buildLayout() {
        super.buildLayout();

        // Use of the service here
    }
}

public abstract class AbstractEntityView extends AbstractView {  
    public void buildLayout() {
         verticalLayout = new VerticalLayout();
         verticalLayout.setSpacing(true);
         verticalLayout.setSizeFull();
         setContent(verticalLayout);
         super.buildLayout();
    }
}

@Configurable(preConstruction = true)
public abstract class AbstractView extends com.vaadin.ui.VerticalLayout {  
    public AbstractView() {
        super();
        try {
                buildLayout();
        }
        catch (AccessDeniedException e) { // Spring Security
                System.out.println("GTFO !");
        }
    }
}

What is causing these error markers?


Solution

  • In fact the problem was because I made AbstractListView @Configurable. When I put this annotation on the final class (for example BankView), all the errors disappeared.

    Thanks everyone for the help. If someone has the same error they will find a solution in the different answers.