spring-securityvaadinvaadin4spring

Is it possible to run Spring Security from vaading4spring together with Vaadin Spring Boot?


Is it possible to run Spring Security from vaading4spring together with Vaadin Spring Boot?

When I mix both at build.gradle as

// Official VaadinSpring Integration
compile("com.vaadin:vaadin-spring:1.0.0.beta2")
compile("com.vaadin:vaadin-spring-boot:1.0.0.beta2")
compile("com.vaadin:vaadin-spring-boot-starter:1.0.0.beta2")

// Supporting (unofficial) vaadin4spring 
compile("org.vaadin.spring:spring-vaadin:0.0.5.RELEASE")
compile("org.vaadin.spring:spring-boot-vaadin:0.0.5.RELEASE")
compile("org.vaadin.spring:spring-vaadin-security:0.0.5.RELEASE")

new annotations (such as @SpringUI) does not work.

when I remove

compile("org.vaadin.spring:spring-vaadin:0.0.5.RELEASE")
compile("org.vaadin.spring:spring-boot-vaadin:0.0.5.RELEASE")

from build.gradle,

I got an exception says

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.vaadin.spring.http.HttpService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1301) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1047) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533) ... 77 more

I appreciate any help.


Solution

  • vaadin4spring 0.0.5 is the last standalone release and you should use it as such (don't mix!). the next version of vaadin4spring will build on the official spring vaadin addon, but this is work in progress (Details about this are here: https://github.com/peholmst/vaadin4spring/issues/164)

    For your specific problem see https://github.com/peholmst/vaadin4spring/issues/206

    for a spring security example see the vaadin4spring:

    https://github.com/peholmst/vaadin4spring/tree/v0.0.5/samples/security-sample