Why does the following exception appear in the JON Agent log: Unable to connect to in-process ProfileService Caused by: NoInitialContextException

Solution Verified - Updated -

Issue

  • When Agent is in full debug mode, the following exception appears in the log:
    DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.jbossas5.InProcessJBossASDiscovery)- Unable to connect to in-process ProfileService.
    java.lang.RuntimeException: Failed to lookup JNDI name 'java:ProfileService' from InitialContext.
         at org.rhq.plugins.jbossas5.connection.AbstractProfileServiceConnectionProvider.lookup(AbstractProfileServiceConnectionProvider.java:84)
         at org.rhq.plugins.jbossas5.connection.LocalProfileServiceConnectionProvider.doConnect(LocalProfileServiceConnectionProvider.java:47)
         at org.rhq.plugins.jbossas5.connection.LocalProfileServiceConnectionProvider.doConnect(LocalProfileServiceConnectionProvider.java:39)
         at org.rhq.plugins.jbossas5.connection.AbstractProfileServiceConnectionProvider.connect(AbstractProfileServiceConnectionProvider.java:42)
         at org.rhq.plugins.jbossas5.InProcessJBossASDiscovery.discoverInProcessJBossAS(InProcessJBossASDiscovery.java:71)
         at org.rhq.plugins.jbossas5.ApplicationServerDiscoveryComponent.discoverInProcessJBossAS(ApplicationServerDiscoveryComponent.java:261)
         at org.rhq.plugins.jbossas5.ApplicationServerDiscoveryComponent.discoverResources(ApplicationServerDiscoveryComponent.java:111)
         at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:266)
         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at org.rhq.plugins.jbossas5.connection.AbstractProfileServiceConnectionProvider.lookup(AbstractProfileServiceConnectionProvider.java:81)
         ... 15 more
    

Environment

  • JBoss Operations Network (JON) 2.3, 2.3.1
  • JON Plug-In Pack for EAP
  • JON Agent debug logging is enabled

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