Sharing object across 2 different web application

Hello,
     I do not know if this is a right place to ask this kind of question...
     I have two different web applications running on 2 different tomcat servers.
     One of them creates one object ( say myComplexClassObject) which is serializable..
     and I want to share this object in another web applications.
     Both the apps are developed using JSP and servlets.
     Is there any way, I can make this object available in another application ?
     As the request object can not be used across 2 different contexts, I can not set it as attribute on request.
     I tried serializing myComplexClassObject in some test.dat. Problem going by this way is that
     how do I send this file to another application ?
     What I did is as follows....
     In the first app , I created the object and serialized it in one file test.dat. In the same app I read
     test.dat and send the content as query parameter to a JSP in another app. That JSP collects all the query parameters
     and constructs a big string out of it and then writes it to a file, test2.dat and tries to deserialize this.
     File sizes come out to be same. But it gives me StreamCorruptedException.
     Any idea, where I am doing wrong ? or any other way to share this object or to send the file to another app?
     I can not use FTP for some reasons. Size of the test.dat file is more than 10 KB.

Some possible solutions:
Use a webservice calls to pass the object,
Use JAXB to convert the object to XML, pass the XMLover HTTP or a socket and use JAXB to convert the XML back into an object.
Store the object as a blob in a database.
Store the object in a Java aware database that can handle Java objects.
Store the data in the object in a database.
I am curious as to what information ot functionality is contained in this object that you feel the need to pass it between two servers.

