What kind of object is BTBugdataTableData.  It is throwing an exception
because it is not serializable. Did you make it implement Serializable?

Jay Wagner
Sybase Inc.

-----Original Message-----
From: Puri, Ketan [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 28, 2000 11:22 AM
To: [EMAIL PROTECTED]
Subject: exception while running the client




hi
when i run my client program  as below.
it throws remote exception.
can any one help me out.

package bugtracker.entitybean.bugdatabean;

import java.lang.*;
import java.rmi.RemoteException;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Vector;
import java.sql.Timestamp;

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.FinderException;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.RemoveException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;

public class Client {

  BTBugdataHome home = null;

  public Client() {
    try {
    Properties prop = System.getProperties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.T3InitialContextFactory");
    prop.put(Context.PROVIDER_URL, "t3://localhost:7001");
    Context ctx = new InitialContext(prop);

    home = (BTBugdataHome) ctx.lookup("bugdataHome");
    } catch (NamingException ne) {
      log("Unable to look up the beans home: " + ne.getMessage());
      System.exit(1);
    }
    log("Home Found...");
  }

  public void viewData() {
    BTBugdataTableData tableData = new BTBugdataTableData();
    tableData.setReportedBy(1);
    Enumeration iterator = null;
    try {
      iterator = home.findByAnyKey(tableData);
      while(iterator.hasMoreElements()) {
        System.out.println("Found a record");
        //BTBugdata _bugdata = (BTBugdata)
PortableRemoteObject.narrow(iterator.nextElement(), BTBugdata.class);
        //BTBugdataTableData _data = _bugdata.getBugDataObject();
        //_data.print();
      }
    } catch(Exception ex) {
      ex.printStackTrace();
    }
  }

  public void createData() {
    BTBugdataTableData tableData = new BTBugdataTableData();
    tableData.setProjectId(1);
    tableData.setModuleId(1);
    tableData.setReportedBy(1);
    tableData.setDateReported(new Timestamp(new
java.util.Date().getTime()));
    tableData.setBugDescription("Nitin is Great");

    log("creating Bug...");
    try {
      BTBugdata _bugdata = (BTBugdata)
PortableRemoteObject.narrow(home.create(tableData), BTBugdata.class);
    } catch(Exception ex) {
      ex.printStackTrace();
    }
  }

  private static void log(String s) {
    System.out.println(s);
  }


  public static void main(String args[]) {
    System.out.println("\nBeginning beanManaged.Client...\n");
    Client client = new Client();
    client.createData();
    client.viewData();
    System.out.println("\nEnd beanManaged.Client...\n");

  }
}
===============================on execution------====================
Beginning beanManaged.Client...

java.rmi.RemoteException: ; nested exception is:
        weblogic.rmi.MarshalException: error marshalling arguments
 - with nested exception:
[java.io.IOException: Class
bugtracker.entitybean.bugdatabean.BTBugdataTableData with code=123 does
not implement Serializable, Externalizable or WLSerializable]
java.io.IOException: Class
bugtracker.entitybean.bugdatabean.BTBugdataTableData with code=123 does n
ot implement Serializable, Externalizable or WLSerializable
        at
weblogic.common.internal.WLObjectOutputStreamBase.writeObjectBody(WLObjectOu
tputStreamBas
e.java, Compiled Code)
        at
weblogic.common.internal.WLObjectOutputStreamBase.writeObject(WLObjectOutput
StreamBase.ja
va, Compiled Code)
        at
weblogic.common.internal.WLObjectOutputStreamBase.writeObjectWL(WLObjectOutp
utStreamBase.
java, Compiled Code)
        at
weblogic.rmi.extensions.AbstractOutputStream2.writeObject(AbstractOutputStre
am2.java:82)
        at
weblogic.rmi.extensions.AbstractOutputStream.writeObject(AbstractOutputStrea
m.java:83)
        at
bugtracker.entitybean.bugdatabean.BTBugdataBeanHomeImpl_WLStub.findByAnyKey(
BTBugdataBean
HomeImpl_WLStub.java:269)
        at
bugtracker.entitybean.bugdatabean.BTBugdataBeanHomeImpl_ServiceStub.findByAn
yKey(BTBugdat
aBeanHomeImpl_ServiceStub.java, Compiled Code)
        at bugtracker.entitybean.bugdatabean.Client.main(Client.java,
Compiled Code)

--------------- nested within: ------------------
weblogic.rmi.MarshalException: error marshalling arguments
 - with nested exception:
[java.io.IOException: Class
bugtracker.entitybean.bugdatabean.BTBugdataTableData with code=123 does
not implement Serializable, Externalizable or WLSerializable]
        at
bugtracker.entitybean.bugdatabean.BTBugdataBeanHomeImpl_WLStub.findByAnyKey(
BTBugdataBean
HomeImpl_WLStub.java:273)
        at
bugtracker.entitybean.bugdatabean.BTBugdataBeanHomeImpl_ServiceStub.findByAn
yKey(BTBugdat
aBeanHomeImpl_ServiceStub.java, Compiled Code)
        at bugtracker.entitybean.bugdatabean.Client.main(Client.java,
Compiled Code)
Exception in thread "main" java.lang.NullPointerException
        at bugtracker.entitybean.bugdatabean.Client.main(Client.java,
Compiled Code)

C:\bugtracker\entitybean\bugdatabean>

Ketan Puri
Associate
HCL Perot Systems
(Youngest CMM Level 5 company)
Ph 91-11-91 4581236-41 Ext. 3240
[EMAIL PROTECTED], [EMAIL PROTECTED]
NOIDA, INDIA.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to