okay.. sorry abt the inacuracy..

okay...
this is waht i did...

my client...
-----------------------------------------

public class ContactTestClient1 {
    private static final String ERROR_NULL_REMOTE = "Remote interface
reference is null.  It must be created by calling one of the Home interface
methods first.";
    private static final int MAX_OUTPUT_LINE_LENGTH = 50;
    private boolean logging = true;
    private ContactHome contactHome = null;
    private Contact contact = null;

    /**Construct the EJB test client*/
    public ContactTestClient1() {
        long startTime = 0;


        if (logging) {
            log("Initializing bean access.");
            startTime = System.currentTimeMillis();
        }

        try {
            //get naming context
            Context ctx = new InitialContext();

            java.util.Hashtable myHash = ctx.getEnvironment();
            System.out.println(myHash.toString());

            java.lang.String myString = ctx.getNameInNamespace();
            System.out.println("hahah"+myString);

            //look up jndi name
            Object ref = ctx.lookup("cont");

            //cast to Home interface
            contactHome = (ContactHome) PortableRemoteObject.narrow(ref,
ContactHome.class);
            if (logging) {
                long endTime = System.currentTimeMillis();
                log("Succeeded initializing bean access.");
                log("Execution time: " + (endTime - startTime) + " ms.");
            }
        }
        catch(Exception e) {
            if (logging) {
                log("Failed initializing bean access.");
            }
            e.printStackTrace();
        }
    }

...
...
..
-------------------------

here's how its being called.. in the bean...

--------------------------------------
public class ContactBean implements EntityBean {
 EntityContext entityContext;
 public String contactOid;
 public String name;
 public String company;
 public String address1;
 public String address2;
 public String city;
 public String state;
 public String country;
 public String postal;
 public String email;
 public String phone;
 public String fax;
 public String id;
 public String accountNo;
//Calling TestClient......................................
 ContactTestClient1 contactTestClient1 = new ContactTestClient1();
 public String ejbCreate(String contactOid, String name, String company,
String address1, String address2, String city, String state, String country,
String postal, String email, String phone, String fax, String id, String
accountNo) throws CreateException {
  this.contactOid = contactOid;
  this.name = name;
  this.company = company;
  this.address1 = address1;
  this.address2 = address2;
  this.city = city;
  this.state = state;
  this.country = country;
  this.postal = postal;
  this.email = email;
  this.phone = phone;
  this.fax = fax;
  this.id = id;
  this.accountNo = accountNo;

...........
.........
...........

------------------------------------
thanks..
john

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to