0
votes

I am trying to deploy a war file into a WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) server. But I get following errors in startup

Startup Console message:

  Source Document:   Source Document: file:/home/dsm/Development/wildfly/standalone/deployments/DSM.war/WEB-INF/faces-config.xml
  Cause: Class 'org.springframework.web.jsf.el.SpringBeanFacesELResolver' is missing a runtime dependency: java.lang.NoClassDefFoundError: Failed to link org/springframework/web/jsf/el/SpringBeanFacesELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): Failed to link org/springframework/beans/factory/access/el/SpringBeanELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): javax/el/ELResolver
    Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: 
  Source Document: file:/home/dsm/Development/wildfly/standalone/deployments/DSM.war/WEB-INF/faces-config.xml
  Cause: Class 'org.springframework.web.jsf.el.SpringBeanFacesELResolver' is missing a runtime dependency: java.lang.NoClassDefFoundError: Failed to link org/springframework/web/jsf/el/SpringBeanFacesELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): Failed to link org/springframework/beans/factory/access/el/SpringBeanELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): javax/el/ELResolver
    Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: 
  Source Document: file:/home/dsm/Development/wildfly/standalone/deployments/DSM.war/WEB-INF/faces-config.xml
  Cause: Class 'org.springframework.web.jsf.el.SpringBeanFacesELResolver' is missing a runtime dependency: java.lang.NoClassDefFoundError: Failed to link org/springframework/web/jsf/el/SpringBeanFacesELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): Failed to link org/springframework/beans/factory/access/el/SpringBeanELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): javax/el/ELResolver
    Caused by: com.sun.faces.config.ConfigurationException: 
  Source Document: file:/home/dsm/Development/wildfly/standalone/deployments/DSM.war/WEB-INF/faces-config.xml
  Cause: Class 'org.springframework.web.jsf.el.SpringBeanFacesELResolver' is missing a runtime dependency: java.lang.NoClassDefFoundError: Failed to link org/springframework/web/jsf/el/SpringBeanFacesELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): Failed to link org/springframework/beans/factory/access/el/SpringBeanELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): javax/el/ELResolver
    Caused by: java.lang.NoClassDefFoundError: Failed to link org/springframework/web/jsf/el/SpringBeanFacesELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): Failed to link org/springframework/beans/factory/access/el/SpringBeanELResolver (Module \"org.springframework.spring:main\" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /home/dsm/Development/wildfly/modules,/home/dsm/Development/wildfly/modules/system/layers/base))): javax/el/ELResolver"}}

My POM looks like this:

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.2.14</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.2.14</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.spec.javax.el</groupId>
        <artifactId>jboss-el-api_3.0_spec</artifactId>
        <version>1.0.5.Final</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>6.0</version>
    </dependency>
    <dependency>
        <groupId>org.jfree</groupId>
        <artifactId>jfreechart</artifactId>
        <version>1.0.14</version>
    </dependency>
    <!-- PrimeFaces -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <!-- PrimeFaces -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>LATEST</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>LATEST</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>LATEST</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jpa</artifactId>
        <version>2.0.8</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.1-api</artifactId>
        <version>1.0.0.Final</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.6.9.Final</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.1.0.RELEASE</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.1.0.RELEASE</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.1.0.RELEASE</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.1.0.RELEASE</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.1.0.RELEASE</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency></code>

And I've added this to my faces-config.xml:

<application>
    <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>

I've aloso included this into my jboss-deployment.xml:

< module name="javax.el.api" slot="main">

Why am I getting the java.lang.NoClassDefFoundError for class javax.el.ELResolver? The class is definitly included in the jar file jboss-el-api_3.0_spec-1.0.5.Final.jar, which is part of the WildFly modules (system/layers/base/javax/el/api/main). Even if I include another javax-el dependency into my pom, I get the same error. No difference if I use "provided" or not.

How is this problem caused and how can I solve it? Please help!

1
So it works in wildfly 9?Kukeltje
Hi Kukeltje.I didn't try.BDLF72
Because you so explicitly state wildfly 10 in your title, (and text)Kukeltje
I just wanted to add as much information as possible. Maybe it is an issue with the version of the app server. I don't know! I just cannot deploy the war sussessfully when then SpringBeanFacesELResolver is included in the faces-config. Without it it is not possible to use the spring beans for the jsf/primefaces beans.BDLF72
By the way ... I just tried with WildFly 9. Same problem: java.lang.ClassNotFoundException: javax.el.ELResolver. The module containing this class is present in the wildfly modules structure.BDLF72

1 Answers

0
votes

As it seems, I found at least a solution for the deployment problem.

I had to edit the module.xml of the wildfly/modules/org/springframework/spring/main/ module. It has to contain the following two lines:

< module name="javax.el.api"/>

< module name="javax.faces.api"/>

After that Wildfly was able to find the classes.

Now the dependency injection of spring beans into jsf works as expected.