File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Fooling Websphere's smart client stubs : invoking ejb method on all clustermembers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Fooling Websphere Watch "Fooling Websphere New topic
Author

Fooling Websphere's smart client stubs : invoking ejb method on all clustermembers

Eddi Alfare
Greenhorn

Joined: Jan 10, 2010
Posts: 4
Hi,

I am using Websphere 6.0 and ejb 2.0 and a WebStart client.
I have 2 appservers running in one cluster on different nodes.
What I want to achieve, is to have a particular ejb method to be invoked on both appservers.
(Normally, because of the WorkLoad Management facility in Websphere, any remote ejb-call will result into only one of the appservers executing this method.)

This is what I tried to 'bypass' this WLM for this particular ejb-method call :

On the client I perform two lookups of the ejb, each time with a different InitialContext to connect to each specific appserver.
My code to create the InitialContext is as follows:



The values for providerUrl are
  • corbaloc::hostNameAppServer1:nodeAgent1Port
  • corbaloc::hostNameAppServer2:nodeAgent2Port

  • (nodeAgentXPort is the bootstrap port of the nodeagent on which appServerX is running.)

    I then look up the ejb ref on each InitialContext and invoke the ejb method on each ejb ref.

    When I run this code, most of the times both method calls are directed to the same appserver.

    It seems like Websphere's "smart client stubs" cannot be fooled and still load balance whether I like it or not.

    Any ideas on how I could bypass the workload manager for this particular ejb ?


    thanks.






     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Fooling Websphere's smart client stubs : invoking ejb method on all clustermembers