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!
you missed el-api dependency, you can add the following jar
or
Then you met ClassNotFoundException:com.sun.el.ExpressionFactoryImpl , You missed el-impl jar