HI
I am adding my program extracts with this mail
the ejb-jar.xml file for the session bean
<ejb-jar>
<description>Simple Socket Communication EJB</description>
<display-name>MySocket</display-name>
<enterprise-beans>
<session>
<ejb-name>SocketEJB</ejb-name>
<home>adapter.SessionHome</home>
<remote>adapter.SessionRemote</remote>
<ejb-class>adapter.SessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
the jboss.xml file
<jboss>
<enterprise-beans>
<session>
<ejb-name>SocketEJB</ejb-name>
<jndi-name>SocketEJB</jndi-name>
</session>
</enterprise-beans>
</jboss>
the client program
public class SocketClient {
public static Hashtable env = new Hashtable();
static SessionRemote remote ;
public SocketClient() {
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.put("java.naming.factory.url.pkgs","org.jboss.naming

rg.jnp.interfaces");
env.put(Context.PROVIDER_URL,"localhost:1099");
connect();
}
public void connect(){
Context ctx = null;
Object obj = null;
try {
ctx = new InitialContext(env);
obj = ctx.lookup("SocketEJB");
SessionHome sessionHome = (SessionHome) PortableRemoteObject.narrow(obj,SessionHome.class);
remote = sessionHome.create();
System.out.println("Created ");
remote.connect();
} catch (NamingException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
} catch (CreateException e) {
e.printStackTrace();
}
}
public static void main(
String args[]){
new SocketClient();
}
}
hope u know the home, bean and remote java file
if u look in the xml files mentioned above u will see the jndi name, that same name is used in the client program in the ctx.lookup
i wrote this this session bean to find a embedded device located in the network.. using socket communication
if u want i will send the whole thing as a attachment ...
regads
Narendran