Weblogic clustering - Non session objects

Hi,
I have an app that doesn't have any HttpSession object or EJBs. We have only one servlet for entire application that works as a controller and we store all the information regarding the user in the servlet instance variable as cache. None of our objects are Serializable. Can i deploy my application on weblogic cluster. Will weblogic support clustering for thsi kind of applications. We have only one servlet and all other classes are normal java classes. No JSP, EJB etc. No HttpSession or ApplicationContext of servlets are being used.
thanks,
webbie.

Hi,
The There are basically two reasons ...for which we want Clustering:
<h3><font color=maroon>Reason - 1): Failover</font></h3>
This feature needs HttpSession replication...Failover means if a Userhas Logged in to our application and accessing some pages ...then his HttpSession Replica will be available in a Secondary WebLogic Server so...even if his Promary WebLogic Server Goes Down ...His Session data will not be lost...and client can interact with the Application without any Interruption. To Enable Failover in your Clustered Application you need to provide the <persistent-store-type>Tag inside your "<Application>/WEB-INF/weblogic.xml"
   <session-descriptor>
      <persistent-store-type>replicated</persistent-store-type>
   </session-descriptor>
<font color=red><b>NOTE:</b> until u dont put <persistent-store-type> Tag inside your "weblogic.xml" file...by default HttpSession replication will be disabled....because it's default value is "inMemory" means even If your Application has HttpSession ... it wont be replicated on Secondary Server.</font>
<h3><font color=maroon>Reason - 2): LoadBalancing</font></h3>
This feature has NOTHING TO DO with HttpSession replication (in general). It means simply different clients request will be processed by different WebLogic Server Instances in a Round-Robin fashion. I Think this is what you want to implement. Because your application is not using any HttpSession .So thet Application willl not have any Failover. But LoadBalancing is the Default Feature of WebLogic Cluster. U need not to do anything additionally to Achieve it.
<font color=green><b>Note:</b>Means Without Having HttpSession Objects in your Application Still u can have WebLogic Clustering Feature to get the benifit of LoadBalancing.</font>
To know more about Session Replication and it's related issues : http://weblogic-wonders.com/weblogic/2009/12/08/session-replication-issues/
Thanks
Jay SenSharma

