calling a client from a bean


EJB programming & troubleshooting: calling a client from a bean

  1. calling a client from a bean (4 messages)

    I have a bean which connects to a price feed and recieves prices asynchronously. I want to send these prices back to the client that initiated the connection. How do I do this ?.

    I thought I could pass the client to the bean (using an interface), and then have the bean call a price update method on the client, but when I tried this I got this exception:

    java.rmi.MarshalException: error marshalling arguments; nested exception is:
   examples.ejb.basic.statefulSession.Client examples.ejb.basic.statefulSession.Client
            at weblogic.common.internal.ChunkedObjectOutputStream.writeObject(
            at weblogic.common.internal.ChunkedObjectOutputStream.writeObject(
            at examples.ejb.basic.statefulSession.TraderBeanEOImpl_WLStub.connect(
            at examples.ejb.basic.statefulSession.Client.<init>(
            at examples.ejb.basic.statefulSession.Client.main(

    even though the client implements Serializable.

    any help would be appreciated!

    chris davis

    Threaded Messages (4)

  2. calling a client from a bean[ Go to top ]


    i think what u tryin to do is make a call-back to ur client. is the client within the same JVM as the bean ????

    i think there shud no problem if they r in the same JVM.

    if they r not then u cant just make call-back on ur client which is in a different JVM. remember ur object is not network(stub/skeleton) aware to be able to receive calls across machine or process. u have just serialized the object and that wont do the job.

    the best solution to ur problem is probably JMS. what kinda client is it - servlet/jsp or java app/applet.

  3. calling a client from a bean[ Go to top ]

    No they're not in the same jvm. The client is just a standalone java application. I guess your right, I have to use a different mechanism for the return data.

    thanks for your help

  4. calling a client from a bean[ Go to top ]

    You could either use JMS or RMI. If they are within the same JVM user the Observer pattern. Callbacks are generally avoided.
  5. It's a weblogic 6 known bug[ Go to top ]


    It's a weblogic 6 known bug with reading longs inside a chunked value. This is
    fixed in SP2 and the relevant CR is CR124377 - you can get a patch for
    SP1 from support.