• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hi

 
charmy jain
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i try to change a name but it is not work and again i will try then it is work now... ok

thnaks for inform me...

and plz, help for solved a prob because it is also not wark
i prepare stateless session bean into netbeans id and compile it and i used a jboss server and now i want to call that it's ejb methods from simple java class meanse void main method so what i do??

plz, reply me
thnaks
 
Balaji VR
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I understood from your question.

1) You want to run a Sample Stateless session bean client
2) Your IDE is NetBeans
3) Your App Server is JBOSS.

Steps: (After deploying your EJB on JBOSS)
1) Create jndi.properties file with the below entries in it

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces

2) Have the above jndi.properties & jboss-allclient.jar file in your sample client code's class path. (I beleive, you can set them in your IDE)

3) You can use the below sample code for client reference.

public class TesterClient extends java.lang.Object implements Serializable{

public static void main(String[] args) {

try {
InitialContext ic = new InitialContext();
Object o = ic.lookup("test/Tester");
TesterHome home = (TesterHome)
javax.rmi.PortableRemoteObject.narrow (o, TesterHome.class);

Tester test = home.create();
System.out.println( test.returnMessage("Hi Bala"));
} catch ( Exception e ) {
e.printStackTrace();
}//end try/catch
}//end main()
}//end class TesterClient

Hope this helps you!
 
charmy jain
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

thanks for reply me..


i do same away as u say..

thnaks

i got soluction
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic