hi,
i got a soluction of my problem , so soluction is :
package com;
import com.sun.rsasign.c;
import javax.naming.InitialContext;
/**
*
* @author Shivam1
*/
public class testbean {
/** Creates a new instance of testbean */
public testbean() {
try{
com.exampleRemote updateAvailableBudgetRemote = lookupexampleBean() ;
System.out.println(updateAvailableBudgetRemote.getInfo());
}catch(Exception ex){
System.out.println(ex);
}
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
testbean t1 = new testbean();
}
private com.exampleRemote lookupexampleBean() {
try {
InitialContext ctx = new InitialContext();
ctx.addToEnvironment("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
ctx.addToEnvironment("java.naming.factory.url.pkgs", "org.jboss.naming
rg.jnp.interfaces");
ctx.addToEnvironment("java.naming.provider.url","localhost");
Object remote = ctx.lookup("test/Tester");
com.exampleRemoteHome rv = (com.exampleRemoteHome) javax.rmi.PortableRemoteObject.narrow(remote, com.exampleRemoteHome.class);
return rv.create();
}
catch(javax.naming.NamingException ne) {
java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
throw new RuntimeException(ne);
}
catch(javax.ejb.CreateException ce) {
java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ce);
throw new RuntimeException(ce);
}
catch(java.rmi.RemoteException re) {
java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,re);
throw new RuntimeException(re);
}
}
}
and plz define , "test/Tester" is jndi name into jboss.xml file at ejb module..
hahaha
u got a result