This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes how to setup multile instances specific parameters of a same web application ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "how to setup multile instances specific parameters of a same web application ?" Watch "how to setup multile instances specific parameters of a same web application ?" New topic
Author

how to setup multile instances specific parameters of a same web application ?

rakesh chauhan
Greenhorn

Joined: Sep 07, 2004
Posts: 3
Hi,

Please help me.

I have an web application running on Solaris weblogic 7.

Now the requirement is such that we need to enable or disable certain features when implementing web app for different client. Means we need to implement same web app to other weblogic server.

The application has same EAR file. The only different is certain features will be unavailable on this new instance of same application.

[1] How to setup web application instances specific parameters ?

One solution is to create application.instance file. And then put check everywhere in applicable places to make feature visible and invisible.

[2] How do I setup application.instance file under weblogic server. I mean shall create environment variables in unix or keep it as text file and load and access from application while user navigation ?

Please advise better solution, if any.

Thanks
Rakesh
Nizan
Greenhorn

Joined: Apr 18, 2001
Posts: 22
I'd say that this is a code level process. WebLogic is a container+.

When you say 'multiple instances' do you mean copies of the same application deployed on more than one managed server?


Nizan Horsefield<br />Weblogic Support<br />BMW
rakesh chauhan
Greenhorn

Joined: Sep 07, 2004
Posts: 3
Yes, that is what I exactly mean.

The instances will be different subsets of same app EAR file.

I agree that it is code level control based on the particular instance running.

However, the question is what is the best way to recognize the particular instance?

Meaning I need some external parameter to recognize the instance from within application. For example, [i] Canada instance of application and [ii] US instance of application. Once I know which instance I am running within application, I can easily put check on the feature applicable within code.

I need to keep only one EAR file and additionally properties file which set the feature enable and disable. What is the best way to inform application that which particular instance is being launched? So that related logic can be executed for the needed functionality.


Thanks
Rakesh
Sachin Dangi
Greenhorn

Joined: Aug 31, 2003
Posts: 17
Rakesh,
i have couple of suggestions.

1. You can obtain the IP address of the server at runtime and enable/disable features accordingly.

2. You can use properties file. keep a copy of this property file on each server [assuming each managed server is running on different solaris server].

sachin
[ September 09, 2004: Message edited by: sachin ]
rakesh chauhan
Greenhorn

Joined: Sep 07, 2004
Posts: 3
Thanks Sachin for the suggessions.

What we have done for now is as follow,

[1] Local WebLogic Server for development, we changed command script file C:\bea\weblogic700\server\bin\startWLS.cmd to include "-DInstance=Canada"
in the variable "MEM_ARGS=" then use the code System.getProperty("Instance").toLowerCase() for the instance name. Then to do dev test we have to change the value of "-DInstance=Canada" for particular instance.

[2] For actual server QAT, UAT and PRD we have setup, we defined the attribute on console ex. Managed Server-->serverName-->configuartion-->Remote Start-->Arguments:-->-DInstance=Canada

Then code works same.

Thanks
Rakesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to setup multile instances specific parameters of a same web application ?
 
Similar Threads
Question about resuable EJB's and where to deploy them.
Any disadvantages of the struts framework.
how to create a webapplication in weblogic server
front end choice
Tomcat multiple instances or virtual hosts