-
1. Re: Help needed for an EJB (standalone) Application Client.
dasariprasad Dec 19, 2005 9:23 AM (in response to holyfish)please do this to build the 'InitialContext" like
public static InitialContext getInitialContext()
{
Properties props=new Properties();
InitialContext jndiCtx=null;
try
{
props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL,"jnp://localhost:1099");
props.put(Context.STATE_FACTORIES,"org.jboss.naming:org.jnp.interfaces");
jndiCtx=new InitialContext(props);
}
catch(Exception ex)
{}
return jndiCtx;
}
public static void main(String args[])
{
System.out.println("\nBegin TimerSessClient...\n");
try
{
InitialContext ctx=getInitialContext();
Object obj=ctx.lookup("kattabomman");
TimerSessHome home=(TimerSessHome)PortableRemoteObject.narrow(obj,TimerSessHome.class);
System.out.println("Creating TimerSess Bean\n");
TimerSess sess=home.create();........
................................
here TimerSess is remote interface of a sessionBean
TimerSessHome is home interface
you require client jars in class-path like jboss-client,jboss-j2ee,jnp-client etc
wishes
Prasad DTR