在JBoss的.ear中运行Vaadin应用程序时出现ClassNotFoundException

2j4z5cfb  于 2022-11-08  发布在  其他
关注(0)|答案(1)|浏览(148)

ear文件中有一个打包为war文件的vaadin应用程序。此ear文件部署在JBoss中。每当尝试访问vaadin应用程序时,在尝试打开页时,绑定程序示例化都会引发ClassNotFoundException。所需的类文件实际上位于war文件的WEB-INF/lib文件夹中。异常错误的日志如下所示。

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]

Caused by: java.lang.ClassNotFoundException: com.vaadin.flow.component.Component from [Module "deployment.xyz.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

谢谢

xwbd5t1u

xwbd5t1u1#

找到了修复程序,项目结构不是很好。虽然它编译了,但在运行时无法获取类。

相关问题