Access Remote EJB inside another EJB

0

Good afternoon everyone.

I'm in a project that needs to do a lookup of a remote EJB inside another EJB in a different container.

TheproblemiswhenItrytodothelookuptheInitialContextisgivingthefollowingerror.

11:12:15,377ERROR[stderr](http-localhost/127.0.0.1:8088-1)java.lang.RuntimeException:javax.naming.NamingException:Failedtocreateremotingconnection[Rootexceptionisjava.lang.RuntimeException:FailedtosetupEJBremotecontext]11:12:15,377ERROR[stderr](http-localhost/127.0.0.1:8088-1)atbr.com.seta.portal.service.bonita.integration.JndiContext.getContext(JndiContext.java:37)11:12:15,378ERROR[stderr](http-localhost/127.0.0.1:8088-1)atbr.com.seta.portal.service.bonita.integration.BonitaIntegration.getIntegracaoBonitaConsultar(BonitaIntegration.java:38)11:12:15,378ERROR[stderr](http-localhost/127.0.0.1:8088-1)atbr.com.seta.portal.service.bonita.BonitaServiceImpl.consultarGrupos(BonitaServiceImpl.java:75)11:12:15,378ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)11:12:15,378ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)11:12:15,378ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)11:12:15,378ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjava.lang.reflect.Method.invoke(Method.java:497)11:12:15,378ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)11:12:15,379ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,379ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)11:12:15,379ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)11:12:15,379ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,379ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)11:12:15,379ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:86)11:12:15,379ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:97)11:12:15,380ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)11:12:15,380ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,380ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)11:12:15,380ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)11:12:15,380ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,380ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)11:12:15,380ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,380ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)11:12:15,381ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,381ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:73)11:12:15,382ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,382ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)11:12:15,382ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,383ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)11:12:15,383ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)11:12:15,384ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,384ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)11:12:15,385ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,385ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:280)11:12:15,385ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:345)11:12:15,385ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:243)11:12:15,387ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,387ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)11:12:15,387ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,387ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)11:12:15,388ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,388ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)11:12:15,388ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,388ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)11:12:15,389ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,389ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)11:12:15,389ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,389ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)11:12:15,389ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,389ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)11:12:15,389ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,389ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)11:12:15,389ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atbr.com.seta.portal.service.bonita.BonitaService$$$view37.consultarGrupos(UnknownSource)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjava.lang.reflect.Method.invoke(Method.java:497)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)11:12:15,390ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)11:12:15,391ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)11:12:15,391ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:115)11:12:15,391ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)11:12:15,391ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)11:12:15,391ERROR[stderr](http-localhost/127.0.0.1:8088-1)atbr.com.seta.portal.service.bonita.BonitaService$-1057754167$Proxy$_$$_Weld$Proxy$.consultarGrupos(BonitaService$-1057754167$Proxy$_$$_Weld$Proxy$.java)11:12:15,391ERROR[stderr](http-localhost/127.0.0.1:8088-1)atbr.com.seta.portal.webservice.ConsultaPermissaoWSImpl_V2.validarUsuario(ConsultaPermissaoWSImpl_V2.java:39)11:12:15,391ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)11:12:15,391ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)11:12:15,392ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)11:12:15,392ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjava.lang.reflect.Method.invoke(Method.java:497)11:12:15,392ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)11:12:15,393ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,393ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)11:12:15,394ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)11:12:15,394ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,394ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)11:12:15,394ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)11:12:15,394ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,394ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)11:12:15,395ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,395ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)11:12:15,395ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)11:12:15,395ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,395ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.webservices.deployers.WSComponentInstanceAssociationInterceptor.processInvocation(WSComponentInstanceAssociationInterceptor.java:49)11:12:15,395ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)11:12:15,396ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)11:12:15,396ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)11:12:15,397ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.webservices.invocation.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:129)11:12:15,397ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.wsf.stack.cxf.JBossWSInvoker.performInvocation(JBossWSInvoker.java:177)11:12:15,397ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:104)11:12:15,397ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:237)11:12:15,398ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:69)11:12:15,398ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:146)11:12:15,398ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)11:12:15,398ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)11:12:15,398ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjava.util.concurrent.FutureTask.run(FutureTask.java:266)11:12:15,398ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)11:12:15,398ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:249)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:97)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:131)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:754)11:12:15,399ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:847)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:267)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)11:12:15,400ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)11:12:15,401ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)11:12:15,401ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)11:12:15,401ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)11:12:15,401ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)11:12:15,401ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)11:12:15,401ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)11:12:15,401ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)11:12:15,401ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)11:12:15,401ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjava.lang.Thread.run(Thread.java:745)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)Causedby:javax.naming.NamingException:Failedtocreateremotingconnection[Rootexceptionisjava.lang.RuntimeException:FailedtosetupEJBremotecontext]11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:51)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:151)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:122)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.naming.InitialContext.init(InitialContext.java:107)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjavax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.naming.InitialContext.<init>(InitialContext.java:98)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:44)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjavax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjavax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)11:12:15,402ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjavax.naming.InitialContext.init(InitialContext.java:244)11:12:15,403ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjavax.naming.InitialContext.<init>(InitialContext.java:216)11:12:15,403ERROR[stderr](http-localhost/127.0.0.1:8088-1)atbr.com.seta.portal.service.bonita.integration.JndiContext.getContext(JndiContext.java:35)11:12:15,403ERROR[stderr](http-localhost/127.0.0.1:8088-1)...134more11:12:15,403ERROR[stderr](http-localhost/127.0.0.1:8088-1)Causedby:java.lang.RuntimeException:FailedtosetupEJBremotecontext11:12:15,403ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.naming.remote.client.InitialContextFactory.setupEjbContext(InitialContextFactory.java:468)11:12:15,403ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:145)11:12:15,403ERROR[stderr](http-localhost/127.0.0.1:8088-1)...144more11:12:15,404ERROR[stderr](http-localhost/127.0.0.1:8088-1)Causedby:java.lang.reflect.InvocationTargetException11:12:15,404ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)11:12:15,404ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)11:12:15,404ERROR[stderr](http-localhost/127.0.0.1:8088-1)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)11:12:15,404ERROR[stderr](http-localhost/127.0.0.1:8088-1)atjava.lang.reflect.Method.invoke(Method.java:497)11:12:15,404ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.naming.remote.client.InitialContextFactory.setupEjbContext(InitialContextFactory.java:448)11:12:15,404ERROR[stderr](http-localhost/127.0.0.1:8088-1)...145more11:12:15,404ERROR[stderr](http-localhost/127.0.0.1:8088-1)Causedby:java.lang.SecurityException:EJBCLIENT000021:EJBclientcontextselectormaynotbechanged11:12:15,404ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.ejb.client.EJBClientContext.setSelector(EJBClientContext.java:218)11:12:15,405ERROR[stderr](http-localhost/127.0.0.1:8088-1)atorg.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.setupSelector(RemoteNamingEjbClientContextSelector.java:28)11:12:15,405ERROR[stderr](http-localhost/127.0.0.1:8088-1)...150more

