java.lang.SecurityException: EJBCLIENT000021: EJB client context selector may not be changed
mrudulav Feb 5, 2017 2:52 AMHi ,
I am facing the below exception on my new application server, which is JBOSS EAP 6.4
java.lang.SecurityException: EJBCLIENT000021: EJB client context selector may not be changed
[Server:calogi-web1] 11:43:39,785 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.ejb.client.EJBClientContext.setSelector(EJBClientContext.java:218)
[Server:calogi-web1] 11:43:39,785 ERROR [stderr] (http-/0.0.0.0:8080-1) at com.emirates.jfoundation.client.servicelocator.JFClientServiceLocator.setEJBClientContextForSubsystem(JFClientServiceLocator.java:912)
[Server:calogi-web1] 11:43:39,785 ERROR [stderr] (http-/0.0.0.0:8080-1) at com.emirates.jfoundation.security.jboss.JBossLoginModule.serverLogin(JBossLoginModule.java:68)
[Server:calogi-web1] 11:43:39,785 ERROR [stderr] (http-/0.0.0.0:8080-1) at com.emirates.jfoundation.security.login.client.JFoundationClientLoginModule.login(JFoundationClientLoginModule.java:99)
[Server:calogi-web1] 11:43:39,785 ERROR [stderr] (http-/0.0.0.0:8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[Server:calogi-web1] 11:43:39,785 ERROR [stderr] (http-/0.0.0.0:8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[Server:calogi-web1] 11:43:39,786 ERROR [stderr] (http-/0.0.0.0:8080-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[Server:calogi-web1] 11:43:39,786 ERROR [stderr] (http-/0.0.0.0:8080-1) at java.lang.reflect.Method.invoke(Method.java:606)
[Server:calogi-web1] 11:43:39,786 ERROR [stderr] (http-/0.0.0.0:8080-1) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:762)
[Server:calogi-web1] 11:43:39,786 ERROR [stderr] (http-/0.0.0.0:8080-1) at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
[Server:calogi-web1] 11:43:39,786 ERROR [stderr] (http-/0.0.0.0:8080-1) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:690)
[Server:calogi-web1] 11:43:39,786 ERROR [stderr] (http-/0.0.0.0:8080-1) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:688)
[Server:calogi-web1] 11:43:39,787 ERROR [stderr] (http-/0.0.0.0:8080-1) at java.security.AccessController.doPrivileged(Native Method)
[Server:calogi-web1] 11:43:39,787 ERROR [stderr] (http-/0.0.0.0:8080-1) at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:687)
[Server:calogi-web1] 11:43:39,787 ERROR [stderr] (http-/0.0.0.0:8080-1) at javax.security.auth.login.LoginContext.login(LoginContext.java:595)
Am attaching the code below which throws the exception.
Properties p = new Properties();
p.put("java.naming.factory.url.pkgs", "org.jboss.ejb.client.naming");
EJBClientConfiguration ejbClientConfig = new PropertiesBasedEJBClientConfiguration(p);
ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(ejbClientConfig);
EJBClientContext.setSelector(selector);