Session sharing acrossed ears

Is it possible to share a session across multiple EAR's? I have successfully shared sessions across multiple WAR's in a single EAR by using the session scoping and session path information.

According to the spec, Sessions aren't suppose cross WARs. However, with IBM's Websphere, you are able to "enable" "Shared Session Context" across multiple WARS in a single EAR and provided the virtual domains for each WAR are the same.
This is nice because it gives a developer the flexibility to logically breakup a large site into multiple war applications under the same EAR without having to worry about session management. For example, you can have a BrochureWAR, LoginWAR and a MemberForumWAR, MemberPaymentWAR, etc... all in the same EAR. The LoginWAR would put a UserObject into Session and the other MemberWARs could use it. Otherwise you would have to use the dreaded EJB solution or roll-your-own webservice state machine.
As a quick note, be sure that any Object you put into the Shared Session Context is loaded using the Server's classpath and not the WAR's classpath. If you don't and you load a FooObject from WAR1 lib into session, a read from Session by WAR2 will throw a ClassNotFound error because of differing classloaders. Know what I mean?
Now with all that said, I want Shared Sessions across EARs (obviously for WARs of the same domain of course). In this way, I would be able to completely remove/upgrade certain area's of a Very Large webappliction without effecting other areas for example: someWebSitesMemberPaymentEAR without effecting someWebSitesMemberForumEAR. Of course I could achieve this with all webapplications calling some Stateful WebService or EJB thing backend too but GOSH... thats alot of work for Session Management across EARs. Where's the easy button?

