ClassNotFoundException: org.jnp.interfaces.NamingContextFactory when migrating an application to JBoss EAP 7 / 6

Solution Verified - Updated -

Issue

We are migrating an application from JBoss EAP 5 to JBoss EAP 7.1 and getting this class not found exception:

javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory org.jnp.interfaces.NamingContextFactory from classloader ModuleClassLoader for Module "deployment.example.ear.example.war" from Service Module Loader [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory from [Module "deployment.example.ear.example.war" from Service Module Loader]]
  at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:120)
  at org.jboss.as.naming.InitialContext.init(InitialContext.java:101)
  at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154)
  at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:91)
  at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:43)
  at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
  at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
  at javax.naming.InitialContext.init(InitialContext.java:244)
  at javax.naming.InitialContext.<init>(InitialContext.java:216)
  at com.jboss.examples.EJBUtil.getService(EJBUtil.java:41)
...
 Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory from [Module "deployment.example.ear.example.war" from Service Module Loader]
  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:348)
  at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:115)
  ... 51 more

Environment

Red Hat JBoss Enterprise Application Platform (EAP) 7.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content