You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the spring-vaadin library in our project, which has its own annotation @VaadinView:
@Target({java.lang.annotation.ElementType.TYPE})
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Documented@VaadinComponent@VaadinViewScopepublic @interface VaadinView {
/** * The name of the view. This is the name that is to be passed to the * {@link com.vaadin.navigator.Navigator} when navigating to the view. There can be multiple views * with the same name as long as they belong to separate UI subclasses. * * @see #ui() */Stringname();
/** * By default, the view will be available for all UI subclasses in the application. This attribute can be used * to explicitly specify which subclass (or subclasses) that the view belongs to. */Class<? extendsUI>[] ui() default {};
}
Library also defines its own scope "vaadin-view", which has a "shortcut" annotation @VaadinViewScope defined like:
I tried our project with 4.2.0.RC2 (RC1 worked fine) and suddenly there is an exception when scanning scope of classes with @VaadinView annotation:
Caused by: org.springframework.core.annotation.AnnotationConfigurationException: In annotation [org.springframework.context.annotation.Scope] declared on [file [D:\...\AdminViewImpl.class]], attribute [value] and its alias [name] are present with values of [vaadin-view] and [admin], but only one is permitted.
at org.springframework.core.annotation.AnnotationAttributes.getRequiredAttributeWithAlias(AnnotationAttributes.java:434)
at org.springframework.core.annotation.AnnotationAttributes.getAliasedString(AnnotationAttributes.java:149)
at org.springframework.context.annotation.AnnotationScopeMetadataResolver.resolveScopeMetadata(AnnotationScopeMetadataResolver.java:82)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:250)
at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:137)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:267)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:231)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:198)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167)
... 18 more
I think it has something to do with #16020, parameters "name" and "value" of different annotations are mixed together.
This an an unfortunate side effect: VaadinView's name attribute by convention overrides the newly introduced name attribute on @Scope now, which of course it doesn't intend to. We either need to remove/rename that new attribute on @Scope, or find some rules for how a common name attribute does not automatically override here.
Michal Kytýr opened SPR-13239 and commented
We are using the
spring-vaadin
library in our project, which has its own annotation@VaadinView
:Library also defines its own scope "vaadin-view", which has a "shortcut" annotation
@VaadinViewScope
defined like:I tried our project with 4.2.0.RC2 (RC1 worked fine) and suddenly there is an exception when scanning scope of classes with
@VaadinView
annotation:I think it has something to do with #16020, parameters "name" and "value" of different annotations are mixed together.
Affects: 4.2 RC2
Issue Links:
Referenced from: commits 9f15f34
The text was updated successfully, but these errors were encountered: