vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
622 stars 167 forks source link

java.lang.TypeNotPresentException: Type com.vaadin.flow.component.Component not present #14468

Closed rahuldjha closed 2 years ago

rahuldjha commented 2 years ago

Description of the bug

I have migrated one of the projects from vaadin8 compatibility mode to vaadin flow 14.8.11. Build and deployment was successful, now on runtime when I am trying to navigate between modules, it is throwing the exception. Please find the stack trace below.

[2022-09-05 12:33:05,999] [ ] [ERROR] [default task-4] [com.org.app.base.LayoutManager] [] [] [] [] Exception Occurred - 
java.lang.TypeNotPresentException: Type com.vaadin.flow.component.Component not present
    at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[?:?]
    at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[?:?]
    at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:?]
    at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[?:?]
    at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[?:?]
    at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:?]
    at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[?:?]
    at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[?:?]
    at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:?]
    at sun.reflect.generics.repository.ConstructorRepository.computeParameterTypes(ConstructorRepository.java:111) ~[?:?]
    at sun.reflect.generics.repository.ConstructorRepository.getParameterTypes(ConstructorRepository.java:87) ~[?:?]
    at java.lang.reflect.Executable.getGenericParameterTypes(Executable.java:279) ~[?:?]
    at java.lang.reflect.Method.getGenericParameterTypes(Method.java:330) ~[?:?]
    at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:391) ~[?:?]
    at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:118) ~[?:?]
    at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:74) ~[?:?]
    at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:58) ~[?:?]
    at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1047) ~[?:?]
    at java.beans.Introspector.getBeanInfo(Introspector.java:462) ~[?:?]
    at java.beans.Introspector.getBeanInfo(Introspector.java:205) ~[?:?]
    at com.vaadin.flow.internal.BeanUtil.getBeanPropertyDescriptors(BeanUtil.java:83) ~[flow-server-2.7.15.jar:2.7.15]
    at com.vaadin.flow.data.binder.BeanPropertySet.<init>(BeanPropertySet.java:323) ~[flow-data-2.7.15.jar:2.7.15]
    at com.vaadin.flow.data.binder.BeanPropertySet.lambda$get$2(BeanPropertySet.java:439) ~[flow-data-2.7.15.jar:2.7.15]
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705) ~[?:?]
    at com.vaadin.flow.data.binder.BeanPropertySet.get(BeanPropertySet.java:438) ~[flow-data-2.7.15.jar:2.7.15]
    at com.vaadin.flow.data.binder.Binder.<init>(Binder.java:1547) ~[flow-data-2.7.15.jar:2.7.15]
    at com.org.app.vaadin.ui.helper.BeanFieldGroup.<init>(BeanFieldGroup.java:69) ~[classes/:?]
    at com.org.app.vaadin.views.AdvanceSearchLayer.<init>(AdvanceSearchLayer.java:211) ~[classes/:?]
    at com.org.app.vaadin.views.AdvanceSearch.addFilterCriteria(AdvanceSearch.java:643) ~[classes/:?]
    at com.org.app.vaadin.views.AdvanceSearch.beforeEnter(AdvanceSearch.java:1613) ~[classes/:?]
    at com.org.app.vaadin.views.AdvanceSearch.<init>(AdvanceSearch.java:196) ~[classes/:?]
    at com.org.app.vaadin.views.ModuleView.renderAdvanceSearchPanel(ModuleView.java:879) ~[classes/:?]
    at com.org.app.vaadin.views.ModuleView.initAdvancedSearch(ModuleView.java:1005) ~[classes/:?]
    at com.org.app.vaadin.views.ModuleView.beforeEnter(ModuleView.java:1323) ~[classes/:?]
    at com.org.app.vaadin.views.ModuleView.initTabs(ModuleView.java:247) ~[classes/:?]
    at com.org.app.vaadin.views.ModuleView.<init>(ModuleView.java:228) ~[classes/:?]
    at com.org.app.vaadin.ui.layout.impl.OuterLayoutImpl.setBottomComponent(OuterLayoutImpl.java:129) ~[classes/:?]
    at com.org.app.vaadin.ui.layout.impl.OuterLayoutImpl.initVariousLayouts(OuterLayoutImpl.java:92) ~[classes/:?]
    at com.org.app.vaadin.ui.layout.impl.OuterLayoutImpl.init(OuterLayoutImpl.java:72) ~[classes/:?]
    at com.org.app.vaadin.ui.layout.impl.OuterLayoutImpl.<init>(OuterLayoutImpl.java:62) ~[classes/:?]
    at com.org.app.vaadin.ui.layout.impl.MainLayout.<init>(MainLayout.java:66) ~[classes/:?]
    at com.org.app.base.LayoutManager.createMainLayout(LayoutManager.java:94) ~[classes/:?]
    at com.org.app.base.LayoutManager.manageLayout(LayoutManager.java:80) ~[classes/:?]
    at com.org.app.base.UIController.init(UIController.java:113) ~[classes/:?]
    at com.vaadin.flow.component.UI.doInit(UI.java:224) ~[flow-server-2.7.15.jar:2.7.15]
    at com.vaadin.flow.server.BootstrapHandler.createAndInitUI(BootstrapHandler.java:1612) ~[flow-server-2.7.15.jar:2.7.15]
    at com.vaadin.flow.server.BootstrapHandler.synchronizedHandleRequest(BootstrapHandler.java:508) ~[flow-server-2.7.15.jar:2.7.15]
    at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[flow-server-2.7.15.jar:2.7.15]
    at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1578) ~[flow-server-2.7.15.jar:2.7.15]
    at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:252) ~[flow-server-2.7.15.jar:2.7.15]
    at com.org.app.base.AppServlet.service(AppServlet.java:141) ~[classes/:?]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[jboss-servlet-api_4.0_spec-2.0.0.Final-redhat-00001.jar!/:2.0.0.Final-redhat-00001]
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:173) ~[undertow-websockets-jsr-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:52) ~[opentracing-jaxrs2-0.4.1.redhat-00006.jar!/:?]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at org.pac4j.jee.filter.SecurityFilter.lambda$internalFilter$0(SecurityFilter.java:84) ~[jee-pac4j-6.0.0.jar:?]
    at org.pac4j.core.engine.DefaultSecurityLogic.perform(DefaultSecurityLogic.java:136) ~[pac4j-core-5.1.3.jar:?]
    at org.pac4j.jee.filter.SecurityFilter.internalFilter(SecurityFilter.java:82) ~[jee-pac4j-6.0.0.jar:?]
    at org.pac4j.core.config.AbstractConfigFilter.doFilter(AbstractConfigFilter.java:70) ~[pac4j-core-5.1.3.jar:?]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at com.org.app.common.authentication.TimeoutRetryFilter.retry(TimeoutRetryFilter.java:36) ~[web-base-28.2.00-SNAPSHOT.jar:28.2.00-SNAPSHOT]
    at com.org.app.common.authentication.TimeoutRetryFilter.doFilter(TimeoutRetryFilter.java:25) ~[web-base-28.2.00-SNAPSHOT.jar:28.2.00-SNAPSHOT]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at com.org.app.common.authorization.RoleChangeResetFilter.doFilter(RoleChangeResetFilter.java:66) ~[web-base-28.2.00-SNAPSHOT.jar:28.2.00-SNAPSHOT]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at com.org.app.common.mdc.MdcFilter.doFilter(MdcFilter.java:50) ~[web-base-28.2.00-SNAPSHOT.jar:28.2.00-SNAPSHOT]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78) ~[?:?]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) ~[?:?]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68) ~[?:?]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.ServletInitialHandler.jrHandle(ServletInitialHandler.java:40001) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at org.zeroturnaround.javarebel.integration.servlet.undertow.cbp.ServletInitialHandlerCBP.handleRequest(ServletInitialHandlerCBP.java:131) ~[ServletInitialHandlerCBP.class:?]
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105) ~[?:?]
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504) ~[?:?]
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504) ~[?:?]
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504) ~[?:?]
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504) ~[?:?]
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504) ~[?:?]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) ~[?:?]
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982) ~[?:?]
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) ~[?:?]
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) ~[?:?]
    at java.lang.Thread.run(Thread.java:834) ~[?:?]
