com.icesoft.net.messaging.MessageServiceException: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]

ICEsoft JIRA Issue Tracker | Deryk Sinotte | 8 years ago
  1. 0

    As part of the changes that put some JMS code into the main servlet for auto-detecting JMS availability, the following is logged out into the console whenever you run the 1.7 branch of ICEfaces with Liferay on Tomcat (or perhaps other servers where JMS is available but we're not using AHS). I saw it when I tested the chat portlet for multi-view disposal: Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter <init> INFO: Messaging Properties (web.xml): null Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter <init> INFO: Server Info: Apache Tomcat/6.0.16 Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter <init> INFO: Messaging Properties: activemq.properties, jboss_ha.properties, jboss.properties Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize INFO: Trying JMS Environment: java.naming.provider.url = tcp://localhost:61616?wireFormat.maxInactivityDuration=0 java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize SEVERE: Failed JMS Environment: Cannot instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize INFO: Trying JMS Environment: java.naming.provider.url = localhost:1100 java.naming.factory.initial = org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs = org.jboss.naming:org.jnp.interfaces Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize SEVERE: Failed JMS Environment: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize INFO: Trying JMS Environment: java.naming.provider.url = localhost:1099 java.naming.factory.initial = org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs = org.jboss.naming:org.jnp.interfaces Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize SEVERE: Failed JMS Environment: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory Jul 17, 2008 6:48:04 PM com.icesoft.faces.webapp.http.servlet.MainServlet setUpMessageServiceClient WARNING: Did not start Ajax Push JMS services: com.icesoft.net.messaging.MessageServiceException: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory] at com.icesoft.net.messaging.jms.JMSAdapter.subscribe(JMSAdapter.java:367) at com.icesoft.net.messaging.MessageServiceClient.subscribe(MessageServiceClient.java:791) at com.icesoft.net.messaging.MessageServiceClient.subscribe(MessageServiceClient.java:759) at com.icesoft.faces.webapp.http.servlet.MainServlet.setUpMessageServiceClient(MainServlet.java:121) at com.icesoft.faces.webapp.http.servlet.MainServlet.init(MainServlet.java:66) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1215) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:613) Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247) at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext.<init>(InitialContext.java:197) at com.icesoft.net.messaging.jms.JMSAdapter.initialize(JMSAdapter.java:506) at com.icesoft.net.messaging.jms.JMSAdapter.subscribe(JMSAdapter.java:365) ... 22 more Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654) ... 27 more The reason seems to be that our automatic detection code: private boolean isJMSAvailable() { try { this.getClass().getClassLoader().loadClass("javax.jms.TopicConnectionFactory"); return true; } catch (ClassNotFoundException exception) { return false; } } It always return true when JMS is available on the classpath. Liferay appears to include JMS libraries even when running on Tomcat. We need more sophisticated detection (JMS and AHS are present) and/or adjusted logging.

    ICEsoft JIRA Issue Tracker | 8 years ago | Deryk Sinotte
    com.icesoft.net.messaging.MessageServiceException: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
  2. 0

    As part of the changes that put some JMS code into the main servlet for auto-detecting JMS availability, the following is logged out into the console whenever you run the 1.7 branch of ICEfaces with Liferay on Tomcat (or perhaps other servers where JMS is available but we're not using AHS). I saw it when I tested the chat portlet for multi-view disposal: Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter <init> INFO: Messaging Properties (web.xml): null Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter <init> INFO: Server Info: Apache Tomcat/6.0.16 Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter <init> INFO: Messaging Properties: activemq.properties, jboss_ha.properties, jboss.properties Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize INFO: Trying JMS Environment: java.naming.provider.url = tcp://localhost:61616?wireFormat.maxInactivityDuration=0 java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize SEVERE: Failed JMS Environment: Cannot instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize INFO: Trying JMS Environment: java.naming.provider.url = localhost:1100 java.naming.factory.initial = org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs = org.jboss.naming:org.jnp.interfaces Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize SEVERE: Failed JMS Environment: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize INFO: Trying JMS Environment: java.naming.provider.url = localhost:1099 java.naming.factory.initial = org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs = org.jboss.naming:org.jnp.interfaces Jul 17, 2008 6:48:04 PM com.icesoft.net.messaging.jms.JMSAdapter initialize SEVERE: Failed JMS Environment: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory Jul 17, 2008 6:48:04 PM com.icesoft.faces.webapp.http.servlet.MainServlet setUpMessageServiceClient WARNING: Did not start Ajax Push JMS services: com.icesoft.net.messaging.MessageServiceException: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory] at com.icesoft.net.messaging.jms.JMSAdapter.subscribe(JMSAdapter.java:367) at com.icesoft.net.messaging.MessageServiceClient.subscribe(MessageServiceClient.java:791) at com.icesoft.net.messaging.MessageServiceClient.subscribe(MessageServiceClient.java:759) at com.icesoft.faces.webapp.http.servlet.MainServlet.setUpMessageServiceClient(MainServlet.java:121) at com.icesoft.faces.webapp.http.servlet.MainServlet.init(MainServlet.java:66) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1215) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:613) Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247) at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext.<init>(InitialContext.java:197) at com.icesoft.net.messaging.jms.JMSAdapter.initialize(JMSAdapter.java:506) at com.icesoft.net.messaging.jms.JMSAdapter.subscribe(JMSAdapter.java:365) ... 22 more Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654) ... 27 more The reason seems to be that our automatic detection code: private boolean isJMSAvailable() { try { this.getClass().getClassLoader().loadClass("javax.jms.TopicConnectionFactory"); return true; } catch (ClassNotFoundException exception) { return false; } } It always return true when JMS is available on the classpath. Liferay appears to include JMS libraries even when running on Tomcat. We need more sophisticated detection (JMS and AHS are present) and/or adjusted logging.

    ICEsoft JIRA Issue Tracker | 8 years ago | Deryk Sinotte
    com.icesoft.net.messaging.MessageServiceException: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
  3. 0

    NetBeans Forums - problem with generated JSF CRUD application

    netbeans.org | 11 months ago
    javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JBOSS 6.0 Error While Starting Up.. [Solved] (JBoss/WildFly forum at JavaRanch)

    coderanch.com | 12 months ago
    javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
  6. 0

    NamingContextFactory property with Tomcat 7.0 | Bonitasoft Community

    bonitasoft.com | 6 months ago
    org.ow2.bonita.util.BonitaRuntimeException: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]

  1. Tahir 2 times, last 2 months ago
  2. Piz 2027 times, last 4 months ago
  3. jedcua 1 times, last 4 months ago
  4. esaar 3 times, last 4 months ago
  5. Justin 1 times, last 5 months ago
4 more registered users
91 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    org.jnp.interfaces.NamingContextFactory

    at org.apache.catalina.loader.WebappClassLoader.loadClass()
  2. Glassfish Core
    WebappClassLoader.loadClass
    1. org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
    2. org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
    2 frames
  3. Java RT
    InitialContext.<init>
    1. java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
    2. java.lang.Class.forName0(Native Method)
    3. java.lang.Class.forName(Class.java:242)
    4. com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
    5. javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
    6. javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
    7. javax.naming.InitialContext.init(InitialContext.java:223)
    8. javax.naming.InitialContext.<init>(InitialContext.java:197)
    8 frames
  4. com.icesoft.net
    MessageServiceClient.subscribe
    1. com.icesoft.net.messaging.jms.JMSAdapter.initialize(JMSAdapter.java:506)
    2. com.icesoft.net.messaging.jms.JMSAdapter.subscribe(JMSAdapter.java:365)
    3. com.icesoft.net.messaging.MessageServiceClient.subscribe(MessageServiceClient.java:791)
    4. com.icesoft.net.messaging.MessageServiceClient.subscribe(MessageServiceClient.java:759)
    4 frames
  5. com.icesoft.faces
    MainServlet.init
    1. com.icesoft.faces.webapp.http.servlet.MainServlet.setUpMessageServiceClient(MainServlet.java:121)
    2. com.icesoft.faces.webapp.http.servlet.MainServlet.init(MainServlet.java:66)
    2 frames
  6. Glassfish Core
    ContainerBase$ContainerBackgroundProcessor.run
    1. org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
    2. org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
    3. org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
    4. org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)
    5. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    6. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    7. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    8. org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
    9. org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
    10. org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    11. org.apache.catalina.startup.HostConfig.check(HostConfig.java:1215)
    12. org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
    13. org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    14. org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
    15. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
    16. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    17. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
    17 frames
  7. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:613)
    1 frame