Connecting to Remote Topic in JBoss EAP 6.1
sankalp.madaan Apr 11, 2014 4:07 PMHi All,
I am trying to connect to a remote topic using an EJB application. But I am getting the following error by while setting the Context
01:08:06,249 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "deployment.NORSAPP.ear.NORS.war:main" from Service Mod
ule Loader
01:08:06,249 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:64)
01:08:06,249 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:664)
01:08:06,249 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
01:08:06,250 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at javax.naming.InitialContext.init(InitialContext.java:223)
01:08:06,250 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at javax.naming.InitialContext.<init>(InitialContext.java:197)
01:08:06,250 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at com.nissanusa.nors.util.NORSCLientUtility.getInitialContext(NORSCLientUtility.java:32)
01:08:06,250 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at com.nissanusa.nors.service.NORSWebService.publishMessage(NORSWebService.java:160)
01:08:06,250 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at com.nissanusa.nors.service.NORSWebService.abc(NORSWebService.java:108)
01:08:06,251 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
01:08:06,251 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
01:08:06,251 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
01:08:06,251 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at java.lang.reflect.Method.invoke(Method.java:597)
01:08:06,251 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
01:08:06,251 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
01:08:06,252 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
01:08:06,252 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)
01:08:06,252 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
01:08:06,252 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
01:08:06,252 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
01:08:06,253 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
01:08:06,253 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
01:08:06,253 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
01:08:06,253 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
01:08:06,253 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
01:08:06,253 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
01:08:06,254 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
01:08:06,254 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
01:08:06,254 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
01:08:06,254 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
01:08:06,254 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
01:08:06,254 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
01:08:06,255 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
01:08:06,255 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
01:08:06,255 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
01:08:06,255 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
01:08:06,255 ERROR [stderr] (http-127.0.0.1/127.0.0.1:18080-1) at java.lang.Thread.run(Thread.java:662)
I am using the following code for setting the initial context:
Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY); properties.put(Context.PROVIDER_URL, "remote://localhost:4447"); properties.put(Context.SECURITY_PRINCIPAL, "NORSUser1"); properties.put(Context.SECURITY_CREDENTIALS, "NORSPassword123$"); properties.put("jboss.naming.client.ejb.context", true); Context context = new InitialContext(properties);
Please let me know if any other information is required.