Git Product home page Git Product logo

flow-crm-tutorial's Introduction

Spring Boot and Vaadin course source code

This repository contains the source code for the Building Modern Web Applications With Spring Boot and Vaadin.

Live demo: https://crm.demo.vaadin.com

Running the Application

There are two ways to run the application: using mvn or by running the Application class directly from your IDE.

Branches

  • The main branch contains the source code for the latest Vaadin release
  • The v14 branch contains the source code for Vaadin 14

Text tutorial

You can find a text version of the tutorial in the Vaadin Documentation.

flow-crm-tutorial's People

Contributors

dependabot[bot] avatar johannesh2 avatar manolo avatar marcinvaadin avatar marcushellberg avatar matthewvaadin avatar mikaelsu avatar mshabarov avatar mstahv avatar tarekoraby avatar vaadin-bot avatar zhesun88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flow-crm-tutorial's Issues

Entity Not Found

When trying to move around the project, I had some issues with Entity Not Found Exception from Company Entity.
Probably I would suggest adding (fetch = FetchType.EAGER,mappedBy = "company",cascade = CascadeType.ALL) for the relationship.

I had to revert to the normal Integer id instead of uuid. Seems like the generated UUID was not being mapped correctly between the contact and the company table.

cant login locally

This is the code in the github repository v24 branch and I have tried many combos and nothing seems to work. What am I missing to be able to login locally ?

