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

openxava | ctorrev | 2 years ago
  1. 0

    Correr AplicaciĆ³n OpenXava con Tomcat Embedded!!!

    openxava | 2 years ago | ctorrev
    javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
  2. 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]
  3. 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]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 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]
  6. 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]

  1. treefolk 1 times, last 1 week ago
  2. Tahir 2 times, last 2 months ago
  3. Piz 2027 times, last 4 months ago
  4. jedcua 1 times, last 4 months ago
  5. esaar 3 times, last 4 months ago
5 more registered users
90 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:1720)
    2. org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    2 frames
  3. Java RT
    InitialContext.<init>
    1. java.lang.Class.forName0(Native Method)
    2. java.lang.Class.forName(Unknown Source)
    3. com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
    4. javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    5. javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    6. javax.naming.InitialContext.init(Unknown Source)
    7. javax.naming.InitialContext.<init>(Unknown Source)
    7 frames
  4. Hibernate
    ConnectionProviderFactory.newConnectionProvider
    1. org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:51)
    2. org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75)
    3. org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
    3 frames
  5. Hibernate EJB
    InjectionSettingsFactory.createConnectionProvider
    1. org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:51)
    1 frame
  6. Hibernate
    Configuration.buildSessionFactory
    1. org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:90)
    2. org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
    3. org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
    4. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
    4 frames
  7. Hibernate EJB
    HibernatePersistence.createEntityManagerFactory
    1. org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
    2. org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
    2 frames
  8. JavaEE 7
    Persistence.createEntityManagerFactory
    1. javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
    1 frame
  9. org.openxava.jpa
    XPersistence.createManager
    1. org.openxava.jpa.XPersistence.getEntityManagerFactory(XPersistence.java:182)
    2. org.openxava.jpa.XPersistence.createManager(XPersistence.java:108)
    2 frames
  10. org.openxava.annotations
    AnnotatedClassParser.getManagedClassNames
    1. org.openxava.annotations.parse.AnnotatedClassParser.obtainManagedClassNamesUsingJPA(AnnotatedClassParser.java:2605)
    2. org.openxava.annotations.parse.AnnotatedClassParser.getManagedClassNames(AnnotatedClassParser.java:2520)
    2 frames
  11. com.openxava.naviox
    NaviOXFilter.doFilter
    1. com.openxava.naviox.impl.Initializer.init(Initializer.java:18)
    2. com.openxava.naviox.web.NaviOXFilter.doFilter(NaviOXFilter.java:32)
    2 frames
  12. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    8. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    9. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    9 frames
  13. Grizzly HTTP
    JIoEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
    3 frames
  14. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    2 frames
  15. Tomcat Util
    TaskThread$WrappingRunnable.run
    1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    1 frame
  16. Java RT
    Thread.run
    1. java.lang.Thread.run(Unknown Source)
    1 frame