Similar Messages

  • Weblogic Clustering Replica Session not Recovering

    Dear All,
    Have One domains with WLS 10.3.4 on two physical machines, each machine hosting one managed server, cluster of the two servers, node manager on both servers and admin server on one of the servers. Using unicast and in-memory replication with replicate if clustered set in the weblogic.xml.
    Apache balancing between the two and selected options to allow proxy plugin in the domain.
    Question is I bring both servers up,
    Log the user into test application.
    In the console I can see from Cluster Monitoring that a single user connects on Managed Server 1 and that the session is correctly replicated onto Managed Server 2.
    I then fail Managed Server 1 which is hosting the primary session, on manual page refresh the users request goes to the Managed Server 2 with the user staying logged in (as expected).
    However when I return the failed Managed Server 1 to service I expected the current session now on Managed Server 2 to be replicated back to the Managed Server 1 (in case Managed Server 2 that is now hosting the primary session fails).
    No matter how long I wait this replication does not take place, HOWEVER if after the Managed Server 1 is returned to service I manually refresh the Web Page which connects to Managed Server 2 this kicks the replication into action and creates a session replica back on Managed Server 1.
    I don't think this is exected behaviour so any idea what is going wrong?
    In the oracle docs it says
    "In a two-server cluster, the client would transparently fail over to the server hosting the secondary session state. However, replication of the client’s session state would not continue unless another WebLogic Server became available and joined the cluster. For example, if the original primary server was restarted or reconnected to the network, it would be used to host the secondary session state. "
    but in this case the second bit does not seem to host the secondary state unless the web page is actually used again (at which point you see the replica state created, it's almost like it will replicate going forwards but ignores the current state and does not re-sync between the managed servers, leading to a user being logging out if a flip-flop server failure test is carried out.
    Thanks
    Edited by: user10645195 on 18-Feb-2011 08:46
    Edited by: user10645195 on 18-Feb-2011 08:52

    HI,
    The HttpSession replication happens Only when WebLogic creates a New HttpSession or Container encounters "session.setAttribute(obj,obj)" method...It means the Data is replicated to the Secondary JVM HttpSession only when application calls the setAttribute method of HttpSession. And in this case only the modified part of data is replicated NOT the complete HttpSession data.
    So i think u can try adding a Simple temporary attribute in the HttpSession like
    session.setAttribute("dummyData",""+new java.util.Date());
    Now make sure that the above code is placed in each and every page of your application...sothat whenever a client will request the because of setAttribute() the Session modified data (dummyData) will be replicated...and if there are more setAttribute() on that page then all the those also will be replicated...
    Example:
    Map map = new HashMap();
    session.setAttribute("map", map); <font color=maroon><b> -------> Here Session data Will be replicated to Node-2 (bcoz of setAttribute()) </b></font>
    map.put("one", "aaa"); <font color=red>No Replication (Means No Session data Refresh...bcoz setAttribute is not called...)</font>
    then from page1.jsp I go to page2.jsp and I do this:
    Map map = (Map)session.getAttribute("map");
    map.put("two", "bbb"); <font color=red>No Replication (Means No Session data Refresh...bcoz setAttribute is not called...)</font>
    and then from page2.jsp I go to page3.jsp and I do this:
    Map map = (Map)session.getAttribute("map");
    map.put("three", "ccc"); <font color=red>No Replication (Means No Session data Refresh...bcoz setAttribute is not called...)</font>
    Now you will see On The node2 the sessioncontains an EMPTY map ! <font color=maroon><b> (That is Correct) because when you executed </b></font><br>
    Map map = new HashMap();
    session.setAttribute("map", map);
    <font color=maroon><b>
    At that time The Map was not containing any data in it.
    </b></font>
    You need to try this:
    Map map = new HashMap();
    session.setAttribute("map", map);
    map.put("one", "aaa"); <font color=green>----><b> Now session.setAttribute("map", map);</b></font> here session data will be refreshed in Node-2
    then from page1.jsp I go to page2.jsp and I do this:
    Map map = (Map)session.getAttribute("map");
    map.put("two", "bbb"); <font color=green>----><b> Now session.setAttribute("map", map);</b></font> here session data will be refreshed in Node-2
    and then from page2.jsp I go to page3.jsp and I do this:
    Map map = (Map)session.getAttribute("map");
    map.put("three", "ccc"); <font color=green>----><b> Now session.setAttribute("map", map);</b></font> here session data will be refreshed in Node-2
    It means until u don't call session.setAttribute(---, ---)...The Session Data is not replicated (refreshed) to the Second Node(Secondary JVM).
    Thanks
    Jay SenSharma
    http://middlewaremagic.com/ (Middleware magic Is Here)

  • Failed to replicate non-serializable object  Weblogic 10 3 Cluster environ

    Hi,
    We have problem in cluster environment, its showing all the objects in Session needs to be serialized, is there any tool to find what objects in session needs to be serialized or any way to find. There was no issue in WLS 8 when the application again setup in WLS 10, we are facing the session replication problem.
    The setup is there are two managed server instance in cluster, they are set to mulicast(and also tried with unicast).
    stacktrace:
    ####<Jun 30, 2010 7:11:16 PM EDT> <Error> <Cluster> <userbser01> <rs002> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1277939476284> <BEA-000126> <All session objects should be serializable to replicate. Check the objects in your session. Failed to replicate non-serializable object.>
    ####<Jun 30, 2010 7:11:19 PM EDT> <Error> <Cluster> <userbser01> <rs002> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1277939479750> <BEA-000126> <All session objects should be serializable to replicate. Check the objects in your session. Failed to replicate non-serializable object.>
    Thanks,

    Hi
    Irrespective of WLS 8.x or WLS 9.x, 10.x, in general any objects that needs to be synced/replicated across the servers in cluster should be Serializable (or implement serializable). The object should be able to marshall and unmarshall. Simple reason why it did not showed in WLS 8.x is may be in that version they could not show these details like Error. May be they showed as Info or Warn or Just Ignored it. Weblogic Server became more and more stable and more efficient down the lines like from its oldest version 4.x, 5.x, 6.x, 7.x to latest 10.x. So my guess is they added more logic and more functionality to capture all possible errors and scenarios. I did worked on WLS 8.1 SP4 to SP6 long time back. Could not remember if I saw or did not see these errors for cluster domain with non-serializabe objects. I vaguley remember seeing it for Portal Domains but not sure. I do not have 8.x installed, otherwise I would have given a quick shot and confirm it.
    So even though it did not showed up in WLS 8.x, still underneath rule is any object that needs to be replicated that is getting replicated in cluster needs to implement Serializable interface.
    Thanks
    Ravi Jegga

  • All session objects should be serializable to replicate error.

    Hi All,
    Having 'EmployeeBean' and it is having below properties with getters and setters methods
    private long emp_id;
    private String emp_name;
    private java.sql.Timestamp date_of_join;
    private boolean isActive;
    private int dept_no;
    Adding multiple employees(creating multiple EmployeeBean) into an ArrayList and storing this ArrayList into a Session object. This is working fine but when I move this code to production(cluster environment) it is throwing below error
    <Aug 23, 2011 2:15:40 PM EDT> <Error> <Cluster> <BEA-000126> <All session objects should be serializable to replicate. Check the objects in your session. Failed to replicate non-serializable object.
    java.rmi.MarshalException: failed to marshal update(Lweblogic.cluster.replication.ROID;ILjava.io.Serializable;Ljava.lang.Object;); nested exception is:
         java.io.NotSerializableException: my.company.beans.EmployeeBean
         at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:90)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:221)
         at weblogic.cluster.replication.ReplicationManager_1032_WLStub.update(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor163.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         Truncated. see log file for complete stacktrace
    Caused By: java.io.NotSerializableException: my.company.beans.EmployeeBean
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
         at java.util.ArrayList.writeObject(ArrayList.java:570)
         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         Truncated. see log file for complete stacktrace
    Can someone please let me know, why I'm getting this error? The EmployeeBean should implement serializable? Is there any problems/cons to implement serializable?
    Having other bean(LoginBean) and I'm keeping this bean into session and it doesn't implement serializable, not getting any error for this bean(LoginBean). Only difference is LoginBean is not added to ArrayList.
    Why it is throwing error for EmployeeBean and not for LoginBean??
    Thanks in advance.
    Regards,
    Sharath.

    The EmployeeBean should implement serializable? - Yep Is there any problems/cons to implement serializable? - No
    Just add java.io.Serializable to the EmployeeBean, for example,
    public class EmployeeBean implements Serializable {
    }For LoginBean you have probably, configured to be in the session, by using faces-config.xml.
    In the case of EmployeeBean (or the object graph it is part of) have you used HttpSession.setAttribute(...)?
    Note that setAtttibute(...) is the trigger for an application server to replicate the object.
    In this case all objects in the object graph have to be serializable.
    Typically, objects should be Serializable when they are part of the session and you are using a clustered environment.

  • How can i get session object based on session id?

    I have tried searching in forum but i can't find any solution that i can get session object based on session id and i also would like to know how to check whether the session is still active? My company currently using weblogic 5.1. I really hope that some one or anyone can help. I am new in using Servlet. I hope that i can find some answer here. Thank you.

    I have a need to get a Session object from a session id, so I don't think that the above should be deprecated. Here is my use case:
    0. I am displaying files in a file list
    1. I am downloading files.
    2. I am downloading files through a Servlet
    3. I am displaying the files as images in an applet
    4. The applet is ImageJ, and it apparently uses a full URL to download the file.
    5. I use request.getRequestURL() in the applet .jsp to get the full URL (the hostname and port)
    6. My app server is OC4J and it's behind an apache server and is host aliased.
    7. Thus the hostname is different between my applet .jsp and the Servlet URLs
    8. Thus I have 2 different sessions
    9. Thus I need to pass the session id (or some other unique identifier).
    10. I could stored the unique identifier in the application object, but then I would need to clean it up
    11. I cannot pass the the full path to the image due to security problems (what if someone downloads my password file?)
    12. I would like this to work in a clustered environment
    13. I think that WebDAV would solve my problems, since I could pass a full URL of webDAV to ImageJ for download. However, I am unsure how the security of WebDAV would work with ImageJ/URLConnection. I will have to research this feature in ImageJ.

  • Is Bulky Session Object Better or a Bulky Stateful Sess bean better

    Hi,
              We are clustering on Weblogic 6.0. Currently we are debating on whether
              to cache out ACL information which is very bulky in the session object
              or to store it into a statefull session bean and store the handle to
              that bean in the HttpSession object
              I "feel" it might be preferable to bulk the Session bean than to bulk
              the HttpSession object. Weblogic documentation discourages making the
              HttpSession object heavy citing replication issues. But wouldnt the same
              issues arise when we store a lot of information on the Session Bean.
              Also do all attributes of the Session bean need to be Serializable to
              support clustering.
              Any help will be appreciated.
              Thanks
              Sameer
              

    Sticky -- it will continue to go back until the session or the server dies.
              Peace,
              Cameron Purdy
              Tangosol Inc.
              << Tangosol Server: How Weblogic applications are customized >>
              << Download now from http://www.tangosol.com/registration.jsp >>
              "Sameer Wadkar" <[email protected]> wrote in message
              news:[email protected]...
              > If user x makes a call to servlet Y on Machine A where Machine A and B are
              in
              > cluster. If the user makes a second call to Y will the proxy webserver if
              thats
              > what is being used redirect the user call to machine A
              > and not B for sake if laodbalancing?
              >
              > Sameer
              > Cameron Purdy wrote:
              >
              > > Replication uses serialization. Serialization does not take transient
              > > fields. Therefore, even when used in a stateful session bean,
              replication
              > > would not take transient fields.
              > >
              > > Peace,
              > >
              > > --
              > > Cameron Purdy
              > > Tangosol, Inc.
              > > http://www.tangosol.com
              > > Tangosol: How Weblogic applications are customized
              > >
              > > "Sameer Wadkar" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > Cameron,
              > > >
              > > > One last question? If I have a stateful session bean and I have an
              handle
              > > to
              > > > it. In a clustered environment would a transient field inside a
              Stateful
              > > > Session bean NOT BE replicated. I understand the situation for
              HTTPSession
              > > > objects. I just want to confirm if the situation is treated in
              identical
              > > > fashion while replicating Stateful Session Beans.
              > > > If I am working in a clustered environment and a client has
              established an
              > > > HTTPSession with respect to my server. When the client makes repeated
              > > calls to
              > > > the server in the context of that session is the client request
              forwarded
              > > to
              > > > the same server each time if there is no failover or to diff servers
              in
              > > the
              > > > cluster to meet loadbalancing req.
              > > > Also what is preferable (I am now not talking of clusteringnow : just
              > > > performance issues in a single server) storing a large object in
              > > HTTPSession
              > > > object or
              > > > putting that large object in a Stateful Session Bean and storing its
              > > handle in
              > > > the Session object(We need that object practically everytime a
              Controller
              > > > Servlet fires). Weblogic guys suggested to us that the session object
              > > should be
              > > > kept as small as possible to which I agree hence I thought of this
              > > solution.
              > > >
              > > > I would appreciate your response. We are using Weblogic 6.0
              > > >
              > > > Regards,
              > > > Sameer
              > > >
              > > > Cameron Purdy wrote:
              > > >
              > > > > Sameer,
              > > > >
              > > > > You are joking, right? Replicating a sh?tload of stuff across a
              cluster
              > > is
              > > > > expensive. Cached items that can be reloaded on another server in
              the
              > > rare
              > > > > case of failover should not be replicated, since they can be
              reloaded on
              > > > > another server in the rare case of failover. If you want your
              > > application to
              > > > > perform well, don't replicate things that you don't have to!
              > > > >
              > > > > Here's the math:
              > > > >
              > > > > - 1 in pf chance of a request having to failover, where pf should be
              at
              > > > > least 10,000,000
              > > > > - cb is the number of bytes being replicated, and f1(cb) is the cost
              of
              > > > > replicating
              > > > > - f2(cb) is the cost of loading the cache from the database (for
              > > example)
              > > > >
              > > > > If f2(cb)/pf is greater than f1(cb) then you should not replicate
              the
              > > cache.
              > > > > Generally that means that if you replicate the cache, you are
              expecting
              > > each
              > > > > server to die after serving between one and two requests. If that is
              the
              > > > > case, you are really hosed to begin with.
              > > > >
              > > > > If you have an object stored in the HTTP session, and that object
              has a
              > > > > transient field, the contents of the transient field are not
              replicated.
              > > > > That means that you can store your cache in a transient field on an
              > > object
              > > > > that you store in the HTTP session, and you will not pay a
              significant
              > > > > replication price on it. The accessor for the cache should follow
              the
              > > lazy
              > > > > pattern such that on failover it will reload the cache.
              > > > >
              > > > > For even more performance, you should implement Externalizable,
              since
              > > you
              > > > > can improve the performance of ser/deser by a factor of 3 to 10 or
              so.
              > > > >
              > > > > Peace,
              > > > >
              > > > > --
              > > > > Cameron Purdy
              > > > > Tangosol, Inc.
              > > > > http://www.tangosol.com
              > > > > Tangosol: How Weblogic applications are customized
              > > > >
              > > > > "Sameer Wadkar" <[email protected]> wrote in message
              > > > > news:[email protected]...
              > > > > > How would it matter. Both the Session Bean and The Session object
              are
              > > > > > destriyed whrn the user logs off.
              > > > > >
              > > > > > Cameron Purdy wrote:
              > > > > >
              > > > > > > If it is just a cache, then you need to prevent it from being
              > > > > replicated.
              > > > > > > Use a "transient" field or implement Externalizable on that
              object
              > > to
              > > > > > > control serialization and avoid serializing cached objects.
              > > > > > >
              > > > > > > Peace,
              > > > > > >
              > > > > > > --
              > > > > > > Cameron Purdy
              > > > > > > Tangosol, Inc.
              > > > > > > http://www.tangosol.com
              > > > > > > Tangosol: How Weblogic applications are customized
              > > > > > >
              > > > > > > "Sameer Wadkar" <[email protected]> wrote in message
              > > > > > > news:[email protected]...
              > > > > > > > Hi,
              > > > > > > >
              > > > > > > > We are clustering on Weblogic 6.0. Currently we are debating
              on
              > > > > whether
              > > > > > > > to cache out ACL information which is very bulky in the
              session
              > > object
              > > > > > > > or to store it into a statefull session bean and store the
              handle
              > > to
              > > > > > > > that bean in the HttpSession object
              > > > > > > > I "feel" it might be preferable to bulk the Session bean than
              to
              > > bulk
              > > > > > > > the HttpSession object. Weblogic documentation discourages
              making
              > > the
              > > > > > > > HttpSession object heavy citing replication issues. But
              wouldnt
              > > the
              > > > > same
              > > > > > > > issues arise when we store a lot of information on the Session
              > > Bean.
              > > > > > > > Also do all attributes of the Session bean need to be
              Serializable
              > > to
              > > > > > > > support clustering.
              > > > > > > >
              > > > > > > > Any help will be appreciated.
              > > > > > > >
              > > > > > > > Thanks
              > > > > > > > Sameer
              > > > > > > >
              > > > > >
              > > >
              >
              

  • Transaction & non-EJB objects (helper)

    hi i have a question about transactional behavior of non-EJB objects. i'm
              using
              weblogic 6.0 sp1 with ejb 2.0.
              say i have a session bean which starts a container managed transaction. and
              it calls
              out to helper class A(non-EJB), and that helper class A get a connection and
              update
              some tables. after A returns, session bean calls helper class B(non-EJB) in
              the
              same transaction. B is supposed to update some other tables but it throw an
              user
              exception. would the transaction in the session bean be rolled back? would
              it
              also roll back the changes made by helper class A?
              thanks for any help,
              z
              

    Thanks Rob!
              "Rob Woollen" <[email protected]> wrote in message
              news:[email protected]...
              > Ziqiang Xu wrote:
              >
              > > hi i have a question about transactional behavior of non-EJB objects.
              i'm
              > > using
              > > weblogic 6.0 sp1 with ejb 2.0.
              > >
              > > say i have a session bean which starts a container managed transaction.
              and
              > > it calls
              > > out to helper class A(non-EJB), and that helper class A get a connection
              and
              > > update
              > > some tables.
              >
              > You must get the JDBC connection from a TxDataSource.
              >
              > > after A returns, session bean calls helper class B(non-EJB) in
              > > the
              > > same transaction. B is supposed to update some other tables but it
              throw an
              > > user
              > > exception. would the transaction in the session bean be rolled back?
              >
              > Merely throwing an exception from a helper class will not rollback the
              > transaction.
              >
              > Within an EJB, the best way to rollback a tx is to use the
              > EJBContext.setRollbackOnly method.
              >
              > So you could do something like this:
              >
              > session_bean_method() {
              >
              > try {
              > B.foo();
              > } catch (MyException e) {
              > ctx.setRollbackOnly();
              > throw e;
              > }
              >
              > }
              >
              > > would
              > > it
              > > also roll back the changes made by helper class A?
              > >
              >
              > If they are all within a single transaction, then yes. As I mentioned
              before,
              > make sure that you use a TxDataSource for all of your JDBC Connections.
              >
              > -- Rob
              >
              > >
              > > thanks for any help,
              > >
              > > z
              >
              

  • Http session object in portal

    Hi,
    I am working on weblogic portal 9.2
    I am seeing some weird behavior while handling http session object.
    I have a desktop contains 2 page flow portlet and 1 Jsp/Html portlet.
    On Portal Admin I have created 2 differennt desktop as below.
    1.http://localhost:7001/Test/appmanager/desk/desk1
    2.http://localhost:7001/Test/appmanager/desk/desk2
    Desktop 1 will put some value in session but when I am running the other desktop i.e. desk2 then desk2 is receiving the same session value that desktop 1 put.. Not sure why?
    Generally for every desktop URL new Http Session should be created. But in my Case old session is sharing between 2 desktop.
    Java code
    HttpSession session = request.getSession(false);
    session.getAttribute("");
    JSP
    <%@ page session="false"%>
    In non Portal application, we can have control to all the href but in case of Portal we are getting data from content management that provides href.
    Edited by: user11311969 on Oct 9, 2009 4:58 AM
    Edited by: user11311969 on Oct 9, 2009 5:23 AM

    Hi,
    Thanks for the replay.
    You are right If I add desktop name in session then atleast I can insure that correct desktop is fetching the session value.
    Ok But while rending both the desktop there is common code that put some values in session.
    Let say Desktop1 put "name = Desktop1" and "Value = "MyDesktop" in session.
    After that I run Desktop2, that will put "name = Desktop2" and "Value = "OtherDesktop " in session.
    i.e when I run Desktop1, then I should get "name = Desktop1" and "Value = "MyDesktop "
    when I run Desktop2, then I should get "name = Desktop2" and "Value = "OtherDesktop "
    If I click any link on Desktop1 then i will get "name = Desktop2" and "Value = "OtherDesktop " because Desktop2 has already overwrite the session value.
    How can I solve this?

  • How to get Multiple Values for a key from a session object?

    Hi,
    It might seem dumb but I am facing a problem here with the session object. I'll paste the session object's content from the netbeans "Local Variables" window for clarity -
    Name Type Value
    hsession StandardSessionFacade #66
    session LWSFSession #69
    inherited
    attributes Hashtable #80
    [0] Hashtable$Entry "cart"=>#115
    key String "cart"
    value DummyCart #115
    item null
    submit null
    v Vector
    [0] String Full Metal Jacket
    [1] String As Good As It Gets
    [2] String Tim
    What I want is to get the values "Full Metal Jacket", "As Good As It Gets" and "Tim" from the session obejct?
    The problem I am facing is that if I do a session.getAttribute("cart"), I'll get a single value in return. What will that value be? Will it be "item", "submit" or "v"? And if I want all the values in v above, how can I get them?
    Thanks.

    None of the above.
    HttpSession.getAttribute() will return what you put into it using HttpSession.setAttribute(). In your case, it'll return an Object which you need to cast to DummyCart. Then you can access the data in DummyCart using the API of the DummyCart class.
    hth

  • Calrification for Weblogic Clustering

    Our J2EE application is multitiered where JSPs&Servlets(Frontend) runs in a weblogic instance and EJBs(Backend) runs in two weblogic instances which are clustered. Here the Frontend weblogic instance and one of the clustered Backend weblogic instance are running in a same machine A and the other clustered Backend weblogic instance is running in another machine B. We had tested the following cases for Failover
    Note :
    please consider "JSPs&Servlets" as Frontend and "EJBs" as Backend.
    Weblogic 9.2 and stateless session beans are used.
    Frontend is not clustered.
    Case 1:
    We are doing a transaction where the request from frontend goes to one of the of the Clustered Backend weblogic instance. Before the transaction gets completed this backend weblogic instance is made to shutdown. The transaction has failed over to the another available Clustered Backend weblogic instance . The transaction had completed successfully and the Failover is working fine.
    Case 2:
    We are doing a transaction where the request from frontend(running in Machine A) goes to the Clustered Backend weblogic instance running in the Machine A itself. Before the transaction gets completed, the machine A is made to shutdown (i.e. both frontend and backend weblogic instance shuts down at the same time). Here the transaction has failed and could not able failover to the other available Backend weblogic instance .
    Please clarify whether weblogic cluster supports the Backend failover when both the Frontend and Backend are brought down at the same time?
    Any weblogic CLustering experts, please clarify...

    Hi Jayesh,
    Thanks very much for your reply.
    I understood that your reply "You might want to consider collapsing front end (servlet & JSP) and back end (EJB) servers into a single WebLogic server for better fail over support." means that JSP&Servlet and EJB should be combined to form a single archive(EAR) which has to be deployed in single weblogic instance.
    Please check whether my assumptions are correct for your suggestion on better failover.
    1.The cluster configuration of JSPs&Servlet(web.xml) and EJBs(ejb-jar.xml) running in single weblogic instance will be similar to the cluster configuration of JSPs&Servlet(web.xml) and EJBs(ejb-jar.xml) running in separate weblogic instances. i.e All the configurations are same, but instead of the application running in separate weblogic instances, it will run in single weblogic instance.
    2.In the URL for specifying the EJB connection from the JSP&Servlet, the cluster IP address should be used.
    You have mentioned that if EJB client is not alive, the failover will not work. Please clarify how the failover will work in this case only(JSP&Servlet and EJB running in single weblogic instance and clustered).
    Thanks,
    Thiyagu

  • URGENT! Share session object in JSP and JServlet

    Dear all,
    I am new to OAS. I am now trying OAS by build a simple Shopping Cart application.
    Currently, I use JSP to build user interface and Servlet to build bussiness logic. So I use JSP cartage and JServlet cartage to build the application.
    However, I find that the "session object" I create in the JSP cannot be access from Servlet cartage.
    Is anyone can help me to solve this problem. ( Is this implementation framework works in OAS ? )

    >
    I am short describing the problem again,
    IN JSP, MY CODE IS LIKE THIS:
    HttpSession oSession=request.getSession(true);
    oSession.setAttribute("batchHash",reqRows);
    IN SERVLET, MY CODE IS LIKE THIS:
    HttpSession oSession=req.getSession(true);
    tblSession = (Hashtable)
    oSession.getAttribute("batchHash");
    System.out.println("IsNew ="+oSession.isNew());
    System.out.println("Object="+prmSSO);
    If I deploy this in TOMCAT, my output is like this:
    IsNew =false
    Object=Hashtable@982fc1
    If I deploy this in WEBLOGIC 6.1, my output is like
    this:
    IsNew =true
    Object=null
    Why is this?
    Why the "oSession.isNew()" returns "false" in tomcat
    and "true" in weblogic ?
    Please help....Your only problem is using
    HttpSession oSession=req.getSession(true);instead of
    HttpSession oSession=req.getSession(false);in your servlet! getSession(true) - forces to allocate new session,
    so it's absolutely clear why your Hashtable is absent in
    a newly created session!!
    Paul

  • Non-Serializable objects in webservice

    Hi everyone,
    I'm writing a webservice that connects and performs update on a third-party
    data repository (document management system) through the vendor provided
    framework.
    Some of the objects used in the framework are not serialized, and WebLogic
    Workshop 7.0 won't compile my services because they contain non-serializable
    objects. Those objects are not used as messages or method parameters, rather
    are the member variables of the services.
    My question is how would I go about using non-serialized objects in a
    webservice class with WebLogic Workshop 7.0? I've seen some Apache AXIS
    webservice examples that does the similar thing, but some of the services
    works with non-serializable objects. Do I need to create an EJBcontrol that
    masks non-serializable objects to be used with the webservice?
    Any input is greatly appreciated. I'm still new at webservice programming.
    Thank you,
    Makoto

    Hi everyone,
    I'm writing a webservice that connects and performs update on a third-party
    data repository (document management system) through the vendor provided
    framework.
    Some of the objects used in the framework are not serialized, and WebLogic
    Workshop 7.0 won't compile my services because they contain non-serializable
    objects. Those objects are not used as messages or method parameters, rather
    are the member variables of the services.
    My question is how would I go about using non-serialized objects in a
    webservice class with WebLogic Workshop 7.0? I've seen some Apache AXIS
    webservice examples that does the similar thing, but some of the services
    works with non-serializable objects. Do I need to create an EJBcontrol that
    masks non-serializable objects to be used with the webservice?
    Any input is greatly appreciated. I'm still new at webservice programming.
    Thank you,
    Makoto

  • Need help on how to access session object in javaBean

    Hi All,
              I am new to JSP. I have writen a java helper class which gets some data
              from a Session Bean.
              I want to use <jsp:useBean scope="session"> directive in the JSP.
              The helper class requires the reference to session Object to initialize
              itself.
              It looks like I can only pass Strings Or Basic data Type using
              <jsp:setProperty> directive. I want the helper class to initialize only
              once per session.
              I am using weblogic 4.5 and jdk 1.1.7B.
              Need help soon.
              Thanks in Advance
              Regards
              Arun
              

    Arun,
              You need only create a method on the bean and call it passing the request
              object which contains the
              session object. You need not scope to session if you don't need to as well
              ie
              <jsp:useBean id=foo class= myclass.foo scope="session">
              <%
              foo.init(reqeust);
              %>
              Harry
              Arun Kumar <[email protected]> wrote in message
              news:8itp3l$b67$[email protected]..
              > Hi All,
              > I am new to JSP. I have writen a java helper class which gets some data
              > from a Session Bean.
              >
              > I want to use <jsp:useBean scope="session"> directive in the JSP.
              > The helper class requires the reference to session Object to initialize
              > itself.
              >
              > It looks like I can only pass Strings Or Basic data Type using
              > <jsp:setProperty> directive. I want the helper class to initialize
              only
              > once per session.
              >
              > I am using weblogic 4.5 and jdk 1.1.7B.
              >
              > Need help soon.
              >
              > Thanks in Advance
              > Regards
              > Arun
              >
              >
              >
              

  • Question about app design - database + session object in JSP

    hi all
    i am studying this application built mostly with servlets and JSPs, and there are several questions i want to ask your guys' opinions about it.
    first of all, i noticed that the application hits database to get/save data very frequently. from one page to another it would save data collected from user to the DB, and retrieve data from DB to display on the next page. it does this a lot. would this decrease the overall performance of the application, i mean a DB hit requires network traffic overhead, wouldn't it be better if all data collected from user are stored in a session object temporarily, and all the data that are displayed on those pages retrieved at the start time? and do one save process in the end. it uses Oracle DB if it makes any difference. should we try to avoid db hit as much as possible?
    my next question is that is it good approach to keep information in session object? even if there is a lot of data to keep?
    another question is the db connection. in a pooled environment - weblogic server, we would use JNDI in the code to get connection from the pool, we use it and close it. when we close a connection with close() method, what really happens? does this connection gets return to the pool or it is being destroyed completely.
    i know this is a lot to ask, i appreciate your help very much. looking forward to seeing some feedback.

    No, I don't have tables of values. I have a java 1.5 enumeration, like for instance:
    public enum VelocityConvention {
       RELATIVISTIC,
       REDSHIFT;
    }and a class Velocity that contains a convention and a value like so:
    public class Velocity {
       public VelocityConvention getConvention() {...}
       public double getValue() {...}
       public void set(VelocityConvention conv, double value) {...}
    }When I persist the Velocity class to the database, I want a field called convention that holds the appropriate value of the enumeration. That much is done how I explained before.
    I want to have a selectOneMenu for setting the convention. Via trial and error, I found that MyFaces wasn't able to automatically convert from a string back to a proper VelocityConvention enum constant. It can, of course, convert from the enum to a string because it just calls toString(). But I need both directions for any UIInput element I use, be it a selectOne, or just a straight inputText.

  • Memory limitation for session object!

    what is the memory limitation for using session objects?
    venu

    as already mentioned there is no actual memory limitation within the specification, it only depends on the jvm's settings
    how different app-server handle memory management of session objects is another part of the puzzle, but in general you should not have problems in writting any object to the session.
    we had the requirement once to keep big objects in session, we decided to do a ResourceFactory that returns us the objects, and only store unique-Ids into the session.
    We could lateron build on this and perform special serialization tasks of big objects in the distributed environment.
    Dietmar

Maybe you are looking for