Similar Messages

  • Session sharing among different web application under Oracle AS

    Hi,
    I'm looking for some information on web application session information sharing under Oracle AS10.1.3.
    any pointers are highly appreciated.
    Thanks,
    Narasimha.

    Hello,
    I see that you have duplicate your post in different forums, Session sharing among different web application under Oracle AS10.1.3.
    Regards
    Tugdual Grall

  • Authentication Across Multiple Web Applications (Revisited)

              Its been an ongoing battle, but I've made some insight into this situation. The problem stands as it seems impossible to authenticate against one web application deployed as a WAR archive and have that authentication carry across to another web application with the same security constraints. I've been told by BEA that, quote:
              "It seems to me that we are violating section 11.6 of the servlet 2.2 spec which talks about webapps"
              I've also been told that this is fixed in WLS 6.0, reference issue #38732.
              For those of us building production environments using 5.1 instead of 6.0 XML based configuration, this does NOT solve our problem.
              I've dug further into the bowels of 5.1 and found that if you manually set the realm name in the login-config of the security constraint in the web.xml file in each WAR deployment as such:
                   <login-config>
                        <auth-method> [whichever method] </auth-method>
                        <realm-name>WebLogic Server</realm-name>
                   </login-config>
              Authentication will carry across web applications. However, I've noted that the session management then becomes unpredictable. For example:
              I log into the application TESTAPP1 which contains a protected servlet that outputs the session ID and attempts to get the authenticated principal name from the "_wl_authuser_" session variable. Upon first load of the page (after the login dialog box), the session is null [can be fixed with .getSession(true) call instead] and the "_wl_authuser_" object does not exist. Reload the page and the session appears as well as the "_wl_authuser_" object. Strange.
              I then move to TESTAPP2, which does not prompt me for authentication but also is missing the session in the same manner. Upon browser reload, the session is created with a different ID and the "_wl_authuser_" object is now available with the appropriate principal name.
              Upon moving back to TESTAPP1, I am not prompted for authentication however, I am assigned yet another session ID after browser reload, different from the first.
              So it seems that although authentication is carried across web applications, the session IDs as you move from TESTAPP1 to TESTAPP2 change, and then change again but not back to the original when going back to TESTAPP1.
              This is a particular problem since we are using Vignette's V5 as our main client and tracking sessions through V5 - this would quickly become unmanageable if a single page view access three or four different application components with three or four different session ids.
              I'm wondering if we can expect the same behavior from WLS 6.0?
              Ideally, I'd like to see WebLogic use a single session ID to track users across multiple web applications but still have session independence between applications. So if I store something in session in TESTAPP1, its not available in TESTAPP2. Does this outline the behaviour in WLS 6.0? Can anyone verify this?
              Some food for thought. Thanks!
              ./Chris
              Senior Systems Anaylst
              MassMutual Financial Group
              

    Hello! I am searching an answer to this question too!!!
    Did you get some news regarding this item?
    Regards,
    C.M.

  • How to share HttpSession between different web application ?

    I have two web application ( ie two different war files), I discovered that the jsp in the two war files are not able to share the HttpSession, may I know how to you share the HttpSession between two different web application ?

    From the api doc:
    "Session information is scoped only to the current web application (ServletContext), so information stored in one context will not be directly visible in another."
    You can not share a Session object between web apps. You can create your own sessions using a database, textfile or hashmap. Do a search on the O'Rielly web site for psuedo-sessions.

  • Sharing portlets across multiple portal applications

    Hello all,
    I have a single enterprise application that consists of several portal web applications. Most of these portal web applications have common portlets within their codebase. Is it possible to share portlet code across multiple web applications?
    Thanks

    No, not possible, in the same way that sharing JSPs and Pageflows wouldn't be possible across multiple webapps. You can, however, have multiple portals within one Portal webapp, and then you could share portlets and portlet resources amongst those portals.
    George

  • Sharing cookies across different domains

    We have two different apps in two separate locations. Is it possible to set the cookies for one app and be able to retrieve the same from the other app? Is this doable?
              

    I have two different web applications running on same
    WebLogic server say webapp1 and webapp2. Webapp1 has
    servlet which redirects the user to JSP in webapp2.
    While redirecting I have to pass one string value to
    called JSP. I have achieved this by using QueryString
    as follows:
    response.sendRedirect(ConfigService.getProperty("com.t
    wofactauth.caymanlogin.caymanurl", null)) +
    "?userName=" + strCaymanUserName);
    but this expoes the value in browser address bar but
    i don't want to expose the value passed. I am
    searching the way to pass the value internally
    without exposing.
    so please tell me other way in which i can pass the
    value to called JSP without usign QueryString.
    I am using WebLogic 8.1 for deployments. Both
    applications are deployed on same WebLogic instance.I think a big part of the problem is that you want the functionality of a web app to be available to others, but you've locked it up behind a UI.
    I think this is one of the benefits of a service-oriented architecture. You start thinking about the system functionality apart from the UI. Your JSPs become just another client of the services you expose. Anyone can call those services, as long as they can see that service on their network.
    When I've done this I've started with a Spring service interface that is completely separate from the view layer. Once I have that, I can expose it to any other client either with web services (not preferred) or Spring HTTP remoting (preferred due to its simplicity).
    %

  • Sharing data across different webapps using JSP/Servlet

    I have two different web applications running on same WebLogic server say webapp1 and webapp2. Webapp1 has servlet which redirects the user to JSP in webapp2. While redirecting I have to pass one string value to called JSP. I have achieved this by using QueryString as follows:
    response.sendRedirect(ConfigService.getProperty("com.twofactauth.caymanlogin.caymanurl", null)) + "?userName=" + strCaymanUserName);
    but this expoes the value in browser address bar but i don't want to expose the value passed. I am searching the way to pass the value internally without exposing.
    so please tell me other way in which i can pass the value to called JSP without usign QueryString.
    I am using WebLogic 8.1 for deployments. Both applications are deployed on same WebLogic instance.

    I have two different web applications running on same
    WebLogic server say webapp1 and webapp2. Webapp1 has
    servlet which redirects the user to JSP in webapp2.
    While redirecting I have to pass one string value to
    called JSP. I have achieved this by using QueryString
    as follows:
    response.sendRedirect(ConfigService.getProperty("com.t
    wofactauth.caymanlogin.caymanurl", null)) +
    "?userName=" + strCaymanUserName);
    but this expoes the value in browser address bar but
    i don't want to expose the value passed. I am
    searching the way to pass the value internally
    without exposing.
    so please tell me other way in which i can pass the
    value to called JSP without usign QueryString.
    I am using WebLogic 8.1 for deployments. Both
    applications are deployed on same WebLogic instance.I think a big part of the problem is that you want the functionality of a web app to be available to others, but you've locked it up behind a UI.
    I think this is one of the benefits of a service-oriented architecture. You start thinking about the system functionality apart from the UI. Your JSPs become just another client of the services you expose. Anyone can call those services, as long as they can see that service on their network.
    When I've done this I've started with a Spring service interface that is completely separate from the view layer. Once I have that, I can expose it to any other client either with web services (not preferred) or Spring HTTP remoting (preferred due to its simplicity).
    %

  • Shared object and different application servers - how to resolve this issue

    Dear SDN Members,
    We are occuring a big problem. We create a shared object in a program and after we call in an another one. In central system architecture, it is working well. But on a distributed architecture (4 application servers), we have a dump some times. In fact, the read of the shared object can be occured in the AS 4 but the share object has been created in AS1.
    How to manage this problem to avoid this dump ?
    Dupplicate the shared object in the application servers ?
    Encapsulate different calls with RFC link to only one AS ?
    Any parameters on server or share objects ?
    Thanks a lot for your help,
    Points will be given to right or good answers.
    Br,
    Aurélien

    What is the dump you are getting ?
    AFAIK, "Shared Memory"(SHM) is an area defined in the app server. I am not sure if you can access SHM of a different app server (as in your case trying to access SHM of AS1 from AS4). [http://help.sap.com/abapdocu_70/en/ABENSHARED_MEMORY_GLOSRY.htm]
    In this case you can opt for "DataBase Clusters". Relevant ABAP statements: [IMPORT|http://help.sap.com/abapdocu_70/en/ABAPIMPORT_MEDIUM.htm#!ABAP_ALTERNATIVE_4@4@]/[EXPORT|http://help.sap.com/abapdocu_70/en/ABAPEXPORT_DATA_CLUSTER_MEDIUM.htm#!ABAP_ALTERNATIVE_4@4@] FROM/TO DATABASE.
    Hope this helps.
    BR,
    SUhas

  • How to distribute html component between different web applications?

    Hello. I have a project which consists of several modules. Each module is a separate web-application which can be deployed on a separate application server. All modules must have one menu. The problem is how to implement the menu.
    It would be good to maintain it as a separate project and to distribute it between modules as a jar archive. I have an idea to create a custom tag library which will generate and insert html code where it is necessary. But modules can look different, they can use jsf, richfaces or jsp for the page rendering and the menu must suit the page. So I think that the data and the rendering mechanism should be separated somehow.
    Thanks.

    Starting with Servlet Spec 2.3 (I think) the push has been towards complete web applications; even if it means duplicate files in each (disc space is exponentially cheaper than it was a decade ago).
    The easiest way to manage duplicate files is to keep a single copy for development and use build tools like ANT, Maven, etc.. to assemble your web applications at build time.

  • Business Object on SAP Web Application server.

    Experts,
    Can Business Objects be installed on SAP Web Application Server?
    Any Help is appreciated.
    Thanks
    Yashu Raj

    Matt,
    Thanks for your input.
    I found this information on SDN
    Can Business Object Enterprise Web Tier be deployed on SAP NetWeaver system with usage type AS Java?"Yes, this is supported for Java 1.4 (NW 7.0), see http://support.businessobjects.com/documentation/supported_platforms/default.asp
    However, the BOE Web Tier is not shipped with SAP NetWeaver, but can be deployed on an SAP NetWeaver system with usage type AS Java at customer side.
    SAP is evaluating if we could ship the Busines Object Enterprise Web Tier with SAP NetWeaver in the future but that cannot be confirmed yet.
    Still, in this scenario, the Busines Object Enterprise backend server would need to be installed as a separate server."
    Can the Busines Object Enterprise backend server be deployed on an SAP NetWeaver system with usage type AS Java?
    "No, as this is not a J2EE application, but a mix of Java and C++.
    SAP is evaluating if the Busines Object Enterprise backend server could be shipped as a ""Standalone engine"" (as it is the case for BIA and Livecache
    Can the whole or at least relevant parts of the whole Busines Object Enterprise be deployed to the NetWeaver J2EE server, so that distinct scenarios for Busines Object applications run without the need to install a separate Busines Object Enterprise backend server?
    This scenario is currently planned for the next generation Analysis Client (Project: Pioneer) and evaluated for the Java based Crystal Version.
    I am trying to understand the difference between BOE Web Tier and Busines Object Enterprise backend server....can you throw some light on it if you can.
    I am a SAP BI consultant and one of my customers have this question on BOBJ. Any help will be appreciated.
    Thanks
    Yashu Raj

  • Design considerations while accessing data of a different web application

    I am database developer for a web application (*WebApp1*) which supports around *6 million* merchant data across various tables in database (*DB1*).
    The users for the above mentioned application are less, around *50* who monitor the 6 million merchant data.
    Now a proposal has come up to develop a second web application for the merchants themselves.
    Thus the user base for this web application (*WebApp2*) is in millions.
    Now the requirement for WebApp2 is :
    On each login of individual merchants, they need to see their individual data (mostly read-only) which is stored in (*DB1*)
    along with other data which is stored in its own database (*DB2*). WebApp2 will have other functionalities too but those
    are independent of WebApp1.
    Now I can think of three approaches how to display DB1 data in WebApp2 :
    1. Creating a stored procedure and accessing DB1 data through dblink. (*Cons* - have seen access through dblink is slower as it serializes access).
    2. Replicate DB1 data to DB2 through batch jobs running every night. (*Cons* - Will store the same data in 2 places and will have the headache of data sync.)
    3. WebApp1 will expose webservice using DB2 data, so that on each login, WebApp2 users use the webservice to display DB1 data through webservice.
    (Please answer if there are any cons. beacuse of high user base ?)
    Need your suggestion and views. Also if there are any other way please let me know.
    Will it depend on any other factor ? Let me know if you need any further information.
    Cheers !!!

    Ah - this is a much bigger question! And may be outside the scope of this forum to answer. I will have a go though.
    The question really isn't can the database support 6,000,000 users. It is how many of the users will be making database requests at the same time, what is the average elapsed time of each request, and what do your users regard as an acceptable response time to each request?
    To use a (very) simple analogy, my company employs 30,000 people but the IT Service Desk that they call if they have a problem with their PC is only staffed by 30 people. This is because the Service Desk Manager has estimated that at any one time only 1% of all employees will need to call the Service Desk. On average each call takes 6 minutes to resolve and the response time agreed with the business to a call is 1 hour. So within an hour one Service Desk technician can answer 10 calls in an hour, so 30 technician can answer 300 calls an hour.
    Now you can apply this analogy to a computer system. The scalability of database systems is generally limited by the amount of available CPU. If we determine that the average database call uses 10ms of CPU, and the user will accept a response time of 1s, then each CPU can service 100 database calls within that response time. Multiply that by the number of available CPUs and you have a (very rough) idea of how far the database will scale. An server with 8 cores could support 800 concurrent requests. A cluster with 4 servers each with 8 cores could support 3200 concurrent requests.
    I would stress that this is very crude. Much more information would be required to determine what the limits of database scalability were. My example does not take account of other source of potential latency, such as the network or the storage subsystem if requests involve significant physical I/O. Or indeed the latency in the application itself.
    So, you need to answer these questions:
    - How many concurrent database requests need to be supported
    - What is the average amount of database CPU that each database request will consume
    - What is the maximum acceptable elapsed time for each database request
    On a more practical note, your application must use some form of connection pooling to limit the number of database connections required to service all the required database activity. You can scale the database horizontally using RAC and in extreme cases you can offload read activity entirely from the database using a middle-tier caching solution such a Coherence, GigaSpaces or GemFire.
    That's probably enough for now. Any more and you'll probably need to get some consultancy!

  • Is there a PS sript to put different web applications in maintenance mode

    HI,
    I have 2007 R2 SCOM environment.Multiple Web applications is monitored. I got request to put together PS script which could put web application to maintenance mode so it wouldn't not alert while somebody working on it and puts it down. Is there possible
    way to do that.
    Thanks
    Balys

    Hi
    There are different ways to interpret "web applications" - if this is basic URL monitoring then this can be done as follows:
    http://www.scom2k7.com/schedule-a-into-url-maintenance-mode/
    http://www.scom2k7.com/schedule-a-group-of-urls-into-maintenance-mode/
    I have done similar for process monitors here:
    https://systemcentersolutions.wordpress.com/2010/04/03/scheduled-maintenance-process-monitors/
    The idea behind all of these is that you'll need to find out the target class and then put that class into maintenance mode.
    Regards
    Graham

  • Sharing objects between different tabs on a JTabbedPane

    Does anyone know how to share objects on different tabs of a JTabbedPane? I.e., I want the same buttons/corporate logo to appear on each tab in the same location, and thus the same functionality, locations, look, etc...
    Currently, if I invoke the add(Component) method for the same component but for different panes, only the pane that had the last add() method called contains the object.
    Thanks,
    adam

    An instance of a GUI component can only be in one place in the GUI (visible or not).
    You could make your own component class (extending JPanel and containing other components you want) and then create an instance of this for each tab.

  • How to call jsp /servlets running in different web application in tomcat

    hello all,
    i have 2 web applications(Charts and Reports) in the same tomcat,i want to call jsp/servlets running in the Reports webapp from Charts webapp.how do i achieve this.
    thanx
    ravi

    You can also use getContext(String context) in the ServletContext class to get a request dispatcher.
    Using the above example it would be :
    // in a servlet in the charts webapp
    ServletContext context = getServletContext();
    ServletContext reportsContext = context.getContext("/reports");
    RequestDispatcher dispatcher = reportsContext.getRequestDispatcher("/path")
    dispatcher.forward(request, response);Just note, that depending on your server's configuration getContext(...) might return null.

  • Shared objects across JVMs?

    I'm sure this topic must come up fairly frequently, but try as I might, I couldn't find a satisfying answer for what I'm looking for.
    I have an object that loads a very large in-memory datastructure from disk early in its lifetime, after which time the datastructure is read-only.
    My application runs a number of different JVMs on my machine, and each of these JVMs has to load the same datastructure, wasting time and immense amounts of memory.
    I know I can likely improve the load time by storing a serialized version of the object itself on disk, but that doesn't help with the more serious problem: the memory usage.
    Any suggestions for a good, lightweight way to share this read-only memory across the JVMs?

    dougcook wrote:
    Brynjar wrote:
    One question though, is something preventing you from just using a database to store and serve this structure?Mainly performance. The structure gets accessed an unbelievable number of times inside an already compute-bound bit of code (that takes days to run as it is). That would also be my concern with RMI; you're right, I could serve up individual requests for bits of data (looking much like a database), but then I'd worry that the overhead of RMI would kill me. Thus the hope that I can somehow just share the read-only memory between JVMs.
    Edited by: dougcook on Feb 8, 2009 9:54 AMIf you need fast access to all of the structure in multiple applications concurrently, then I think you're out of luck using RMI as well, or any other socket based communication for that matter, for the same performance reason. How large is this structure and how is is currently loaded? Also, do the applications need to be separate? You would be able to share the memory if they were all running within the same jvm.

Maybe you are looking for