Webinar: Building Spring Boot apps with Vaadin 10

In this webinar, you’ll learn how to build a Vaadin 10 based UI for a Spring Boot application. Stéphane Nicoll from Pivotal and Matti Tahvonen from Vaadin will discuss various options you have, how to bootstrap your application and give you some tips on how to be more productive with these tools.

Webinar takes place on Tuesday August 14, 2018 @ 3PM CEST

embedyoutube=-BlJQqT8Kpg

See
https://vaadin.com/webinars
for other past and upcoming webinars.

You can post your questions below, thank you!

will it available for replay/ reference later - or should I do something locally for recording.

It will be available later as well. If you want to pose some questions, use the sign-up form or feel free to do it here as well during the webinar.

Any tips for CI/CD with Vaadin10 and Docker swarm?

Do you provide the source code on github?

Are there any free alternative to VaadinCharts ?

Para la comunidad que habla en español anexo guia de como construir una aplicacion con vaadin 10 y spring boot https://geovanny0401.blogspot.com/2018/08/construir-una-aplicacion-web-con-vaadin.html

Hi,

My maven is not properly setup. I need a proper settings.xml

Getting errors like

ERROR] /E:/sts-bundle/vaadin/VaadinSpringBoot-LDAP/src/main/java/hello/CustomerRepository.java:[3,47]
package org.springframework.data.jpa.repository does not exist
[ERROR]
/E:/sts-bundle/vaadin/VaadinSpringBoot-LDAP/src/main/java/hello/CustomerRepository.java:[7,45]
cannot find symbol
symbol: class JpaRepository
[ERROR]
/E:/sts-bundle/vaadin/VaadinSpringBoot-LDAP/src/main/java/hello/Customer.java:[3,25]
package javax.persistence does not exist
[ERROR]
/E:/sts-bundle/vaadin/VaadinSpringBoot-LDAP/src/main/java/hello/Customer.java:[4,25]
package javax.persistence does not exist
[ERROR]
/E:/sts-bundle/vaadin/VaadinSpringBoot-LDAP/src/main/java/hello/Customer.java:[5,25]
package javax.persistence does not exist

Hello there!

The relevant webinar examples are now available via GitHub:

https://github.com/snicoll-demos/demo-vaadin-crud: Fork of the Getting started guide with flyway, profile management & co

https://github.com/snicoll-demos/demo-vaadin-web-client : This is rewritten from scratch, adding more context to each commit. There is also a test using WebClient.

cheers,
matti

And then some answers:

Tiziano: Bit out of scope, but in general Vaadin shouldn’t bring anything special to the table on this topic. I’ll keep the topic in our backlog though.

Umit: I couldn’t find yet any free competitor for Vaadin Charts, but I’d expect them to appear. For older Vaadin versions there was a dozen of those.

Jeevan: Does any Maven project for you? Looks like some spring data related stuff is not properly on the classpath. Maybe you are behind a firewall and should use some proxy that should be configured to your settings.xml? You could try removing your ~/.m2/repository if there are some broken jars/poms in your local maven cache.

cheers,
matti

Thank you.
Had missed adding “spring-boot-starter-data-jpa” to the project pom.

After that was added it compiled smoothly.
But still facing issues in trying to execute it as a Spring-Boot-App.
Will post those issues ASAP but first I am trying to resolve them myself, first, reading https://spring.io/guides/gs/crud-with-vaadin.

Matti Tahvonen:
And then some answers:

Tiziano: Bit out of scope, but in general Vaadin shouldn’t bring anything special to the table on this topic. I’ll keep the topic in our backlog though.

Umit: I couldn’t find yet any free competitor for Vaadin Charts, but I’d expect them to appear. For older Vaadin versions there was a dozen of those.

Jeevan: Does any Maven project for you? Looks like some spring data related stuff is not properly on the classpath. Maybe you are behind a firewall and should use some proxy that should be configured to your settings.xml? You could try removing your ~/.m2/repository if there are some broken jars/poms in your local maven cache.

cheers,
matti

Thanks for the reply =) … i will check add-ons regularly

Got it to compile without errors (a Test case fails however) but cannot execute it.

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

So what could I have missed?

I am following: https://spring.io/guides/gs/crud-with-vaadin.
Also everything is in one package and I do not see the @Autowired annotation anywhere.

Jeevan, you are probably using an incompatible versions. There was a backwards incompatible change, so that you can’t currently use latest Spring Boot with latest Vaadin 10. Go with Spring Boot 2.0.2 for a while or use a snapshot version of Vaadin 10 (10.0-SNAPSHOT + vaadin snapshot repository). The compatibility fix for latest Vaadin should arrive soon.

cheers,
matti

Vaadin has supported Spring Roo 1.4 code generator. Now Roo 2.0 is out. Is there any chance for a Vaadin 10 addon for perfect Spring / Vaadin starter code?

Hi,

I am following: https://spring.io/guides/gs/crud-with-vaadin.
I wish to know some details -

  1. In the Application class, what is the use of the beans
  • public CommandLineRunner loadData(CustomerRepository repository) as in that we are just hard coding data into the CustomerRepository object.
  1. In the main() method SpringBoot initializes/ loads up - but how does it know how to goto/ show the MainView.java when http://locahost:8080 is opened in the browser.

I am attempting to modify the Spring+Vaadin sample, to show data from a LDAP server (I have written a sample which interacts with Springs embedded LDAP server and lodas data from a LDIF file - so I have a LDIFRepository, PersonRepository and GroupsRepository etc.)

thanks in advance,
Jeevan

Jeevan Sunkersett:
Hi,

I am following: https://spring.io/guides/gs/crud-with-vaadin.
I wish to know some details -

  1. In the Application class, what is the use of the beans
  • public CommandLineRunner loadData(CustomerRepository repository) as in that we are just hard coding data into the CustomerRepository object.

It’s not hardcoding data. It’s using the repository to save data in the in-memory store. If you take the demo that Matti has already shared, it uses Flyway to initialize the database so hopefully that should make things more clear.

In the main() method SpringBoot initializes/ loads up - but how does it know how to goto/ show the MainView.java when http://locahost:8080 is opened in the browser.

The MainView has a “listCustomers” method and this method takes care of setting items in the Grid (the table). You could reuse that method and fetch data from LDAP instead.

Thank you Stéphane.

Require a bit more help, as
MainView is using constructor-injection and injecting in
CustomerRepository repo &
CustomerEditor editor

The tutorial did not explain where exactly how.

I want to inject in only ONE parameter.

thanks in advance
Jeevan

Sorry, I don’t understand what you mean by “one parameter”.

public MainView(CustomerRepository repo, CustomerEditor editor) = 2 parameters
public MainView(LDIFRepository repo) = 1 parameter

I am getting

There was an exception while trying to navigate to '' with the exception message 'Error creating bean with name 'hello.MainView': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'hello.LDIFRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}'
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'hello.MainView': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'hello.LDIFRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:729)