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.
error when adding jrebel to spring boot application
Hi.
I created a vaadin application following the vaadin-spring tutorial:
http://vaadin.github.io/spring-tutorial/
So far everything ok.
But then I add jrebel and start the application via
java -noverify -agentpath:path/to/jrebel/lib/jrebel64.dll -jar target/application-0.0.1-SNAPSHOT.jar
Now the application works fine, until a change any code and then use F5/reload to get a new ui/session.
The exception is as follows. In this example there are 10 beans found. The number starts from about 3 and increases with each failed reload.
Any idea what to do or how to integrate jrebel?
Thanks for help.
Horst
org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.vaadin.spring.internal.SpringViewDisplayRegistrationBean' ava
ilable: expected single matching bean but found 10: com.vaadin.spring.internal.SpringViewDisplayRegistrationBean#0,com.vaadin.spring.internal.SpringViewDisplayR
egistrationBean#1,com.vaadin.spring.internal.SpringViewDisplayRegistrationBean#2,com.vaadin.spring.internal.SpringViewDisplayRegistrationBean#3,com.vaadin.sprin
g.internal.SpringViewDisplayRegistrationBean#4,com.vaadin.spring.internal.SpringViewDisplayRegistrationBean#5,com.vaadin.spring.internal.SpringViewDisplayRegist
rationBean#6,com.vaadin.spring.internal.SpringViewDisplayRegistrationBean#7,com.vaadin.spring.internal.SpringViewDisplayRegistrationBean#8,com.vaadin.spring.int
ernal.SpringViewDisplayRegistrationBean#9
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1034) ~[spring-beans-4.3.4.RELE
ASE.jar!/:4.3.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:340) ~[spring-beans-4.3.4.RELEASE.jar!/:
4.3.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:335) ~[spring-beans-4.3.4.RELEASE.jar!/:
4.3.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093) ~[spring-context-4.3.4.RELEASE.jar!/:4.3
.4.RELEASE]
at com.vaadin.spring.server.SpringUIProvider.findSpringViewDisplay(SpringUIProvider.java:318) ~[vaadin-spring-1.1.1.jar!/:1.1.1]
at com.vaadin.spring.server.SpringUIProvider.configureNavigator(SpringUIProvider.java:272) ~[vaadin-spring-1.1.1.jar!/:1.1.1]
at com.vaadin.spring.server.SpringUIProvider.createInstance(SpringUIProvider.java:204) ~[vaadin-spring-1.1.1.jar!/:1.1.1]
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:191) ~[vaadin-server-7.7.5.jar!/:7.7.5]
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74) ~[vaadin-server-7.7.5.jar!/:7.7.5]
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41) ~[vaadin-server-7.7.5.jar!/:7.7.5]
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1422) ~[vaadin-server-7.7.5.jar!/:7.7.5]
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:379) ~[vaadin-server-7.7.5.jar!/:7.7.5]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.5.6.jar!/:8.5.6]
By the way, I notices that the error only happens when using views. As soon as I remove any @SpringView and
@SpringViewDisplay annotation no more reloading error happen.
We get this Exception occasionally too (without JRebel) when we redeploy.
A Tomcat restart usually fixes things.
We haven't been able to reproduce it in our test setups or I would have filed a bug already.
@SpringViewDisplay annotation and
DCEVM (light) for Java 8u112 (build 8)+Hotswap Agent produce some error after code changed
I have same error
So I remove @SpringViewDisplay and using alternative method
view my code
@SpringUI
public class MyUI extends UI implements ViewDisplay {
@Autowired
SpringNavigator navigator;
@Override
protected void init(VaadinRequest vaadinRequest) {
this.navigator.init(this, (ViewDisplay)this);
}
}
Hope it could help you.
I'm also experiencing this problem. I think the @SpringView annotation cannot be removed, it's required by Vaadin Navigator / routing?
My workaround is keep the @SpringView annotation, but make the @SpringView class so small that it almost never has to be modified. The only downside is the extra div element(s) caused by the wrapping.
Like this:
/**
* This class should not be modified. Only modify CollectionSearchView class.
* This is just a dummy class to contain the @SpringView annotation.
**/
@SpringView(name = CollectionSearch_SPRING_VIEW.VIEW_NAME)
public class CollectionSearch_SPRING_VIEW extends CssLayout implements View {
private static final long serialVersionUID = -3745216738592498185L;
public static final String VIEW_NAME = "collection-search";
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
addComponent(new CollectionSearchView());
}
}
/**
* This class can be modified. The actual UI is built here.
**/
public class CollectionSearchView extends CssLayout {
...
}