1

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!

TT.
  • 15,774
  • 6
  • 47
  • 88
Sumanth
  • 595
  • 3
  • 14
  • 39
  • Can you include the relevant parts of `jboss-deployment-structure.xml` and what you tried in `global-modules`? – TT. Jan 01 '17 at 21:28
  • @TT. added relevant parts – Sumanth Jan 01 '17 at 21:47
  • 1
    You should not normally have to mess with `jboss-deployment-structure.xml` or `global-modules`. What is the original class loading problem that you were trying to solve? – Steve C Jan 02 '17 at 00:38
  • @SteveC com.sun.el.ExpressionFactoryImpl class is the actual issue – Sumanth Jan 02 '17 at 05:50
  • Do you ever reference this class directly in your code? If not, have you included your own JSF implementation with your application (instead of using the one provided by WildFly)? ie. Do you have mojarra jars anywhere in your EAR? – Steve C Jan 02 '17 at 09:28
  • @SteveC i do not have this class reference directly in my code. But i just included it in import statement. Still i am getting the same error. My application is not JSF implementation. It is just Servlet, JSP implementation. No mojarra jars are not present in my EAR – Sumanth Jan 02 '17 at 17:58
  • What about `el-impl` and/or `el-api` jars? – Steve C Jan 02 '17 at 23:19
  • you have EAR deployment so you need to define dependencies for sub-deployments in jboss-deployment-structure.xml – Tomaz Cerar Jan 05 '17 at 15:32
  • try with below: ` org.glassfish.web el-impl 2.2 ` – Anup Dey Jan 07 '17 at 07:46

1 Answers1

0

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>
Anup Dey
  • 876
  • 5
  • 6