Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails if main application is annotated with @EnableJmixDataRepositories #3772

Open
knstvk opened this issue Oct 10, 2024 · 1 comment
Assignees
Labels
blocked type: regression Regress comparing to a previous version

Comments

@knstvk
Copy link
Contributor

knstvk commented Oct 10, 2024

Environment

Jmix version: 2.4.0-RC1

Bug Description

Create an app based on Jmix 2.4.0-RC1 and add @EnableJmixDataRepositories to main application class.

Try to start the application.

> Task :vaadinPrepareFrontend FAILED
3 actionable tasks: 3 executed
Could not read com.vaadin.flow.theme.Theme annotation from class com.company.onboarding.OnboardingApplication.
java.lang.TypeNotPresentException: Type [unknown] not present
	at java.base/java.lang.reflect.Method.getDefaultValue(Method.java:724)
	at java.base/sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:133)
	at java.base/sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85)
	at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:262)
	at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:121)
	at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
	at java.base/java.lang.Class.createAnnotationData(Class.java:4068)
	at java.base/java.lang.Class.annotationData(Class.java:4057)
	at java.base/java.lang.Class.getAnnotationsByType(Class.java:3965)
	at com.vaadin.flow.internal.AnnotationReader.getAnnotationsFor(AnnotationReader.java:221)
	at com.vaadin.flow.server.frontend.scanner.FullDependenciesScanner.lambda$new$2c28ff74$1(FullDependenciesScanner.java:118)
	at com.vaadin.flow.server.frontend.scanner.FullDependenciesScanner.lambda$verifyTheme$5(FullDependenciesScanner.java:393)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at com.vaadin.flow.server.frontend.scanner.FullDependenciesScanner.verifyTheme(FullDependenciesScanner.java:399)
	at com.vaadin.flow.server.frontend.scanner.FullDependenciesScanner.discoverTheme(FullDependenciesScanner.java:349)
	at com.vaadin.flow.server.frontend.scanner.FullDependenciesScanner.<init>(FullDependenciesScanner.java:141)
	at com.vaadin.flow.server.frontend.scanner.FullDependenciesScanner.<init>(FullDependenciesScanner.java:94)
	at com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner$FrontendDependenciesScannerFactory.createScanner(FrontendDependenciesScanner.java:93)
	at com.vaadin.flow.server.frontend.NodeTasks.<init>(NodeTasks.java:125)
	at com.vaadin.flow.plugin.base.BuildFrontendUtil.prepareFrontend(BuildFrontendUtil.java:172)
	at com.vaadin.gradle.VaadinPrepareFrontendTask.vaadinPrepareFrontend(VaadinPrepareFrontendTask.kt:68)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
...
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationEventPublisherAware
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
...
	... 153 more
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationEventPublisherAware
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
	at org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader.findClass(VisitableURLClassLoader.java:186)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	... 184 more

Caused by vaadin/flow#19616

@knstvk knstvk added type: bug Something isn't working triage Issue is waiting for triage labels Oct 10, 2024
@glebfox glebfox added type: regression Regress comparing to a previous version blocked and removed type: bug Something isn't working triage Issue is waiting for triage labels Oct 11, 2024
@knstvk
Copy link
Contributor Author

knstvk commented Nov 12, 2024

The workaround is to specify @EnableJmixDataRepositories on a separate configuration class, for example:

package com.company.onboarding;

import io.jmix.core.repository.EnableJmixDataRepositories;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableJmixDataRepositories
public class DataRepositoriesConfiguration {
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked type: regression Regress comparing to a previous version
Projects
Status: No status
Development

No branches or pull requests

2 participants