[jboss-user] [EJB3] - Accessing secure EJBs from remote server

Balaji Katika do-not-reply at jboss.com
Wed Nov 2 02:39:18 EDT 2011


Balaji Katika [http://community.jboss.org/people/rbalaji] created the discussion

"Accessing secure EJBs from remote server"

To view the discussion, visit: http://community.jboss.org/message/634536#634536

--------------------------------------------------------------
Hi,

I've been trying to invoke EJBs (secured) deployed on a remote server (say A) from my local EAR. Both EARs are deployed and running on JBoss 5.1
To put it in simple words,... Access secured EJB from local EJB.

Please help me get rid of this exception.. Also, suggest me alternate methods of invocation (like using org.jboss.naming.HttpNamingContextFactory). 

I've been getting the below exception
‘Caused by: org.jboss.aop.NotFoundInDispatcherException: Object with oid: ProxyFactory/onaro/SummarySessionEJB/SummarySession was not found in the Dispatcher’

Code snippet below...


 SummarySession ss = *null*;
 Properties env=*new* Properties();
 env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
 env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" );
 env.setProperty("java.naming.provider.url", "10.10.10.1:1099"); // IP of the SS Server (Remote machine)
 env.put(Context.+SECURITY_PRINCIPAL+, "admin");
 env.put(Context.+SECURITY_CREDENTIALS+, "admin123");

 *try* {
  context = *new* InitialContext(env);
 } *catch* (NamingException e) {
 // *TODO* Auto-generated catch block
  e.printStackTrace();
 }
 System.+out+.println("Inititial context created");

 *try* {
 ss = (SummarySession) context.lookup(SummarySession.+JNDI_NAME+); //the JNDI binding on the remote server

 } *catch* (NamingException e) {
 e.printStackTrace();
 }
 String cbn = *null*;
 *try* {
 cbn = ss.getCodeBuildNumber();
 } *catch* (SummaryException e1) {

 e1.printStackTrace();
 }
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/634536#634536]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111102/f8d5dfc3/attachment.html 


More information about the jboss-user mailing list