[jboss-user] [Beginner's Corner] - Hey I want simple steps to run an ejb sample application?

swaroop kumar do-not-reply at jboss.com
Tue Aug 17 02:20:41 EDT 2010


swaroop kumar [http://community.jboss.org/people/swaroopp] replied to the discussion

"Hey I want simple steps to run an ejb sample application?"

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

--------------------------------------------------------------
I checked with the jmx-console and jboss-web console and the i checked the JNDI names by using "JNDIView"  


*package*
** 
*com.myeclipse.ejb3;*** ** 
** 
** 
** 
** 
** 
*import*
** 
*javax.naming.Context;*** *import*
** 
*javax.naming.InitialContext;*** *import*
** 
*javax.naming.NamingEnumeration;*** *import*
** 
*javax.naming.NamingException;*** *import*
** 
*java.util.*;*** ** 
** 
** 
** 
*public*
** 
*class MyBeanClient {*** ** 
** 
*public static void main(String[] args) {*** ** 
*try {*** *Hashtable env =*
*new Hashtable();*** *env.put(*
*"java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");*** ** 
*//env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces"); //not required*** *env.put(*
*"java.naming.provider.url","localhost:1099");* ** 
*final String jndiName = "MyBean/remote";*** *Context context =*
*new InitialContext(env);*** *System.*
+*out.println("about to look up jndi name " + jndiName);*   MyBeanRemote beanRemote = (com.myeclipse.ejb3.MyBeanRemote) context.lookup(jndiName);beanRemote.doSomething();System.out.println("finished lookup"); }catch (NamingException e) { e.printStackTrace();}}}  REMOTE CLASS    package   com.myeclipse.ejb3;      import   javax.ejb.Remote;   @Remote    public   interface MyBeanRemote {  public void doSomething() ;+

















--------------------------------------------------------------

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100817/3151c5bd/attachment-0001.html 


More information about the jboss-user mailing list