Still getting this error 'Component to add cannot be null' after using nullable=false

Hi, i’m new at vaadin. before i explain, i’m sorry if my english is not good.

So, i’m trying to show data from database (im using postgreSQL) to vaadin grid. i keep getting this error even i’m using @NotNull, @NotEmpty, and adding nullable=false at @Column.

do you have any solution? thanks
database.png
entity.png
view.png

Can you please post the stacktrace with the full error message?

yes, full error message
“org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.toraco.application.views.parkingreport.ParkingReportView’: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.toraco.application.views.parkingreport.ParkingReportView]: Constructor threw exception; nested exception is java.lang.NullPointerException: Component to add cannot be null”

Edit : parking-report is ‘view’ code
error_message.png

can you please post that as text

Spring is complaining when trying to create the ParkingReportView

sure,
error_message.txt (16.2 KB)

The problem is that in the method getToolBar() you are returning null instead of the toolbar

oh yea, you’re right, thanks alot for helping me :pray:

i was trying to find the problem for like 1 hour

Glad it works!

When getting an exception always check the last exception. That’s the cause