JSF: Composite component getting ClassNotFoundException when nested class is used in cc:attribute:type in EAP 7.x
Issue
Consider having an interface Facade in a jar located in EAR\lib
. This interface defines a nested class MyClass
. Then create a composite JSF component in EAR\WAR
, which declares an attribute of type MyClass.method
:
<cc:interface>
<cc:attribute name="data" type="MyClass.method" required="true" />
When a page that uses this component is rendered, ClassNotFoundException
is thrown when system tries to access MyClass.method
Caused by: java.lang.ClassNotFoundException: com.project.web.Foo.Bar from [Module "deployment.project-1.0-SNAPSHOT.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.faces.facelets.util.ReflectionUtil.forName(ReflectionUtil.java:100)
at com.sun.faces.facelets.tag.composite.AttributeHandler$CCAttributePropertyDescriptor.getValue(AttributeHandler.java:208)
... 49 more
Environment
JBoss Enterprise Application Platform (EAP) 7.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.