Similar Messages

  • Session sharing across web applications in an EAR File

    Hi,
    I have an ear file which further has 5 war files. I want to share the same session
    object across all these war files in the ear file. Can u pls tell me if this is
    possible in weblogic. If yes how?
    Thanks,
    Akash

    I'm sorry, by the J2EE 1.3 specification this isn't allowed. I have sent it on
    to the servlet team to add as an option but that won't be in time for you. If
    you need to share state between them I would probably try and put it in another
    place like an EJB or a singleton class in the system classpath.
    Sam
    [email protected] wrote:
    Hi,
    I have an ear file which further has 5 war files. I want to share the same session
    object across all these war files in the ear file. Can u pls tell me if this is
    possible in weblogic. If yes how?
    Thanks,
    Akash

  • Session sharing among multiple WAR files inside an EAR file

    Hi all,
    Is there a way where I can share my session object among multiple WAR files which are inside an EAR file?
    Please suggest.

    r035198x wrote:
    Some application servers (like Weblogic) allow to configure session sharing when you deploy the application.Sidenote: which is completely against the servlet spec.

  • How to Persis session between two ear files

    Can anybody tell me how to persists session between two ear files?
    Please Help its urgent!!
    Rahul

    Rahul -- there's nothing as a J2EE spec requirement or even a proprietary feature of OC4J/OracleAS which will enable this.
    If you have two different EAR files, then they are two different applications, and each will have their own session which can't be shared amongst each other.
    If you have data which needs to be shared across different applications then you could either put it on a shared file system or write it to a database which you can then read from in the other application.
    One way to do this is to implement the HttpSessionAttributeListener interface which will be called when object are added/removed/updated from a session, and then make a determination on whether the new object needs to be stored in a common place to facilitate sharing between applications.
    This is more likely to be a hackaround and ideally you'd examine why you want to share session state across applications and rearchitect so you don't need to do it -- but if you want to try a solution without a major revisiting of the whole application, then perhaps it's an option.
    cheers
    -steve-
    cheers
    -steve-

  • Session Sharing between Webapps

              Hi everybody,
              I have read that session sharing between webapps is possible since Wls 6.1 using
              the same name
              for a cookie in the webapps.
              I have created a webapp named myPortal (for example) and a second named Navigation.
              The first webapp
              includes content of the second webapp
              After deploying the webapps in WLS and printing out the sessionid in each of the
              webapps, I found out
              that unfortionally the sessionid in the two webapps are not identical.
              My Question is: Is session sharing possible, or should I create a workaround?
              Here is my environment:
              WLS 6.1 on SUN running in developmentmode
              two webapps, deployed as .war file and/or as .ear file
              Cookie Name is configured to be identical in the two .war Files
              Regards,
              Ed
              

    Search this newsgroup for a reply post on this by me. I incorrectly went down the
              primrose path on this one, too. I was corrected by Cameron Purdy. I did a bunch of
              impirical research on this and came to the same conclusion you have come to. The spec
              doesn't require it and, in fact, says that separate webapps have separate contexts, so
              they don't share sessions, even if the cookie is the same name.
              Bill
              Eduard van den Bongard wrote:
              > Hi everybody,
              >
              > I have read that session sharing between webapps is possible since Wls 6.1 using
              > the same name
              > for a cookie in the webapps.
              > I have created a webapp named myPortal (for example) and a second named Navigation.
              > The first webapp
              > includes content of the second webapp
              > After deploying the webapps in WLS and printing out the sessionid in each of the
              > webapps, I found out
              > that unfortionally the sessionid in the two webapps are not identical.
              > My Question is: Is session sharing possible, or should I create a workaround?
              >
              > Here is my environment:
              >
              > WLS 6.1 on SUN running in developmentmode
              > two webapps, deployed as .war file and/or as .ear file
              > Cookie Name is configured to be identical in the two .war Files
              >
              > Regards,
              >
              > Ed
              

  • Session persistence across web apps

    Hi,
    I am working on a project where we have two web applications deployed in single enterprise application. I want the session object to be shared across the web applications.
    Does weblogic had any mechanism to allow for the session object to be shared across the multiple Servlet contexts inside a single enterprise application?
    I am using Weblogic 8.1
    Thanks,
    Anil

    Session data is not shared between web applications. User data is definantly important to share between applications. The single-sign-on security option is an example of this. But that's kindof a black box. If you use single-sign-on, then simply getting the remote user from the request in your servlet can be used as a key to get user data from your persistance layer (ejb's or jdbc or even jms).
    If you don't want to use single-sign-on, you can use a filter. There's some url prestidigitation, also, but otherwise this approach is pretty simple:
    1. Protect access to all of your web-app's urls with some naming convention /webappname/secure*. However, don't use these urls in any web page. All servlets and jsps you use should map names beginning with "secure".
    2. Filter all access to your webapp (this is a new feature in servlet spec 2.3). Within the filter, use the session id as a key to find out if the user is already login to any other web application. You will need a stateless session bean to do this. The doFilter would be something like this:
    SecurityBean securitybean = Utilities.getSecurityBean();
    HttpSession session = request.getSession(true);
    if (session.getAttribute("myuserdata") == null){
    UserData userdata = securitybean.getUserdata(sessionid);
    if(userdata != null)
    session.setAttribute("myuserdata",userdata);
    ... now forward the request to the "secure*" url in the filter. If the user was logged in with the slsb securitybean, then your web app will have all of your user data. If the user is not logged in by the securitybean, then the login prompt established in your web.xml will pop-up.
    The only extra work is to have a slsb securitybean. This can use the RoleManager in oc4j or it can use the jaas implementation in oc4j to log the user in, using the sessionid to get the username.
    The shared="true" attribute should be used for all application in the *-web-site.xml, so that the sessionid's are the same.
    regards,
    the elephantwalker
    www.elephantwalker.com

  • Does Session Sharing feature provided by SAP Net Weaver application server

    Hi All,
    Session Sharing is an additional feature provided by Tomcat , Weblogic  and Web sphere application servers.
    Is this feature available in  SAP Net Weaver application server?
    Brief description on Session Sharing
    Session Sharing  specifies whether HTTP sessions are shared across multiple Web applications.
    In Weblogic this is an optional feature customizable in weblolgic-application.xml
    Sample weblogic-application.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <session-descriptor>
          <persistent-store-type>replicated_if_clustered</persistent-store-type>
          <sharing-enabled>true</sharing-enabled>
    </session-descriptor>
    </weblogic-application>
    session-descriptor (Optional Element ) - Specifies a list of configuration parameters for servlet sessions.
    sharing-enabled (Optional Element ) - Specifies whether HTTP sessions are shared across multiple Web applications. Default value is false.
    Thanks in advance.
    Regard's
    Srikanth
    Edited by: Srikanth A on May 14, 2010 7:36 PM

    Hi,
    You cannot set up Garbage collection frequency. it is internally handled by Java when the Heap size is filled up.
    You can always fine tune your server to SAP recommendations.
    Note 723909 is a good starting point.
    Also other checks include that you use SAP recommended Java versions, OS patches and also that you have enough physical memory.
    Thanks & Regards,
    Vijith

  • Will the Application Scope be shared across the cluster in a multi-node OC4

    Hi,
    I have the following requirement:
    Users of the application can only have single (browser) session. When a user who already has a session connects again, he should no longer be allowed to access the older session.
    My proposed implementation is:
    -     After successful login – possibly using a Session Listener - an entry is made in a HashMap UserSessions that lives in the application scope. Key is the username, value is the session id (HttpSession.getId()).
    -     For every request, using a ServletFilter, we check whether the session is still in the UserSessions HashMap for the current user. If a new session has been created for the same user, the session id for that new session is in the UserSessions map and the servletfilter will not find the session. In that case, the filter should invalidate the session and forward to the user to an error page.
    However, the application will run on a multi-node OC4J cluster. I am starting to wonder:
    Will the Application Scope be shared across the cluster in a multi-node OC4J environment?
    I know session state can be shared. But what application state/scope?
    Does anyone know? Do I have to do anything special in the cluster or the application to get this to work?
    Thanks for your help.
    Lucas

    gday Lucas --
    Application scope is not replicated across JVM boundaries with OC4J.
    I'm sure this used to be described in the doc, but I can't find it now from a quick scan.
    If you wanted to use this type of pattern, you could look to use a Coherence cache as distribution mechanism to share objects across multiple JVMs/nodes.
    -steve-

  • NoPermissionException when deploying a RAR inside a Shared library EAR.

    Hello,
    I have a deployment issue concerning a resource adapter in shared library.
    I have an EAR containing a RAR. and an EJB jar with a stateless session EJB in charge of invoking the Resource Adapater (by lookup).
    If I deploy this EAR as an application, it works.
    But If I deploy this EAR as shared library and I link it to another EAR deployed as an application, I have the following deployment issue:
    javax.naming.NoPermissionException: A Resource Adapter may only be accessed from within the same application from which it was deployed.
            at weblogic.connector.outbound.RAOutboundManager.getConnectionFactory(RAOutboundManager.java:765)
            at weblogic.connector.deploy.JNDIHandler.getConnectionFactory(JNDIHandler.java:1015)
            at weblogic.connector.deploy.JNDIHandler.lookupObject(JNDIHandler.java:869)
            at weblogic.connector.deploy.JNDIHandler.getObjectInstance(JNDIHandler.java:843)
            at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
            at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:255)
            at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at com.mycompany.myEJB.initContext(myEJB.java:100)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.invokeLifecycleMethod(Jsr250Metadata.java:332)
            at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.invokeLifecycleMethod(Jsr250Metadata.java:326)What I don't understand is: even if my application name change (in one case, the name of the EAR containing the RAR, in the other case, the classical EAR name) my packaginig is still the same: the myEJB lookup a Resource adapter which is inside the same EAR and the same application.
    What is wrong ? Do you think it is a potential weblogic bug related to sharedlib deployment ?
    Thank you for helping,
    Best Regards,

    Hi,
    I've defined my Shared lib EAR using its MANFIEST.MF file just like that :
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.8.1
    Created-By: 1.6.0_22-b04 (Sun Microsystems Inc.)
    Implementation-Version: 1.1.3
    Implementation-Vendor: XXXXXXX Software
    Specification-Version: 1.1
    Specification-Title: xxxx
    Copyright: Copyright (c) 2012 XXXXXXX
    Weblogic-Application-Version: 1.1.3And I reference it from my plain EAR using deployment plan (for dynamic configuration of my solution)
      <variable-definition>
        <variable>
          <name>xxxxSharedLibStatus</name>
          <value>false</value>
        </variable>
      </variable-definition>
      <module-override>
        <module-name>classicalEAR.ear</module-name>
        <module-type>ear</module-type>
        <module-descriptor external="false">
          <root-element>weblogic-application</root-element>
          <uri>META-INF/weblogic-application.xml</uri>
          <variable-assignment>
            <name>xxxxSharedLibStatus</name>
            <xpath>/weblogic-application/library-ref/[library-name="xxxx.ear"]/exact-match</xpath>
          </variable-assignment>
        </module-descriptor>
      <config-root xsi:nil="true"></config-root>
    </deployment-plan>I use this mechanism for more than 20 EAR shared lib linked to my classical EAR. it works well, everything seems to be well deployed but the lookup from EAJ to Adaptor raised this permission Exception...
    Thank you if you can help.
    Best Regards,

  • TS2972 I cannot seem to get all of my music shared across the network from my MacBook Pro to my iPad. This was not an issue a few days ago. Can anyone help?

    I cannot seem to get all of my music shared across the network from my MacBook Pro to my iPad. This was not an issue a few days ago. I can see all my songs if sorted that way, but if i sort by artist, only a few of them are present. Can anyone help or have any insight?

    Well I didn't think of it before, but I logged out of my apple ID othe iPad's home sharing. The I logged back in and it worked. It's a little weird, but I will take it. Thanks!

  • Printer sharing across internet sharing

    I hope I don't confuse everyone with this.
    I have three computers—an iMac running Snow Leopard, an iMac running Lion, and a Mini running Leopard. The SL iMac has a printer plugged into it. The other two computers are across the house from it.
    Those two computers are next to each other. The Lion iMac is connected to the Internet via WiFi. The Mini, which does not have wireless, is connected to the Internet via Internet Sharing over an ethernet cable to the Lion iMac.
    Now here's the problem. I can print from the Lion iMac through printer sharing across to the SL iMac. However, I can't figure out how to print from the Mini. It won't find the SL iMac's printer. Enabling printer sharing on the Lion iMac lets the Mini see it as a 'printer,' but it won't print across to the SL iMac.
    So with this setup, is it possible to print to the SL iMac from the wireless-less Mini?
    Just to ward off possible non-workable solutions, rearranging the computers is not feasable right now. It is also not possible to connect the Mini directly to the internet via ethernet. My cable modem is actually in a near-inaccessable part of the house due to that being where the only cable plug is. I have a Time Capsule attached to it, which broadcasts my wireless signal that the WiFi computers can pick up. And no, I can't connect the printer to the Time Capsule—believe me, I tried. I don't want to have to start buying long cables and drilling holes if there's a simpler solution.
    Thanks in advance.

    If I switch to the discussed set up (Airport Extreme N router), will adding an AX in between at 15 feet help bridge the link between the G5's Airport extreme card and the living room's AX?
    Yes. But I still think you should verify if Wi-Fi interference is the cause of your poor signal only 30' away from the AX before going out and purchase anything. Remember, you will tradeoff bandwidth performance for signal strength. With audio, this can be a negative factor.
    If you can get a hold of a laptop, I suggest downloading a copy of iStumbler. Use iStumbler's Inspector feature (select Edit > Inspector from iStumbler's menu) to determine the Signal-to-Noise Ratio (SNR) at different points around your house, by performing a simple RF site survey. Within the Inspector, note the values for "signal" & "noise" at these locations. Start with the laptop near the AX, note the readings, and then, choose the locations between the AX and, finally, where you have the G5.
    SNR is the signal level (in dBm) minus the noise level (in dBm). For example, a signal level of -53dBm measured near an access point and typical noise level of -90dBm yields a SNR of 37dB, a healthy value for wireless LANs.
    The SNR, as measured from the laptop, decreases as the range to the base station increases because of applicable free space loss. Also an increase in RF interference from microwave ovens and cordless phones, which increases the noise level, also decreases SNR.
    SNR Guideline
    o 40dB+ SNR = Excellent signal
    o 25dB to 40dB SNR = Very good signal
    o 15dB to 25dB SNR = Low signal
    o 10dB to 15dB SNR = Very low signal
    o 5dB to 10dB SNR = No signal
    If the SNR is 20dB+ at each of these locations, then you should be getting reasonable performance from your AirPort. If less, either try to locate the source of the Wi-Fi interference or try relocating the base station or the G5 until they are within a 20dB SNR range.

  • Load balancing and session sharing

    Hi,
    in my company we have the following situation:
    We have 2 instances of the same web application on differend servers.
    An external load balancer (Alteon) routes the requests to these instances.
    The problem:
    If one instance is shutting down, all the sessions of this app are gone. These users has to login again.
    The question:
    Is it possible to avoid this?
    Is is possible to keep these session, so the users don't have to login again?
    Maybe with a kind of session sharing between these 2 instances?
    using:
    oc4j standalone - 10.1.3.1
    OS: Windows
    thank you
    Marcus

    The solution:
    Multicast IP replication is the default replication protocol used in a standalone OC4J installation
    see: http://download.oracle.com/docs/cd/B32110_01/web.1013/b28950/cluster.htm#BABBHGHJ
    -> Configuring Multicast Replication

  • How do you configure the DAM so it can be shared across multiple CQ instances?

    How do you configure the DAM so it can be shared across multiple CQ instances?

    You can use shared datastore http://dev.day.com/content/kb/home/Crx/CrxSystemAdministration/HowToCombineTheDatastoreToP reserveDiskSpace.html multiple CQ instance will use same file system to share asset
    clustering http://dev.day.com/docs/en/crx/current/administering/cluster.html multiple node will share repository.
    But you can not have something like one DAM and then have different CQ instance pointing to it (As not everything goes in to one location in file system)
    Yogesh

  • How to prevent session sharing ???

    I am getting a problem when i access my application with different logins from same machine ( same browsers ) ,
    then old login session is updating with new login session,
    how can i prevent this session sharing?
    thanks in advance

    What's probably happening is that you use file cookies (cookies are stored in your file system).
    1. You log in from browser 1 as User A. The server sets a session cookie on your file system.
    2. You continue to work from browser 1. The session cookie gets sent in every request and all is fine.
    3. Now you open another browser and log in as User B. The server sets a session cookie identifying you as User B on your file system.
    4. This overwrites the cookie that was set earlier that identified you as User A The concept is that you can have only one cookie from a server for a specific purpose (session identification in this case)
    5. When you go back to browser 1 now and access the site, the second cookie gets sent (the one that identifies you as User B) and you are logged in as User B now.
    ram.

  • Session sharing again

    Hi all,
    A problem with a slight difference from the one just posted by vakkanti about http-session sharing.
    In our servlet/JSP application the users can of course open a new window within their browser.
    The problem is that both windows are now using the same HTTP-session because the other session has not yet been invalidated and that gives problems in the use of session variables etc.. How can I force that the the new window is using a new session? Or otherwise at least deal elegantly with this problem. It must be a well known problem I think.
    Regards,
    Ronald

    Hello Ronald,
    I do not thinnk that is a 'J2EE issue' in the sense this is the way browser reacts. When you open a new window you are in the same context in term of cookie, session, etc etc. All container will react the same way with a new opened window.
    The only way that I now to have multiple windows and different sessions is:
    - on Internet Explorer and with creatin a new process by running IE (Clicking or run command) not with the File>New window , or any links.
    Could you explain why you need multiple session in different window? What is the businness requirement of your application? (we may be able to find a work around, since the behavior your expect is not supported by browsers)
    Regards
    Tugdual Grall

Maybe you are looking for