EJBs inside clusters ?

Hi, does anybody have any experience on starting some kind of OC4J servers cluster? Is it easy to have then common JNDI namespace (when one EJB deployed on one calls another EJB deployed on another node without any trouble)? Is it possible at all?
Thank you,
Andrejus Chaliapinas

oc4j/orion replicates httpsessions across clusters, but not Statefull Session beans. If you have a sfsb, you won't be able to deploy it in a clustered environment.
Entity beans and slsb's are ok, however. You can also set up an rmi cluster which will assure that if you have missing beans for some reason or another from a remote invocation, the next node in line will be used for the remote method.
regards,
the elephantwalker
www.elephantwalker.com

Similar Messages

  • Calling EJB inside Portlet (JSR168)

    How to write EJB inside portal project?
    Do I have to create EJB Project?
    How can I integrate 2 Projects?
    Is there another way?

    EJBs are a peer to webapps (which a portal project is), so you don't
    write an EJB inside a portal project.
    If you are creating a new EJB, an EJB project is definitely the best way
    to go.
    If you already have a packaged up EJB jar file, you can just use Import
    Module... in the portal application and point it to the jar file; this
    will add it to the application. Then, the EJB classes should available
    for your java portlet to reference (and to any other projects as well).
    Greg
    Prakash Malani wrote:
    How to write EJB inside portal project?
    Do I have to create EJB Project? Yes...
    How can I integrate 2 Projects?The simplest thing to do is to make them part of the same application.
    Is there another way?

  • How do I reference an EJB inside anothe EJB ,both are on different hosts

    Hi,
    I want to reference an EJB on one host inside another EJB in another
    host. Even if i hardcode the url of the host on which the EJB is
    deployed , it gives me the error regarding the no such ejb found.
    I would appreciate your help.
    Thanks

    Robert,
    We've been trying to implement this type of multi-server setup for some
    time now. Our application consists of 260+ EJBs with a large team of
    developers actively working against it. The business logic in our
    application puts the EJBS in a highly interrelated situation. This
    degree of interrelation makes it necessary for each developer to deploy
    the entire application before any work can get done.
    Starting a weblogic server, on a Windows Workstation, with 260+ beans is
    very time consuming. But to get around this development bottle neck, we
    are attempting the same scenario described in this thread. We have
    recently upgraded from WL4.5.x to WL5.1 SP8. With WL5.1, we get the
    CommunicationException seen previously in this thread. But the Error
    message in WL5.1 is less descriptive. The 5.1 error message is missing:
    WL6.0 Error Text: "This error could indicate that a component was
    deployed on a cluster member but not other members of that cluster. Make
    sure that any component deployed on a server that is part of a cluster
    is also deployed on all other members"
    It is obvious that weblogic's clustering depends on classes being
    available to each server in the cluster, including the ejbc generated
    _WLStub classes.  To me, it seems wrong that a weblogic server can only
    use standard JNDI to lookup HomeInterfaces on other weblogic servers if
    the hidden _WLStub classes are available to both servers.  I say this
    because non-weblogic clients have JNDI lookup abilities without these
    requirements. This whole experience was frustrating because all along
    I knew that the solution was simply to take the hacker route and put the
    classes in the the client classpath. I guess I just want to know if
    this is bug? If not, I think it should be.
    Thanks for listening
    Steve Dodge
    Steve Dodge
    Realeum Inc.
    Robert Patrick wrote:
    Here is an example:
    On server1, I have a Bean called TellerBean that calls the AccountBean
    that lives on server2. To make this work, I need to deploy the
    TellerBean.jar file AND any/all AccountBean Stub classes (any file in the
    deployed version of the AccountBean.jar file matching the pattern
    AccountBean*Stub.class) on server1. Server2 only needs to deploy the
    AccountBean.jar file
    Hope this helps,
    Robert
    kamps wrote:
    Thanks.
    I did include the files using import and they are alsso packaged
    into the jar file .
    I have done this , TradeCheck is the ejb i am trying to reference
    in Trader EJB.
    I package them into the jar file as follows:-
    @REM Compile EJB classes into the build directory (jar preparation)
    javac -d build TradeCheck.java TradeCheckHome.java Trader.java
    TraderHome.java TraderBean.java TradeResult.java
    @REM Make a EJB jar file, including XML deployment descriptors
    cd build
    jar cv0f std_ejb20_basic_statelessSession2.jar META-INF examples
    images
    cd ..
    @REM Run EJBC on jar file
    java -classpath
    %WL_HOME%/lib/weblogic_sp.jar;%WL_HOME%/lib/weblogic.jar weblogic.ejbc
    -compiler javac build\std_ejb20_basic_statelessSession2.jar
    %APPLICATIONS%\ejb20_basic_statelessSession2.jar
    It still gives the same error not finding the stub class.... Could
    you kindly elaborate on what needs to be done.
    I would appreciate your help.
    Thanks,
    Sunitha
    Robert Patrick <[email protected]> wrote:
    The problem is that the client that downloads the stubs
    at runtime cannot
    be another WebLogic Server. We do not support downloading
    classes into a
    running server so you will need to make sure that the
    stubs are
    "available" to the server that is acting as a client (e.g.,
    packaged in
    the EAR file) on the server acting as a client.
    kamps wrote:
    Thanks Mahendra. I am using WebLogic 6.0. Should I importthe package
    in the first ejb which references the 2nd ejb or evenin the client
    which references the first ejb.
    Thanks again,
    Sunitha
    "Mahendra Dhamdhere" <[email protected]> wrote:
    You are not getting the reference of stub.
    try this. In your client program, import the package
    in
    which ejb classes
    are present. As client downloads the stub from weblogic,
    you have to import
    the package where your stubs are present.
    which version of weblogic are you using?
    Mahendra
    kamps <[email protected]> wrote in message
    news:[email protected]...
    Thanks,
    I have 2 ejbs: one is TraderBean and a client RefClient.
    TraderBean in turn calls a method of another bean
    TradeCheckBean.
    I tried making the changes as suggested but I amgetting
    the following
    error on the client side.
    java examples.ejb20.basic.tatelessSession.RefClient"t3://localhost:7001"
    javax.naming.CommunicationException. Root exceptionis
    java.rmi.UnmarshalException:
    failed to unmarshal class java.lang.Object; nested
    exception
    is:
    java.lang.ClassNotFoundException:examples.ejb20.basic.statelessSession.Trade
    CheckBeanHomeImpl_WLStub: This error could indicatethat a component
    was deployed on
    a cluster member but not other members of that
    cluster.
    Make
    sure that any componen
    t deployed on a server that is part of a cluster
    is
    also deployed
    on all other member
    s of that cluster
    java.lang.ClassNotFoundException:examples.ejb20.basic.statelessSession.TradeCheckBea
    nHomeImpl_WLStub: This error could indicate that
    a
    component was
    deployed on a clus
    ter member but not other members of that cluster.
    Make
    sure that
    any component deploy
    ed on a server that is part of a cluster is also
    deployed
    on all
    other members of tha
    t cluster
    <<no stack trace available>>
    I would appreciate any help.
    Thanks,
    kamps
    "Mahendra Dhamdhere" <[email protected]> wrote:
    you need to get initialcontext of that server.
    Context ctx = null;
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
    try
    ctx = new InitialContext(ht); // Use
    the
    context
    in your program
    } catch (NamingException e)
    {    // a failure occurred  }
    finally {    try {ctx.close();}
    catch (Exception e)
    {      // a failure occurred    } }
    use url of that other server. After getting initialcontext,
    lookup for your
    ejb.
    Mahendra
    kampu S <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I want to reference an EJB on one host inside
    another
    EJB in another
    host. Even if i hardcode the url of the host on
    which
    the EJB is
    deployed , it gives me the error regarding the
    no
    such
    ejb found.
    I would appreciate your help.
    Thanks

  • EJB not clusterable

    I have a Stateless session bean which is being flagged with a "Conflict start: ....non clusterable and you have tried to bind more than once....". I am running WLS 7.0 SP1. How is this application to be made clusterable? Thanks.
              

              Hi,
              +Please check your weblogic-ejb-jar.xml file for clustering setting. You have
              to give following settings in your weblogic-ejb-jar.xml.
              <clustering-descriptor>
              <home-is-clusterable>true</home-is-clusterable>
              <stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
              </clustering-descriptor>
              By default these things are true.
              Check Weblogic document for details.
              Regds,
              Vikram
              Ted Nakon <[email protected]> wrote:
              >I have a Stateless session bean which is being flagged with a "Conflict
              >start: ....non clusterable and you have tried to bind more than once....".
              > I am running WLS 7.0 SP1. How is this application to be made clusterable?
              > Thanks.
              

  • EJB Handles & Clustering

    I'm just curious about what happens when I use an ejb handle for a stateful session
    bean in a clustered environment. Does the reference I get back when I use the
    handle point me back to the exact bean I was using or does it pick a clone of
    the bean on any one of the servers? Assume that the stateful bean replication
    has been enabled.
    Many Thanks,
    Ron

    Jason Pringle wrote:
              > Since serialization of the handle is not supported under clustering, how do
              > I get the servlet to "find" the same stateful bean instance on subsequent
              > invocations?
              Our docs should be more clear here. Our current version doesn't support
              fail-over on handles in a cluster. So if you create a handle on server A
              and server A goes down you will not be able to re-create the bean currently.
              This is a known bug, and it should be fixed by the EJB 1.1 release (the final
              release not the beta(s))
              As long as the server where the handle was created and where the stateful
              session bean lives are alive, handles will work fine.
              -- Rob
              > I'm ok with having it die if the server goes down (my session
              > will still exist, I'll get an "object not found" error and have the user
              > restart the operation), but would like to be able to use stateful session
              > EJBeans across servlet invocations.
              >
              > Thanks for any input!
              >
              > --Jason
              

  • Servlets, EJB in clustering!

    Hello,
    Im new to the clustering mechanism and would like to know:
    1. Can servlets which are associated with EJBs can also be clustered?
    2. How about an RMI Server running in association with an app server? Can that too be clustered?
    - ananth

    clustering capability is not defined in the specification, each vendor decides what to support. However, for the most part J2EE servers support clustering of web and ejb components as well as JMS and JNDI. I don't know of any off hand that support clustering of RMI (beyond RMI over IIOP for EJB's).
    Chuck

  • Sharing EJBs inside sessions

    Hi to all,
    I'm new to EJBs and I have the following problem.
    For each client session I need to create a shared Session EJB that is available to all the other EJBs that belong to the same session.
    I thought to create the shared bean and add a reference to it to the SessionContext so that all the others could access it, but I don't know how to do it; I also thought to add a reference to the JNDI ENC environment or use an Entity EJB, but it would be shared among all the sessions and this wouldn't be a good solution; as a last option I thought to create it and pass a reference to it in every creation method of all the other beans, but it would be very complicated.
    Do you have any suggestion?
    Thanks in advance
    Andrea Pierini

    I don't need the identifier of an EJB object, I need
    the identifier of the session; I can get the
    identifier of the client by calling
    javax.ejb.EJBContext.getCallerPrincipal, but if the
    same client opens multiple sessions this doesn't work;
    perhaps I could try to get an hash of the
    SessionContext object, but this isn't a standard
    solution.
    What do you mean for "session"? Session is not a EJB Spec. concept.
    I would like a method like
    javax.ejb.SessionContext.getSessionID or, best of all,
    javax.ejb.SessionContext.setAttribute(name,value);
    since those method are not available (and I don't
    understand why, but I'm a newbie and I need to further
    investigate), how can I do the same thing following
    the specification?
    "Session" in SessionContext stays for Session Bean type. For Entity Beans context is EntityContext.
    SessionContext interface is implemented by the container (and is container vendor dependent) and it simply doesn't define any getSessionID nor setAttribute() methods.
    The generic problem said in other words: how can the
    Session Beans belonging to the same session
    communicate one with the others without the help the
    client (I don't know who will be the clients) and
    without creating a network of references (this would
    be very complex)?
    I think the only way to make sure "Session Beans belonging to the same session
    communicate one with the others without the help the
    client (I don't know who will be the clients) and
    without creating a network of references " is to use statefull session beans, so each EJB instance serve one and only one client. This isnt a good solution because server has to instantiate many objects.
    Sorry for my bad english I hope you'll understand what I mean.
    Fil

  • Service Locator EJB Component - Clustering -oracle9iAS

    hi all,
    Anyone has idea on how to implement the service locator (EJBHomeCache) component to make it cluster aware. I am using the oracle9iAS server.
    thanks,
    Viral

    Anyone has idea on how to implement the service
    locator (EJBHomeCache) component to make it cluster
    aware. I am using the oracle9iAS server.What do you mean when you refer to cluster awareness?

  • How to keep track of EJBs in case of failover under clustered environment?

    Does anybody know what happens with a stateless session EJB in
    weblogic 5.1 under clustered environment, in case of a failover (if
    one of computers dies), the one, which keeps that ejb in a pool?
    Does that EJB automatically go to the state "does not exist"?
    Is method ejbRemove() then called on that EJB?
    Or is it still in the "method-ready pool" state? Without ejbCreate()
    method being called on this EJB?
    Or does it disappear completely without those methods being called on
    this EJB?
    I need to organize some kind of tracking for those EJBs, and it is
    critically important for me to understand what exactly methods are
    called on those EJBs.
    I saw this, but it does not answer my question:
    Clustered EJB
    All EJBs are clusterable. If an EJB is deployed on multiple servers in
    the cluster, each of these servers will be able to host instances of
    the bean. This does not necessarily mean, however, that the bean
    instances are clustered.
    EJB Homes
    All bean homes are clusterable. When a bean is deployed on a server,
    its home is bound into the cluster-wide naming service. Because homes
    are clusterable, each server can bind an instance of the home under
    the same name. When a client looks up this home, it gets a
    replica-aware stub that has a reference to the home on each server
    that deployed the bean. When create() or find() is called, the
    replica-aware stub routes the call to one of the replicas. The home
    replica that receives the finds or creates an instance of the bean on
    its server.
    Stateless EJBs
    When a home creates a stateless bean, it returns a replica-aware stub
    that can route to any server on which the bean is deployed. Because a
    stateless bean holds no state on behalf of the client, the stub is
    free to route any call to any server that hosts the bean. Also,
    because the bean is clustered, the stub can automatically fail over in
    the event of a failure. The stub does not automatically treat the bean
    as idempotent, so it will not recover automatically from all failures.
    If the bean has been written with idempotent methods, this can be
    noted in the deployment descriptor and automatic fail-over will be
    enabled in all cases.
    Thanks

    Check out Java's support for udo/redo: [http://java.sun.com/javase/6/docs/api/javax/swing/undo/package-summary.html]
    Also, google the "Memento Pattern".
    You don't have to make copies of objects, just maintain commands the can undo and redo your program's state.

  • SOAP (EJBs) clustering (WLS 7.0)

    Hi all,
    I had posted this before, too. But I did not get any working feedback. Has anyone
    ever tried clustering SOAP impls (EJB) in WLS? Does WLS support this?
    I am able to deploy simple EJBs across clustered WLS instances.
    I am unsuccessful in doing the same for a web service (SOAP) using EJBs. The application
    gets deployed but successive requests do not round robin among available services.
    I think somehow I need to do some cluster tweaks to the receiving WLS servlet
    that peeks into the SOAP message and forwards it to the right service.
    Could someone please help me out?
    I would be most grateful.
    Thanks a lot. Guha

    A traditional EJB stub (which communicates over T3 or IIOP) has
    intelligence built in to it to perform round robin load balancing. The
    same tricks don't apply for SOAP/HTTP. If you want to get that
    behavior, then you need to do the same thing used for load balancing
    servlet requests: all members of the cluster should resolve to the same
    DNS name, and use DNS round robining to distribute the load. Or use a
    load balancer like Resonate. For more information, see:
    http://e-docs.bea.com/wls/docs70/cluster/index.html.
    -Don
    Suteertha wrote:
    Hi all,
    I had posted this before, too. But I did not get any working feedback. Has anyone
    ever tried clustering SOAP impls (EJB) in WLS? Does WLS support this?
    I am able to deploy simple EJBs across clustered WLS instances.
    I am unsuccessful in doing the same for a web service (SOAP) using EJBs. The application
    gets deployed but successive requests do not round robin among available services.
    I think somehow I need to do some cluster tweaks to the receiving WLS servlet
    that peeks into the SOAP message and forwards it to the right service.
    Could someone please help me out?
    I would be most grateful.
    Thanks a lot. Guha

  • Weblogic7/examples/clustering/ejb Automatic failover for idempotent methods ?

    This one should be easy since it is from the examples folder of bea 7 about
              clustering.
              Ref : \bea7\weblogic007\samples\server\src\examples\cluster\ejb
              I am referring to the cluster example provided with the weblogic server 7.0
              on windows 2000.
              I deployed Admin server and 2 managed server as described in document.
              Everything works fine as shown by the example. I get load balancing and
              failover both. Too Good.
              Client.java is using the while loop to manage the failover. So on exception
              it will go thru the loop again.
              I understand from the documentation that the stateless session EJB will
              provide the automatic failover for Idempotent stateless bean
              Case Failover Idempotent : ( Automatic )
              If methods are written in such a way that repeated calls to the same method
              do not cause duplicate updates, the method is said to be "idempotent." For
              idempotent methods, WebLogic Server provides the
              stateless-bean-methods-are-idempotent deployment property. If you set this
              property to "true" in weblogic-ejb-jar.xml, WebLogic Server assumes that the
              method is idempotent and will provide failover services for the EJB method,
              even if a failure occurs during a method call.
              Now I made 2 changes to the code.
              1 . I added as follows to the weblogic-ejb-jar.xml of teller stateless EJB
              <stateless-clustering>
              <stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
              <stateless-bean-load-algorithm>random</stateless-bean-load-algorithm>
              <stateless-bean-methods-are-idempotent>true</stateless-bean-methods-are-idem
              potent>
              </stateless-clustering>
              So I should get the automatic failover .............
              2. Also I added the break statement in the catch on line around 230 in
              Client .java
              catch (RemoteException re) {
              System.out.println(" Error: " + re);
              // Replace teller, in case that's the problem
              teller = null;
              invoke = false;
              break;
              So that the client program does not loop again and again.
              Now I compile and restart all my three servers and redeploy application (
              just to be sure )
              I start my client and I get a automatic load balancing between the server
              which makes me happy.
              But Failover ....?
              I kill one of the managed application server in cluster at any particular
              test fail point.
              I expect the exception to be taken care automatically by error/failover
              handler in the home/remote stub
              But the client program fails and terminates.
              1. What is wrong with the code ?
              2. Does the automatic failover with the indempotent methods also has to be
              taken care by coding the similar while loop for stateless ejb ?
              Your help will be appreciated ASAP.
              Let me know if you need any thing more from my system. But I am sure this
              will be very easy as it is from the sample code.........
              Thanks
              

    Sorry I meant to send this to the ejb newsgroup.
              dan
              dan benanav wrote:
              > Do any vendors provide for clustering with automatic failover of entity
              > beans? I know that WLS does not. How about Gemstone? If not is there
              > a reason why it is not possible?
              >
              > It seems to me that EJB servers should be capable of automatic failover
              > of entity beans.
              >
              > dan
              

  • Problem: Editing a deployment descriptor of an EJB or WAR inside of an EAR sends things to hell

    Hello,
    I've got an EAR with utility classes in lib/ (like log4j and some other
    goodies).
    Inside my EJBs, I have manifests that have class-path entries that reference
    this and they all work upon initial load (I when they don't work because my
    beans don't load).
    When I edit my descriptors using the WebLogic console and persist my
    changes, my EJBs crap out because they can no longer load log4j. When I
    shutdown WebLogic and looked at the manifest inside the EJB inside of the
    EAR, sure enough, the class-path entry that kept the whole thing working was
    gone. WebLogic decided to instead detail a bunch of classes.
    Any workaround for this (other than to include all classes in all EJBs)?
    This prevents customers and deployers from doing their jobs. :(
    How do I report this to BEA? I poked around the website and could nary find
    a "report bug" link.
    thanks,
    greg

    Yes - getting to support should be easier ...
    www.bea.com -> Services -> Customer Support Services -> Learn More about WebSupport
    -> Register for Web Account
    Then you can follow the WebSupport link at the bottom of any page.
    Mike
    "Gregory Gerard" <[email protected]> wrote:
    Hello,
    I've got an EAR with utility classes in lib/ (like log4j and some other
    goodies).
    Inside my EJBs, I have manifests that have class-path entries that reference
    this and they all work upon initial load (I when they don't work because
    my
    beans don't load).
    When I edit my descriptors using the WebLogic console and persist my
    changes, my EJBs crap out because they can no longer load log4j. When
    I
    shutdown WebLogic and looked at the manifest inside the EJB inside of
    the
    EAR, sure enough, the class-path entry that kept the whole thing working
    was
    gone. WebLogic decided to instead detail a bunch of classes.
    Any workaround for this (other than to include all classes in all EJBs)?
    This prevents customers and deployers from doing their jobs. :(
    How do I report this to BEA? I poked around the website and could nary
    find
    a "report bug" link.
    thanks,
    greg

  • General question: Connect to EJB

    Hi,
    At the moment I am working on the architectural design of a new application written by J2EE technology.
    To study the subject I read many books and tried a large number of HelloWorld applications with EJB.
    As I understand it, the EJB works like this:
    Client ==> [RMI] ==> EJB ==> [JCA] ==> Node X
    or
    Client ==> [RMI] ==> EJB ==> [JDBC] ==> RDBMS
    My picture from EJB down to JCA or JDBC is quite clear although the construction of a JCA was quite troublesome. My picture from the Client to the EJB is not so clear.
    Until now I succeeded to connect to a EJB by using JMS, RMI and Webservice (SOAP).
    Web Services is great since my application must support this so it looks a good idea to connect this with a stateless session bean.......
    However I also need to support some kind of simplified LDAP and perhaps another legacy protocol. So I think I actually need to add a listening socket to the EJB. Of course this cannot be done by default, since a EJB is not allowed to act as server. But how can we achieve this anyway and work "by the book"? I would like to use stateless session beans to use the Application Servers infrastructure like robust thread handling, clustering and hot deployment possibilities.
    Downstream we use JCA/JDBC but how to we listen to upstream commands? Is there only SOAP, RMI and JMS? Should I develop another JCA and connect this to a EJB in some way?
    Sorry for all my questions, but in all Hello Pet Store World examples I have seen so far a web tier exists. All operations are initiated by the web browser. In my case there is not such a thing like a web browser or web tier.
    Thanks for your support, it would be great if I just knew where to continue reading!
    Joop

    Hi Dmitry, I too had a few problems with the Sun App server. I was trying to call add a message to a JMS Message queue (of a Message-Driven bean) from a standalone Java application running on a second node. After researching the problem for some time, we still have not found a solution for this bug. We are getting a GIOP Magic error.
    You should not have problems deploying an EAR. This is working. You might need to investigate these problems, i.e. deployment process, configuration, etc.
    How should I make lookups if I deploy "Enterprise Applications" with EJB inside it. Your lookups should use the InitialContext and the JNDI tree of the application server. Again, you need to make sure that your deployment is correctly building the JNDI tree.
    How are you deploying the application modules?
    />

  • Session Failover and Clustering

              Let's say that we have two WebServers (NES) with the weblogic plugin (say WS1 and WS2) and a cluster with two WebLogicCommerce AppServers (say AS1 and AS2). Let's assume that each WebServer and AppServer runs on its own machine (total: 4 machines). Now, let's assume that the WebServer "obj.conf" files (on both WS1 and WS2) are setup so that they point to the servers in the cluster (WebLogicCluster="AS1:7601,AS2:7601").
              When a new request comes in to one of the WebServers (say WS1), the plugin will route it to one of the AppServers using Round-Robin (say AS1). A session will now be initiated in AS1 and it sends a response back to the client.
              Question 1: How does the other proxy in WS2 know that all future requests for this client need to be forwarded to AS1?
              Question 2: For failover, does the cluster automatically replicate the session state existing in AS1 onto AS2 before sending the response (does AS2 automatically become the secondary)?
              Now let's assume that AS1 crashes/dies. When the next request from the client comes to WS1 or WS2, they will forward it to AS1 (assuming that WS2 knows about the client session in AS1) . Since AS1 has crashed, will the client eventually get a timeout error message?
              Question 3: To ensure that the session failover happens so that AS2 gets the request instead (becomes the primary), do we need to setup a WebLogic Proxy Server? If so, why can't the plugins for NES provide the failover themselves?
              Thank you very much for your help!
              Giri
              

              Thank you very much for your responses. It has been very helpful and I am clear on the session/clustering stuff. I have new questions on EJB and clustering which I will post as a separate thread.
              Giri
              "Jason Rosenberg" <[email protected]> wrote:
              >And also, if the browser has cookies disabled, it is important for
              >the app server to embed the WebLogicSession info via url rewriting,
              >otherwise the proxy or NES will not be able to route the session
              >properly.
              >
              >So, in all http responses, be sure to pass the url string through
              >response.encodeURL(). This will do the right thing depending
              >on whether cookies are enabled or not.
              >
              >I've just only recently figured this out. Haven't actually tried it
              >all out yet, so forgive me if it is not quite this simple, but this
              >seems to be the gist of it...
              >
              >Jason
              >
              >
              >"Justin James" <[email protected]> wrote in message news:[email protected]...
              >>
              >> Giri,
              >>
              >> I'm not a weblogic representative, but I tried to replicate this proxing service inside a load balancing switch(BigIP) and I
              >discovered a few things. The weblogic server sets a cookie (WebLogicSession)that the webserver plugin uses to manage the proxying.
              >The cookie (found in the HTTP header information) contains encoded information about the primary and secondary application servers
              >that the session is bound too. Any web server can read the cookie to determine how to dispatch the request to the primary server.
              >If the primary server does not respond, the request is forwarded to the secondary server by the plugin. Regardless of cluster size,
              >the session is replicated to only one other server.
              >>
              >> <[email protected]> wrote:
              >> >Giri Alwar wrote:
              >> >
              >> >> I need a couple of clarifications. First with regard to Question 1, I understand that plugins provide load balancing and
              >failover but what I really was asking is how the plugin in WS2 knows that a session for the client has been initiated in AS1 as a
              >result of WS1 sending the initial request to AS1. If WS2 gets a future request from the client, it needs to know this to send the
              >request to AS1. Does the plugin talk to the cluster to find out if there is a primary and who it is?
              >> >>
              >> >
              >> >> I should have clarified that my other questions pertain to in-memory replication. If I do not persist the session in a database
              >then does the client get an error message (timeout) when AS1 goes down (assuming we use NES with the WebLogic plugin)?
              >> >
              >> >Plugins' know how to route requests based on cookies. If it can't reach the primary server it will automatically try secondary.
              >In your case it doesn't matter if it reaches to proxy 1 or proxy 2, it is still the same.
              >> >
              >> >- Prasad
              >> >
              >> >> To prevent this error message and achieve failover, do I need to use WebLogic as the proxy server? If so, why isn't the NES
              >plugin doing this?
              >> >
              >> >> Thanks.
              >> >> Giri
              >> >>
              >> >> Prasad Peddada <[email protected]> wrote:
              >> >> >Giri Alwar wrote:
              >> >> >
              >> >> >> Let's say that we have two WebServers (NES) with the weblogic plugin (say WS1 and WS2) and a cluster with two
              >WebLogicCommerce AppServers (say AS1 and AS2). Let's assume that each WebServer and AppServer runs on its own machine (total: 4
              >machines). Now, let's assume that the WebServer "obj.conf" files (on both WS1 and WS2) are setup so that they point to the servers
              >in the cluster (WebLogicCluster="AS1:7601,AS2:7601").
              >> >> >>
              >> >> >> When a new request comes in to one of the WebServers (say WS1), the plugin will route it to one of the AppServers using
              >Round-Robin (say AS1). A session will now be initiated in AS1 and it sends a response back to the client.
              >> >> >>
              >> >> >> Question 1: How does the other proxy in WS2 know that all future requests for this client need to be forwarded to AS1?
              >> >> >
              >> >> > Plugin takes care of load balancing and failover, it is all transparent to the client.
              >> >> >
              >> >> >
              >> >> >> Question 2: For failover, does the cluster automatically replicate the session state existing in AS1 onto AS2 before sending
              >the response (does AS2 automatically become the secondary)?
              >> >> >
              >> >> > If you have only two yes it is automatically your secondary. Yes, replication is synchronous.
              >> >> >
              >> >> >>
              >> >> >> Now let's assume that AS1 crashes/dies. When the next request from the client comes to WS1 or WS2, they will forward it to
              >AS1 (assuming that WS2 knows about the client session in AS1) . Since AS1 has crashed, will the client eventually get a timeout
              >error message?
              >> >> >
              >> >> > If you are using some kind of persistence then you will be able to retrieve the session information and since the server
              >is not available the request will automatically failover.
              >> >> >
              >> >> >> Question 3: To ensure that the session failover happens so that AS2 gets the request instead (becomes the primary), do we
              >need to setup a WebLogic Proxy Server? If so, why can't the plugins for NES provide the failover themselves?
              >> >> >
              >> >> > No, you need only one. Either NES or weblogic proxy.
              >> >> >
              >> >> >
              >> >> >> Thank you very much for your help!
              >> >> >> Giri
              >> >> >
              >> >> >- Prasad
              >> >> >
              >> >
              >>
              >
              >
              

  • How to set classpath to EJB and Servlets

    Hi all,
    How can I add a classpath to EJB and Servlets in Weblogic 6.1, so that that classpath
    can be achieved by both EJB jar and war file? I have deployed a .ear file having
    the jar and war files. Now the EJBs inside the jar file are not reaching the class
    files of the war file and the class files in the war file are not reaching to
    the EJBs. Please let me know at the earliest.
    Atanu

    Hi.
    You might try looking at the petstore example which combines webapps (war files) with
    ejbs in an ear file to see how to do this. It may be a simple config problem.
    Regards,
    Michael
    Atanu Dey wrote:
    Hi all,
    How can I add a classpath to EJB and Servlets in Weblogic 6.1, so that that classpath
    can be achieved by both EJB jar and war file? I have deployed a .ear file having
    the jar and war files. Now the EJBs inside the jar file are not reaching the class
    files of the war file and the class files in the war file are not reaching to
    the EJBs. Please let me know at the earliest.
    Atanu--
    Michael Young
    Developer Relations Engineer
    BEA Support

Maybe you are looking for