setValue/select ComboBox get NullPointerException

Hi guys,

Im trying to programmatically select/setValue in a comboBox, but I have always the same:

at com.vaadin.ui.AbstractSingleSelect.setSelectedFromClient(
at com.vaadin.ui.AbstractSingleSelect$
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.vaadin.server.ServerRpcManager.applyInvocation(
at com.vaadin.server.ServerRpcManager.applyInvocation(
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(

Maybe Im doing something wrong, but when I add some items to the combobox and I want to set on as selected, than come this fail. Also when I added all of them, knowing that they are all inside with getDataProvider().getItems(), I make click on one of them, and come the same fail. So what am I doing wrong with this easy task?

Im just having some values from DB and only setting them with setItems(values). When I run the programm, I can see them in the combobox.


Thx for the answer. I have equals() implementation, but the problems was the converter. For vaadin 7 I had a converter that works fine, but with vaadin 8 I have made some changes but the fail was there.

Due to your answer I arrived at the fail, so thx again.

Are you implementing hashCode() and equals() in your Bean class?

Good to hear you figured it out :slight_smile: