[jboss-dev-forums] [JBoss AS 7 Development] - Re: Custom jdbc login module for remoting
Daniel Jipa
do-not-reply at jboss.com
Mon Feb 20 08:53:28 EST 2012
Daniel Jipa [https://community.jboss.org/people/danjee] created the discussion
"Re: Custom jdbc login module for remoting"
To view the discussion, visit: https://community.jboss.org/message/717993#717993
--------------------------------------------------------------
This is the way I call the test method from EJB:
public class Jndi {
public static void main(String[] args) throws NamingException,
AppException, RemoteException {
final Hashtable jndiProperties = new Hashtable();
jndiProperties.put(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.remote.client.InitialContextFactory");
jndiProperties.put(Context.PROVIDER_URL, "remote://localhost:4447");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "capone");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "1234564");
jndiProperties.put("jboss.naming.client.ejb.context", true);
final Context context = new InitialContext(jndiProperties);
final String appName = "capone";
final String moduleName = "capone-EJB";
final String distinctName = "";
final String beanName = "TestControllerBean";
final String viewClassName = TestControllerRemote.class.getName();
String lookup = "ejb:" + appName + "/" + moduleName + "/"
+ distinctName + "/" + beanName + "!" + viewClassName;
System.out.println("lookup name: " + lookup);
TestController facade = (TestController) context.lookup(lookup);
System.out.println(facade);
System.out.println("test: " + facade.testMessage("hello"));
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/717993#717993]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120220/61b1c783/attachment.html
More information about the jboss-dev-forums
mailing list