How to deploy EJB on sun app.

i am facing problem with deploy my 1st EJB

i have no excperince with it at all.

i have deploy them in EJB on sun appliaction server 8.2 but how can i try to use it with it client.

when try to run client says it can not connect to ORB

please give me hand to get up

1-i have this homeobject

import javax.ejb.*;

import java.rmi.RemoteException;

/**

* This is the home interface for HelloBean. This interface

* is implemented by the EJB Server - the

* implemented object is called the Home Object, and serves

* as a factory for EJB Objects.

*

* The create() method in this Home Interface corresponds to

* the ejbCreate() method in HelloBean.

*/

public interface HelloHome extends EJBHome {

/*

* This method creates the EJB Object.

*

* then returns a reference to the newly created EJB Object.

*/

Hello create() throws RemoteException, CreateException;

}

2- this is ojb

import javax.ejb.*;

import java.rmi.RemoteException;

import java.rmi.Remote;

/**

* This is the HelloBean remote interface.

*

* This interface is what clients use to

* interact with EJB objects. The container

* vendor implements this interface. The

* implemented object is the EJB object, which

* delegates method calls to the actual EJB.

*/

public interface Hello extends EJBObject {

/**

* The hello() method returns a greeting to the client.

*/

public String hello() throws RemoteException;

}

3- this is the bean it self.

import javax.ejb.*;

import javax.naming.*;

import javax.rmi.*;

/**

* Demonstration stateless session bean.

*/

public class HelloBean implements SessionBean {

public String test;

//

// EJB-required methods

//

public void ejbCreate() {

System.out.println("ejbCreate()");

}

public void ejbRemove() {

System.out.println("ejbRemove()");

}

public void ejbActivate() {

System.out.println("ejbActivate()");

}

public void ejbPassivate() {

System.out.println("ejbPassivate()");

}

public void setSessionContext(SessionContext ctx) {

System.out.println("setSessionContext()");

}

//

// Business methods

//

public String hello() {

System.out.println("hello()");

return "Hello, World!";

}

}

4- this th client

import javax.ejb.*;

import javax.rmi.*;

import javax.naming.*;

import java.util.*;

public class HelloClient {

public static void main (String args[]) {

Hashtable props = new Hashtable();

InitialContext initCtx;

try {

props.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");

props.put("java.naming.provider.url", "iiop://localhost:1050");

initCtx = new InitialContext(props);

Object obj = initCtx.lookup("HelloHome");

HelloHome hh = (HelloHome) PortableRemoteObject.narrow(obj, HelloHome.class);

Hello h = (Hello)hh.create();

System.out.println(h.hello());

h.remove();

}

catch(Exception e) {

e.printStackTrace();

System.out.println(e.getMessage());

}

}

}

[3384 byte] By [Mr.goala] at [2007-10-3 3:32:34]
# 1
Please follow the instructions for accessing Remote EJBs in our EJB faq.We don't recommend using the CosNaming provider to access Remote EJBs :https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB
ksaksa at 2007-7-14 21:26:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
thanks but this document looks complex for me .do have some thing easier because english not my mother language.
Mr.goala at 2007-7-14 21:26:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...