Caused by: java.lang.ClassNotFoundException: com.vaadin.flow.component.Component from [Module "deployment.appV14.ear" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255) ~[?:?]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410) ~[?:?]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) ~[?:?]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116) ~[?:?]
    at java.lang.Class.forName0(Native Method) ~[?:?]
    at java.lang.Class.forName(Class.java:398) ~[?:?]
    at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) ~[?:?]
    ... 120 more

Expected behavior

The application should build, deploy and navigate smoothly.

Minimal reproducible example

Migrate project from vaadin8 compatibility mode to vaadinflow 14.8.11. Deploy the same with jboss-eap-7.3 container.

Versions

knoobie commented 2 years ago

java.lang.ClassNotFoundException: com.vaadin.flow.component.Component from [Module "deployment.appV14.ear" from Service Module Loader]

Looks like you are missing dependencies in your final ear.

rahuldjha commented 2 years ago

java.lang.ClassNotFoundException: com.vaadin.flow.component.Component from [Module "deployment.appV14.ear" from Service Module Loader]

Looks like you are missing dependencies in your final ear.

I verified that the ear and war dependencies were present, and that the build and deployment were successful; however, it is throwing a runtime exception while navigating between modules. 

rahuldjha commented 2 years ago

I found the root cause. It's an ear generation issue.