0

I'm switching from Glassfish 3.1.1 to Wildfly 8.2.0 and I have a Maven structure like this (but with more applications):

Main (POM project)
 |-Web (POM project)
 |  |-Mobile (Web application)
 |  |-WWW (Web application)
 |-EJB (POM project)
 |  |-Data (EJB module)
 |-Util (POM project)
 |  |-JSFcomponents (Java application)
 |-EAR (POM project)
    |-WebEar (EAR project)

WebEar has dependencies to Mobile, WWW, Data and JSFcomponents. When I deploy WebEar, everything works except for 1 JSF component in the JSFcomponents project. I get an exception, when I open one of the web applications.

javax.servlet.ServletException: Expression Error: Named Object: dk.industrysupply.jsf.CookieConsent not found.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
dk.industrysupply.mobile.filter.FacesFilter.doFilter(FacesFilter.java:175)
io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
dk.industrysupply.mobile.filter.ThreadFilter.doFilter(ThreadFilter.java:37)
io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63)
io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247)
io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76)
io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166)
io.undertow.server.Connectors.executeRootHandler(Connectors.java:197)
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)

Other JSF components in that project work fine. The difference between them is that CookieConsent use annotations, while the other components are configured in faces-config.xml.

CookieConsentComponent

@FacesComponent(value = "dk.industrysupply.jsf.CookieConsent")
public class CookieConsentComponent extends UIComponentBase {

CookieConsentRenderer

@FacesRenderer(componentFamily = "dk.industrysupply.jsf.CookieConsent",
rendererType = "dk.industrysupply.jsf.CookieConsent")
public class CookieConsentRenderer extends Renderer {

Taglib

<tag>
    <tag-name>cookieConsent</tag-name>
    <component>
        <component-type>dk.industrysupply.jsf.CookieConsent</component-type>
        <renderer-type>dk.industrysupply.jsf.CookieConsent</renderer-type>
    </component>
    <attribute>
        <name>id</name>
        <required>false</required>
        <type>java.lang.String</type>
    </attribute>
    <attribute>
        <name>value</name>
        <required>true</required>
        <type>java.lang.String</type>
    </attribute>
</tag>

Since the project worked fine on Glassfish and it works fine on Wildfly as well, if I remove the CookieConsent component from use in the web applications, it seems to me like there is some sort of problem with the project structure in Wildfly. But having messed with this issue for hours now, I'm starting to run out of ideas. Need some help...

Bjørn Stenfeldt
  • 1,432
  • 1
  • 18
  • 25

1 Answers1

0

JSFcomponent was labeled as provided in Mobile and WWW. It was provided by WebEar. This reduced the size of WebEar, because JSFcomponent was then only included in the compiled EAR file once. This setup reduced the size of the EAR from 130 mb to 40 mb and reduced deployment time from 2:15 to 1:05.

Now I've changed Mobile and WWW, so they each provide their own JSFcomponent and now it works on Wildfly. The bad thing is that the EAR has grown in size, because JSFcomponent is included multiple times. It's annoying, since the other setup worked fine on Glassfish. But still, it's an acceptable solution.

Bjørn Stenfeldt
  • 1,432
  • 1
  • 18
  • 25