@bean
public UserDetailsService users() {
UserDetails user = User.builder()
.username("user")
// password = password with this hash, don't tell anybody :-)
.password("{bcrypt}$2a$10$GRLdNijSQMUvl/au9ofL.eDwmoohzzS7.rmNSJZ.0FxO/BTk76klW")
.roles("USER")
.build();
UserDetails admin = User.builder()
.username("admin")
.password("{bcrypt}$2a$10$GRLdNijSQMUvl/au9ofL.eDwmoohzzS7.rmNSJZ.0FxO/BTk76klW")
.roles("USER", "ADMIN")
.build();
return new InMemoryUserDetailsManager(user, admin); // <5>

Error on Build: Could not navigate to '' Reason: Couldn't find route for ''

i 50% when i run "build application" i get an Error:

Could not navigate to ''
Reason: Couldn't find route for ''
Available routes:
This detailed message is only shown when running in development mode.

i solved it with:

@SpringBootApplication(scanBasePackages = {"com.vaadin"})
public class Application extends SpringBootServletInitializer {

more possible settings i found here: spring-projects/spring-boot#18109

i think it would be nice to add scanBasePackages to the tutorial (and videos, so beginners are not have this error

Problems with production build - and suggested fix

When creating a production build on a project based on the latest version from this repo I got into problems when trying to run it. The error said:
Caused by: java.io.IOException: The stats file from webpack (stats.json) was not found.

I could also verify that the stats.json file did not exist where it should be, and also that several other people have reported similar issues on Vaadin support pages. 
By comparing to an older version of this demo that I played around with about a year ago, which apparently worked, I could spot the root cause to the pom file, and that is that this "" section is missing (see attached file). It should be added on row 221.

After having added that section in my cloned example, it now works.
Best regards,
     /Henrik
     
pom-section.txt

Odd usability when navigating away from unsaved form

If you change a record (contact) then open another contact w/o saving, the changes are not saved, but not cancelled either – if you navigate back to the changed record, it still has the changes you made visible in the form. This leads to a somewhat confusing UX.
Video: https://d.pr/v/y1NXyo

Ideally it would require explicit action (save/cancel): disallow navigating away if the form has been modified, and make buttons indicate whether or not there are changes to save/cancel.

Tutorial with no Login View and spring ressource-server

Hi, I'm not sure where to put this, so here I am.

I'm developing a rather big micro service cloud application with dozen of services, two of whom have a vaadin frontend.
They are obviously behind a reverse proxy (nginx) which handles the authentication (forwards to an IDP).

In the documentation (https://vaadin.com/docs/latest/security/enabling-security) it states the requirement for a login view and a log out capability. I have the latter, but no vaadin log in view.

On the other hand I just wan't to configure the jwt security with spring using a ressource-server to check the provided bearer token.

Could you please provide a tutorial, how this is supposed to be configured?

I currently have this configuration, but am not sure, if this is correct.

@Override
    protected void configure(final HttpSecurity http) throws Exception {
        http.authorizeRequests().antMatchers(ACTUATOR_HEALTH_ENDPOINT).permitAll();
        http.authorizeRequests().antMatchers(ACTUATOR_PROMETHEUS_ENDPOINT).permitAll();

        super.configure(http);

        http.cors()
                .and()
                .oauth2ResourceServer()
                .jwt();
    }

Log in hint

On the live demo, there is an additional hint below the log in form, which I can't see in the source. Where is it coming from?

grafik

User Login is needed after checkout 03-database-and-backend

where:

i am in this Tutorial:
https://vaadin.com/learn/tutorials/modern-web-apps-with-spring-boot-and-vaadin/vaadin-grid-adding-data-and-configuring-columns

i checked out the crm-tutorial and run it from the master branch

later i checked out 03-database-and-backend

in the video i can start the app without credentials

on my machine it is redirected to /login but the known combination from final demo user/password is not working here :(

is there some caching between the branch checkouts?

i did also a mvn clean but there was still the login screen when i started the app (but in sources there was no login screen available):

Bildschirmfoto 2020-06-18 um 21 11 58

gitpod run doesn't run

Just deploying the master branch on gitpod doesn't work (I simply used the gitpod extension on the github page). The program magically starts logging in a console window (I'll have to figure that one out), and finishes with

====================================================================
Vaadin is running in DEBUG MODE.
In order to run your application in production mode and disable debug features, you should enable it by setting the servlet init parameter productionMode to true.
See https://vaadin.com/docs/v14/flow/production/tutorial-production-mode-basic.html for more information about the production mode.
====================================================================
2020-04-29 20:14:39.097  INFO 1638 --- [nio-8080-exec-1] c.vaadin.flow.spring.SpringInstantiator  : The number of beans implementing 'I18NProvider' is 0. Cannot use Spring beans for I18N, falling back to the default behavior

Opening the preview window or the browser for port 8080 yields "port 8080 didn't respond"

this tutorial doesnt seem to run - gives "java: package com.vaadin.flow.component.page does not exist"

Unfortunately, the readme is missing how to run this project.

I cloned the project then tried opening it in intellij, then hitting the "run" arrow next to main in com.example.application.Application.java, and get the following error:

/Users/simon/dev/tutorials/flow-crm-tutorial/src/main/java/com/example/application/Application.java:3:38
java: package com.vaadin.flow.component.page does not exist

If I try to do the following:

$ mvn package

I get the following errors:

[ERROR] Errors:
[ERROR] LoginE2ETest.loginAsInvalidUserFails » ExceptionInInitializer
[ERROR] LoginE2ETest.loginAsValidUserSucceeds » NoClassDefFound Could not initialize class com.vaadin.testbench.browser.BrowserExtension
[INFO]

The live demo is also broken (cant login with user/userpass) at https://crm.demo.vaadin.com/

Using M1 Mac, osx 13.2.1, with Zulu java 17, mvn version 3.8.7

PiT 24.1: project does not compile in production mode

Description

When compiling the project for production mode it fails with this JS error

[ERROR] Stderr: 'vite v4.3.9 building for production...
[ERROR] transforming...
[ERROR] ✓ 71 modules transformed.
[ERROR] ✓ built in 729ms
[ERROR] [vite:load-fallback] Could not load frontend/generated/jar-resources/theme-util.js (imported by frontend/generated/theme-flowcrmtutorial.generated.js): ENOENT: no such file or directory, open 'frontend/generated/jar-resources/theme-util.js'

Note that it works:

  • if you run in dev-mode ./mvnw
  • if you use vaadin

How to reproduce

git clone https://github.com/vaadin/flow-crm-tutorial.git
cd flow-crm-tutorial
./mvnw install -Pproduction

Issue with CSS and parent class in chapter "Creating your own reusable components in Vaadin"

The content of shared-styles.css is listed as

.list-view .content {
display: flex;
}
.list-view .contact-grid {
flex: 2;
}
.list-view .contact-form {
flex: 1;
padding: var(--lumo-space-m);
}

but it causes the contact form to overlap the grid and take 100% of page width.

It should be

.list-view {
display: flex;
}
.list-view .contact-grid {
flex: 2;
}
.list-view .content {
flex: 1;
padding: var(--lumo-space-m);
}

Not that "display: flex" is applied to whole ".list-view" component and "flex: 1" is applied only to ".content" class.

Also the parent class of MainView should be changed from VerticalLayout to HorizontalLayout in the order to place contact form on the right side of the page.

Issue when defining a Binder

Going through the tutorial I reached the chapter "Creating the binder".
As soon as I added the line
Binder<Contact> binder = new BeanValidationBinder<>(Contact.class);
to the class ContactForm.java I get the below error stacktrace re. bean creation error, which I don't understand. What am I missing? What is this error message trying to convey to me?
I am using Java 11 (AdoptOpenJDK) and Vaadin v14.3.8.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.vaadin.tutorial.crm.ui.MainView': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.vaadin.tutorial.crm.ui.MainView]: Constructor threw exception; nested exception is java.lang.IllegalStateException: BeanValidationBinder cannot be used because a JSR-303 Bean Validation implementation not found on the classpath or could not be initialized. Use Binder instead
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:313) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:294) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:307) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at com.vaadin.flow.spring.SpringInstantiator.getOrCreate(SpringInstantiator.java:117) ~[vaadin-spring-12.3.1.jar:na]
at com.vaadin.flow.di.Instantiator.createRouteTarget(Instantiator.java:160) ~[flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.lambda$getRouteTarget$1(AbstractNavigationStateRenderer.java:135) ~[flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer$$Lambda$788/0000000000000000.get(Unknown Source) ~[na:na]
at java.util.Optional.orElseGet(Optional.java:267) ~[na:1.8.0_242]
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.getRouteTarget(AbstractNavigationStateRenderer.java:134) ~[flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.sendBeforeEnterEventAndPopulateChain(AbstractNavigationStateRenderer.java:518) ~[flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.createChainIfEmptyAndExecuteBeforeEnterNavigation(AbstractNavigationStateRenderer.java:498) ~[flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.handle(AbstractNavigationStateRenderer.java:230) ~[flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.router.Router.handleNavigation(Router.java:249) [flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.router.Router.navigate(Router.java:220) [flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.router.Router.navigate(Router.java:186) [flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.router.Router.initializeUI(Router.java:93) [flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.server.BootstrapHandler.createAndInitUI(BootstrapHandler.java:1534) [flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.server.BootstrapHandler.synchronizedHandleRequest(BootstrapHandler.java:474) [flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) [flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1545) [flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:247) [flow-server-2.3.6.jar:2.3.6]
at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:108) [vaadin-spring-12.3.1.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) [tomcat-embed-core-9.0.37.jar:4.0.FR]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:352) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:141) [spring-webmvc-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177) [spring-webmvc-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:52) [spring-webmvc-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) [spring-webmvc-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) [spring-webmvc-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) [spring-webmvc-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:626) [tomcat-embed-core-9.0.37.jar:4.0.FR]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) [tomcat-embed-core-9.0.37.jar:4.0.FR]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589) [tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.37.jar:9.0.37]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_242]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.37.jar:9.0.37]
at java.lang.Thread.run(Thread.java:821) [na:1.8.0_242]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.vaadin.tutorial.crm.ui.MainView]: Constructor threw exception; nested exception is java.lang.IllegalStateException: BeanValidationBinder cannot be used because a JSR-303 Bean Validation implementation not found on the classpath or could not be initialized. Use Binder instead
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:217) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:309) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
... 75 common frames omitted
Caused by: java.lang.IllegalStateException: BeanValidationBinder cannot be used because a JSR-303 Bean Validation implementation not found on the classpath or could not be initialized. Use Binder instead
at com.vaadin.flow.data.binder.BeanValidationBinder.(BeanValidationBinder.java:85) ~[flow-data-2.3.6.jar:2.3.6]
at com.vaadin.flow.data.binder.BeanValidationBinder.(BeanValidationBinder.java:61) ~[flow-data-2.3.6.jar:2.3.6]
at com.vaadin.tutorial.crm.ui.ContactForm.(ContactForm.java:33) ~[classes/:na]
at com.vaadin.tutorial.crm.ui.MainView.(MainView.java:41) ~[classes/:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_242]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_242]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_242]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_242]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:204) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
... 77 common frames omitted

Your DB has been reset

Your DB has been reset, so the example isn't working now. Could you update your DB with the credentials in the example, so we can check it?

Logout doesn't work as it should be

ie: You can logout from the view, it seem to take you to the link that say login with Keycloak.
However, if you directly hit the URL of the dashboard, for instance, http://host:port/dashboard, the user doesn't really need to login again. This is a serious security flow.

Issue with logout and Vaadin 20

When running the project under Vaadin 20.0.4 the logout fails.
The browser outputs the following message:

Could not navigate to 'logout'
Available routes:

dashboard
login
This detailed message is only shown when running in development mode.

It seems that the anchor with the logout route (/logout") is not catched by the spring security but is handled by the Vaadin internal navigation mechanism.

SecurityConfig.java - 'authorizeHttpRequests()' is deprecated and marked for removal

Hey guys,

Want to check if this is already on your list. The method will also be removed in a future version.
I am using openJDK 17, the latest version of IntelliJ (2023.1.3) and the latest Spring Security version.

This point is also stated in the Spring migration guide, Spring Security.

Based on this guide the call should be changed to:

http.authorizeHttpRequests((authz) -> authz
                .requestMatchers("/images/*.png").permitAll());

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.