Multiple Instance of Web Application having static reference

Hi All,
I have a Web application "A" and the replicate of the same
as "B". So it means it has same package and class name,
for example
com.test.Util is the java file which gets the DB Properties
from a File. All the variables in that java file are static
for example the
DIRECTORY_NAME = c:/instance1
FILE_NAME = db.properties
In application "A"'s web.xml, on load startup i am invoking
a Servlet on the init method i am grabbing these details
from my util class.
In Application "B" i am chaning the com.test.Util
DIRECTORY_NAME=c:/instance2
FILE_NAME=db2.properties
I generate a WAR for Application "A" and "B" and deploy that in Tomcat.
Now if i start tomcat, i understand that Configuration of
B overrides A, because they are all static.
Basic Question is same Static memory blocks are shared by two different deployed web application, i want to have them seperate how can i do that?
Thanks in Advance
Arul

Try deploying them in different domains... not sure of this though

Similar Messages

  • Static member problem in multiple instance of  web application

    Problem
    I am working on a product which is java based. I have a war file. I have to deploy this war file in JBoss. Further, I need to run multiple instance of this war file in same JBoss instance.
    Issue
         In that war file there is servlet Start.java. That servlet calls an other class from its init method. Here is code
    public class Start extends HttpServlet
         public void init(ServletConfig config) throws ServletException
              super.init(config);
              DB.loadProperties (�db.properties�);
         } // init
         public void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException
                   } // doGet
         public void doPost(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException
                   } // doPost
    } // Start
    public final class DB implements Serializable
         public static final String     P_UID = "ApplicationUserID";
         private static final String     DEFAULT_UID = "System";
         public static final String     P_PWD = "ApplicationPassword";
         private static final String     DEFAULT_PWD ="System";
         public static final String     P_STORE_PWD = "StorePassword";
         private static Properties           s_prop = new Properties();
    public static boolean loadProperties (String filename)
         {    // looks for properties file
    s_prop = new Properties();
              FileInputStream fis = null;
              try
                   fis = new FileInputStream(filename);
                   s_prop.load(fis);
                   fis.close();
              catch (FileNotFoundException e)
                   log.warning(filename + " not found");
                   loadOK = false;
         �}
    As you can see if I deployed two instance of this war in JBoss and assume each instance point to its own properties file. The �Static� members are problem.
    Restriction
         I am not allowed change the code or logic of the product. I must be able to get some thing outside or apply a patch to solve this problem.
    Please Help
    Possible option that I have thought
    1 Using multiple JVM - Not an option in this project
    2 Using multiple JBoss � Not the requirement (need to run only on single Instance of JBoss)
    3 Use own class loader for war/ear � don�t know how in JBoss need help.
    I am using JBoss 3.2.3
    Thanks,
    Kumaran

    Static members belong to the class. So, you needto
    think of multiple JVMs for your problem.Thanks for reply.
    don�t know how in JBoss need helpJust guessing... clustered environment MAYBE
    RichThanks Rich,
    I don�t know how Cluster environment solve my problem. I need more information on your thought. Cloud you explain it.
    Kumaran

  • How to use/sync single data (file) across multiple instances of same application

    Currently we have an application (a diagram editor), that have the ability to save and load (serialize) its state in a xml file.
    Now we want this application to behave like Microsoft OneNote application. Where multiple users have the ability to access the same file.
    Later we may also need to enhance with other things like, (1)what is changed and who changed it, (2)option to resolve conflicts if any.
    I came to know about sync framework to resolve this. so far, i have not tried it.
    All i want is,
    Virtually single file should be edited by multiple instances of same application.
    We need a dll (sync framework) that does following
    It takes complete responsibility of file handling.
    Using this dll, each instance of the application will notify their own changes.
    Each instance of the application should have the ability to detect the changes that is recently made (when, who, what are the changes).
    My question:
    Will sync framework be suitable for this requirement?
    If so, is there a demo application that represents this?
    - Jegan

    Seems like I have found the solution.
    In the taskflow there is a property named data-control-scope and I set it to isolated instead of the default (shared) and this seemed to do the trick.
    I can now have two instances of the same taskflow running with different ApplicationModules
    Cheers,
    Mark

  • Detecting multiple instances of same application on startup.

    How can I detect multiple instances of same application on startup? I would like to display a message to the user stating that the application is already running [and then close out].

    How can I detect multiple instances of same
    application on startup? I would like to display a
    message to the user stating that the application is
    already running [and then close out].Congratulations on being the bazillionth person to ask this kind of question without bothering to search the internet.

  • JDev 11g: Multiple Instances of Same Application Using Same AppModule !?

    Hi Everyone,
    I'm having difficulties with multiple instances of taskflows and their application modules.
    I have a main application which has two separate instances of a taskflow (another application with it's own appmodule). I would like for the two separate instances to use separate instances of their application module but that is not happening.
    How can I set this up ? I would like instance 1 to have it's own application module and instance 2 to have it's own as well.
    Any thoughts ?
    Mark

    Seems like I have found the solution.
    In the taskflow there is a property named data-control-scope and I set it to isolated instead of the default (shared) and this seemed to do the trick.
    I can now have two instances of the same taskflow running with different ApplicationModules
    Cheers,
    Mark

  • Multiple instances of one application in a single vm

    Hi
    At work we use a database client called SAP, for timesheet, maintenance logs etc.
    To access this application (SAP) we need to use computers on a domain, which we are charged $6000 yearly per. computer.
    To reduce this cost, we want to set up a server running windows server 2012 (for centralized storage, web applications etc), with a virtual machine running windows 7, that is part of the domain, and having access to SAP.
    What we then would need is the ability to remotely log on to the virtual machine and run SAP, easy enough..
    But the problem is that we are 15 people who need to do this at the same time.
    Is this possible? And is Hyper-V the right way to go?
    The server will be running with two network adapters, one for the office network, and one for the virtual machine which connects it with the domain.

    Hyper-V won't allow you to get out of paying your per use licensing.
    You will need 15 licenses of Windows installed in Hyper-V as well as SAP.

  • Multiple Instances of Same Application Icons in iTunes App Folder

    I recently sync'ed my iPhone to iTunes on my MBP. After doing so I noticed that in the iTunes application folder there was 2 icons for each of my application that I have. Only one icon though on my iPhone. Running a sync a third time I got 3 icons in the applications folder for each application, but again only one instance of the application icon on my iPhone.
    I am not sure why this is occuring, but need some help to ensure that iTunes is reflecting the applications correctly.
    Why this is importance, is I can now no longer update my paid applications, via the iPhone and the Apps Store shows I need the same update 3 times, but will not download, as it claims the update was already performed.
    Something is messed up and need some guidance and help. PLEASE
    Thanks

    Yes, I migrated my iTunes directory, and after the migration, everything looked fine. Only one set of icons. It was not until I started to sync the itunes on my new MBP that the duplicating of icons started.
    I try to delete the duplicate icons, but in doing so it will delete the application on the iPhone.
    It there a registry that stores the icon to file associations?
    If I look in the music/iTunes/Mobile Applications folder there is only 1 instance of the *.ipa for each application. So why does iTunes have 3 copies of the icons pointing to the one *.ipa file. There must be an internal itunes registry that has made the icon associations. That is what needs cleaning out. I just do not know where that would be, given there is only one *.ipa file under the iTunes file structure.
    Can anyone help determine how to clean up the multiple icons?
    Thanks

  • Multiple instances of Web Analysis

    Is it possible to have 2 instances of Web Analysis (seperate physical servers) point to a single respository and a single instance of Shared Services. We would like to dedicate one server to internal (LAN/WAN) users and one for external (Internet) access, but want to maintain one set of reports and security. Any assistance will be appreciated. Version 9.3.1.0 running on Win2003 Server with Tomcat.

    Hi Ravindranath,
    check this to add it.
    http://blogs.msdn.com/b/tconte/archive/2007/01/18/programmatically-adding-web-parts-to-a-page.aspx
    Kind Regards,
    John Naguib
    Technical Consultant/Architect
    MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
    Please remember to mark your question as answered if this solves your problem

  • Preventing multiple instances of same application - started with "java app"

    I need to ensure that only one instance of an application runs at any given time.
    As far as I know launching it twice with "java appName" will run each in its own memory space, so it is not immediately obvious how to achieve it. I considered using a database entry or environment variable, but those would need to be cleared on exit and therefore be at risk of not being cleared if the application crashes or hangs.
    Is there a Java API call that would allow me to do a check for other instances of the same application... safely?

    Create a ServerSocket on a fixed port number that isn't used by any other application. If you get a BindException, your application is alread running.

  • Virus scan failed Error on deploying a web application having a jar file for calling the applet on the jsp page

    Hi,
    I have an applet application that i want to deploy on the Oracle cloud.
    So i have created a jar file for the applet application and i am using this jar to call the applet on a jsp page.
    But when i am delpoying my application on the java cloud, its giving me the below error:
    2014-10-28 03:16:41 CDT: Starting action "Virus Scan"
    2014-10-28 03:16:41 CDT: Virus Scan started
    2014-10-28 03:16:49 CDT: ----------------------------------------------------------------------
    2014-10-28 03:16:49 CDT: File Scanned: "Application7.ear".
    2014-10-28 03:16:49 CDT: File Size: "106698122".
    2014-10-28 03:16:49 CDT: File Status: "INFECTED".
    2014-10-28 03:16:49 CDT: ----------------------------------------------------------------------
    2014-10-28 03:16:49 CDT: Virus scan failed.
    2014-10-28 03:16:49 CDT: "Virus Scan" complete: status FAILED
    Can't we deploy any application having applet or swing component's onto the cloud?
    Or do we need to request for any extra permissions for the same?
    Thanks,
    Manoj

    I don't see applets mentioned in the supported features nor in the unsupported features so not sure if they are supported you would likely need to contact the operations team to confirm.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • Handling multiple events in web application

    We are converting a window application to a web application. We are facing an issue while implementing the web application with Java on front end and Oracle DB in back end. Consider a field with a car registration number which needs to be verified if it exists in the DB and fetch the remaining values related to the car and display it. At the same time we also need to save the car registration number in the form (displayed in the browser) so that other operations (such as invoicing) can happen on the car. We have a constraint that we cannot touch any of the server procedures in the DB (which handles all DB calls) but could only play with the functions in the UI.
    Now the verification of the reg. no. happens whenever we go 'out of focus' from the text box where the reg.no. is written. However, if the user presses 'save' button to save the reg.no., verification should also occur and data should be saved. Now the problem we are facing is that on pressing the save button, two events are occurring simultaneously - 1. textbox with reg.no. is getting 'out of focus' and 2. save button is getting pressed resulting in verifying the reg.no. again. Due to this two events happening simultaneously, one or other method is failing leading to the car reg.no. not getting verified and saved as it should be.
    Could anyone think of any solution to overcome the issue?
    /Mayank

    Hi,
    Your assumptions are all correct. Indeed there is Javascript code executing on focus change and AJAX is doing the validations by inturn calling an oracle procedure through some Java rountine. The two requests are overlapping and hence blocking the complete execution of either, leading to the validation not taking place at all.
    The webpage gets refreshed everytime an event occurs and thus the next event can take place only after the page has refreshed once (after completing all the validations linked to that event). The problem is occuring since the page is not getting time to refresh. With simultaneous execution of 2 events, the validations related to 'Out of focus' remains incomplete before the 'save function' starts. I am constrained not to put the validation related to 'Out of Focus' in the beginning of 'save' event since that would alter functionality of the 'save' event. Again, I am not allowed to change any of the server procedures on the DB side and have to pass exactly the same i/o parameters for it to function properly.
    What I am trying to find is: Whether it is possible to find out (using some global variables) that when the 2 events are happening simultaneously, their functionalities could be combined and serialized in just one refresh of the webpage. and how?
    I am trying to get this project done by Java resources and am myself not very technical with Java. If a solution exists and I get to know it exists, I can guide the programmers to try out the approach that come up.
    Thanks so much :)

  • Need help on making desktop application to web application having individual controls for users at the same time

    Hi,
    I have an desktop application and the following are the functionalities of the same.
    1. User inputs the data file with path (log file) to parse the required data.
    2. Once the user enters the path and starts the tool with start button, the tool parse the required data in terms of records and gives the records (creates output file containing all the useful records).
    3. Have popup window to display a group of data.
    4. Have popup to Plot graph. When a button is pressed in main GUI, the popup is opened giving scroll bar menus to choose the data for the graph. User after selecting the data (multiple Y axis) press another button to plot the graph. The input to this popup is the output file generated by this tool.
    5. The main GUI has buttons (play, step forward, step backward, reverse play, pause, stop, 1st record, last record - like tape recorder buttons) to play the records one by one.
    This application is used by many people and since its a desktop application (created in labview 2009), the user every time has to manually install the newer version.
    "So it is required to make the application into web based so that, the user can individually access the tool at the same time (different instances same as desktop app) and run their own data files from their system. The output files to be stored in the respective user's system."
    Can this be done using Web Publishing or Web Services present in LabView?
    I tried using Web Publishing but it gives control to only one user at a time and loading the files from the client path to run the tool is not possible.

    Simple. 
    If all you are worried about are updates, just put the EXE on a shared network drive and have your users launch it from there.

  • Stop Multiple Instances of an application

    Hi,
    The title pretty much says it all, I was wondering if I could gather your input on how to correctly stop an application running more than once in java. I have implemented both file locking methods and ServerSockets however both have their disadvantages. For example, the file locking seems to cause a problem that the file is unlocked / deleted if the process is abnormally terminated and I've yet to come up with a solution for this other than creating a batch file to auto run...Similarly, with the ServerSocket it doesn't seem to be very reliable it runs for a few moments and then disappears without an error message...
    I've been searching the web and found something called JUnique which claims to do what I'm after however I'm unsure as to whether it would work the way I'm after as it seems to be implying it works by the file locking method.
    Anyway, how do you go about solving this in your applications?
    Many thanks,
    Barto.
    Ps. The other thing was that I notice that other languages use something called Mutex to stop the running of an application multiple times - is this available in Java?
    Edited by: 799611 on 04-Dec-2010 09:18

    Do you mean the program runs (you can see it in some task manager), but the ServerSocket stops listening (something like netstat -an in Windows confirms this)?
    I belive your program simply completes and it takes the ServerSocket with it, which is just what is expected.
    Your program is dead, so another instance can start.
    Edited by: baftos on Dec 4, 2010 1:23 PM

  • Multiple Instances on Web Server?

    Hi,
    I am trying to setup a live site and a test site on the same webserver.  I have tried to do this a couple of ways - first I tried installing the second instance on the default web site using a virtual directory but that didn't work.  Next, I created a test web site and then installed an instance there but that still doesn't work.  The original live instance still runs fine but when I try to open the test instance I get the following error:
    The entry 'connString' has already been added.
    Why would having two web.config files with different connections for different instances cause this problem?  How do I get around this problem?
    Thanks,
    David

    Hi David,
    I'm not sure from your description if you have done this, but in order to create a second instance, you need to do this through the Webtools Installer > Advanced Install button.
    In the Webfiles Installation field, the default path is displayed as c:\inetpub\wwwroot\B1Webtools. As you are creating an additional website, you should change this to something like c:\inetpub\wwwroot\B1WebtoolsTestSite here.
    As part of the Advanced installation the new Virtual Directory is also created.
    For guidelines on how to do this in full, please take a look at the SAP Business One E-Commerce and Web CRM 6 - Administrator's Guide on https://service.sap.com/smb/sbo/webtools > Training/Documentation.
    See from Page 9 onwards.
    Kind Regards,
    Lilian Lynch
    SAP Business One Forums Team

  • Restricting multiple instances of an application

    Hi, how can I restrict an application from loading more than one of its instance at a time.
    Thanks

    The first step is to search the forums...
    http://forum.java.sun.com/thread.jsp?forum=4&thread=310327&start=1&range=1

Maybe you are looking for

  • Using sqlerrm in insert statement in 10g

    Hi, I do not have 10g to test the following snippet, which tries to use sqlerrm in an insert statement: -- start testcase drop table tbl; drop table err; create table tbl (x number); create table err (a number, b varchar2(4000)); declare   n_tmp   tb

  • I was using my HDMI port to connect to my TV .port just stopped working

    I was using my HDMI port to connect to my TV .port just stopped working HP Pavilion g6 Notebook PC Version 6.3.9600 Build 9600

  • Newest update caused printing problems

    I was using Reader to print some forms this morning and things were fine for the first form, then the program said it wanted to update, so I let it. Now it won't print properly. I had been printing the form in portrait, so it would print at the top h

  • Recurring ping timeout to certain IPs every minute

    Hi all, Had BT broadband for a month now and have been getting chronic lag when playing online games and surfing the web. The same issue seems to manifest when pinging certain IP addresses using "ping -t" in command prompt. I consistently get two con

  • Is it possible to save customisations you've made to a widget?

    I've just spent about 20minutes customising the style of the tabs widget. I want to use this custom version of the tabs on multiple pages of my site. I'm guessing that when I drag out the widget again on another page, I will have to customise the def