WildFly 9.0.2 classloading issues

581 views Asked by At

I am facing classloading issue in a WildFly server. I have deployed my EAR file in WildFly Standalone server. And declared dependencies through jboss-deployment-structure.xml.

Everything seems to be working fine except this class:

Caused by: java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at javax.el.FactoryFinder.newInstance(FactoryFinder.java:88)

I tried to solve this by adding org.glassfish.javax.el module to jboss-deployment-structure.xml:

<jboss-deployment-structure>
    <deployment>
        <dependencies>      
            <module name="org.glassfish.javax.el" export= "TRUE"/>
            <module name="xxxxxxxx" export= "TRUE"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

I also tried to solve by adding this to global-modules in configuration file. But still I am getting the same error.

<global-modules>
      <module name="org.glassfish.javax.el" slot="main"/>
</global-modules>

I tried to log classloading by enabling TRACE on org.jboss.classloader logger category but no luck.

Then I enabled classloading from JAVA_OPTS (-verbose:class) to console but this class is found in the log. In fact i didn't find many jars mentioned in the jboss-deployment-structure.xml in the logs.

Could someone please help me to solve this issue? Thank you in advance!

1

There are 1 answers

0
Anup Dey On

you missed el-api dependency, you can add the following jar

<dependency>
    <groupId>javax.el</groupId>
    <artifactId>el-api</artifactId>
    <version>2.2</version>
    <scope>provided</scope>
</dependency>

or

<dependency>
  <groupId>javax.el</groupId>
  <artifactId>javax.el-api</artifactId>
  <version>3.0.0</version>
  <scope>test</scope>
</dependency>

Then you met ClassNotFoundException:com.sun.el.ExpressionFactoryImpl , You missed el-impl jar

<dependency>
  <groupId>org.glassfish.web</groupId>
  <artifactId>el-impl</artifactId>
  <version>2.2</version>
  <scope>test</scope>
</dependency>