ButthiserroronlyhappenswhenItrytocreatethelookupinsideEJB,ifIdoatestcreatingthelookupbyastaticvoidmainforexampleitworksperfectly.

WhatamIdoingwrong?

Thecodefollowsbelow.

IcreateJndiContext

publicclassJndiContext{privateStringhostNameEjb;privateIntegerportNameEjb;publicJndiContext(){hostNameEjb="192.168.2.198";
            portNameEjb  = 4447;
     }


    public Context getContext( )  {
        try {
            Hashtable<String, Object> jndiProperties = new Hashtable();
            jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
            jndiProperties.put(Context.PROVIDER_URL,"remote://"+hostNameEjb+":"+portNameEjb);
            jndiProperties.put(Context.SECURITY_PRINCIPAL, "admin");
            jndiProperties.put(Context.SECURITY_CREDENTIALS, "admin123.");
            jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
            jndiProperties.put("jboss.naming.client.ejb.context",true);
            jndiProperties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED",false);
            jndiProperties.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS",false);
            jndiProperties.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT",false);
//          jndiProperties.put("remote.cluster.ejb.clusternode.selector","org.jboss.ejb.client.RandomClusterNodeSelector");
//          jndiProperties.put("remote.clusters","ejb");
            jndiProperties.put("org.jboss.ejb.client.scoped.context",true);
            return new InitialContext(jndiProperties);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

Service

@Override
private IntegracaoBonitaCadastrar getIntegracaoBonitaCadastrar() { 
        IntegracaoBonitaCadastrar remote = null;
        try {
            Context ctx = new JndiContext().getContext();
            remote = (IntegracaoBonitaCadastrar) this.ctx.lookup(LOOCKUP_CADASTRO);
        } catch (NamingException e) {
            e.printStackTrace();
        }
        return remote;
    }

I'm using JBoss EAP 6.3 on both servers.

    
asked by anonymous 24.08.2016 / 22:41

0 answers