Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin @SpringUI is not mapped
I am new baby to spring vaadin, I created a spring boot with vaadin in Spring Tool Suite.
Created a @RestController and it is working,
I have some old servlet that I like to added it to the project so I created a Spring bean configuration xml file for my old servlet,it is working fine too.
But after I added a simple class like following
@SpringUI
public class MyVaadinUI extends UI {
@Override
protected void init(VaadinRequest request) {
setContent(new Label("Hello! I'm the vaadinUI!"));
}
}
I started the application in STS, all my servlet and controller are mapping correctly, but I got the following:
Forwarding @SpringUI URLs from {}
Neither 'urlMap' nor 'mappings' set on SimpleUrlHandlerMapping
Registering Vaadin servlet of type [com.vaadin.spring.server.SpringVaadinServlet]
Looking up SpringViews
No SpringViews found
I tried the http://localhost:8080/, I got the following error
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.Wed Jul 06 10:31:29 MST 2016
There was an unexpected error (type=Not Found, status=404).
No message available
I changed @SpringUI to @SpringUI(path="/myui"), then http://localhost:8080/myui, the same problem.
Would someone help me please?
Thank you!
Hi,
I tried to reproduce your problem but couldn't. All I can think of right now is that with Spring Boot you add Servlets in the following way:
@Configuration
public class ServletConfig {
@Bean
public ServletRegistrationBean servlet() {
return new ServletRegistrationBean(new HttpServlet() {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.getWriter().append("Servlet works!");
}
}, "/servlet/*");
}
}
I created an example application that adds a Servlet and a REST controller in a Vaadin application with Spring Boot. Check it out.
did you found solution for this problem, because i have the same i really don't find the solution
Just to add to the conversation; I am evaluating vaadin with spring boot and I came across the same problem. My springUi class was in a totally different package structure than my main class. After I moved the UI class to the same package as my main class, it was correctly mapped.
Christ Taylor: After I moved the UI class to the same package as my main class, it was correctly mapped.
If you don't want to move your ui classes all in one package, try to see if @ComponentScan can help you.
i had the same problem, i had to import "import com.vaadin.spring.annotation.SpringUI;"
Try to verify your @ComponentScan annotation if the annotation parameter contemplating the package path of your components
Ex: @ComponentScan({"com.company"})