My Oracle Support Banner

CDI ClassNotFoundException Exception At Deployment Time (Doc ID 1552823.1)

Last updated on APRIL 06, 2018

Applies to:

Oracle Weblogic Server - Version and later
Information in this document applies to any platform.


When deploying an application using CDI feature into WLS version , it fails with the following ClassNotFoundException exception :

Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
  at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(
  at weblogic.utils.classloaders.GenericClassLoader.findClass(
  at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(
  at java.lang.ClassLoader.loadClass(
  at java.lang.ClassLoader.loadClass(
  at weblogic.utils.classloaders.GenericClassLoader.loadClass(
  at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(
  at org.jboss.weld.bootstrap.BeanDeployer.addClass(
  at org.jboss.weld.bootstrap.BeanDeployer.addClasses(
  at org.jboss.weld.bootstrap.BeanDeployment.createBeans(
  at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(

The applicaton is composed of web module which is having a servlet TestCaseServlet injecting a bean (MyManagedBean.class) and a not used class  (DummyActivity.class) .

The  related WAR file consists of :
  - Web-inf \ classes \myweb\TestCaseServlet.class
  - Web-inf \lib  \ again_ncdfeCDI.jar
  which contains
        mypackage \MyManagedBean.class
        mypackage \DummyActivity.class
TestCaseServlet  servlet  is injecting MyManagedBean bean as  the following  :

public class TestCaseServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
MyManagedBean bean; ....}

But, the DummyActivity class is not  a bean and not used by the servlet.  Here is the  DummyActivity  code :

package mypackage;

import org.apache.log4j.Logger;

public class DummyActivity {

private final static Logger LOG = Logger.getLogger(DummyActivity.class);

public void start() {"ciao");


Note that the static field  (LOG) in DummyActivity class  refering  anohter class (org.apache.log4j.Logger class is not packaged in the deployed application or in WLS classpath) .


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.