Solved

Static files cannot be refreshed without redeploy in Weblogic's clustered environment

Posted on 2004-08-16
6
1,302 Views
Last Modified: 2013-12-10
1) It works in a single server (i.e. a non-clustered environment). When updated, the static html file changes are reflected immediately on the JSP.

2) However when it's deployed in a clustered environment, the update would not be reflected unless the static web application is redeployed. This is unacceptable as there's this requirement to update the html changes on a regular basics by end-users and they do not know about weblogic deployment.

The following's the codes extracts of one of the jsps:

<body style="MARGIN: 0px;margin-left: 0px">
 <%
      ServletContext sc= application.getContext("/xxx_static/");
      RequestDispatcher rd = null;
      rd = sc.getRequestDispatcher("/aaa/home.htm");
      rd.include(request, response);
 %>

Is there any solution to ensure that this kind of static files can be refreshed without redeploying in Weblogic's clustered environment?





0
Comment
Question by:feliciayong
  • 2
6 Comments
 
LVL 4

Expert Comment

by:illusionz70
Comment Utility
the foll is from weblogic docs version 6.1


Refreshing Static Components Without Redeploying the Application

To refresh static components of an application without having to redeploy the entire application, use the weblogic.refresh tool.

When you update a static file in a Web Application on the Administration Server, the file is not automatically copied to the Web Application on any Managed Servers, but you can use weblogic.refresh to refresh, add, or delete static files such as:


JSPs

XML files

HTML files

Image files, such as .gif and .jpg

Text files
Refreshing JSPs does not require redeploying the Web Application because each JSP is loaded by its own classloader, of which the Web Application classloader is a parent.

Note the following limitations of this utility:


You cannot use this utility to refresh Java class files.

To use this utility, the Web Application must be deployed in exploded directory format, and if it is contained in an ear file, the ear file must be in exploded format. The utility does not work for components archived in .war files.
To refresh a static file:


Set up your development environment so that WebLogic Server classes are in your system CLASSPATH and the JDK is available. You can use the setEnv script located in the config/mydomain directory to set your environment.

Enter a command in the following form:
% java weblogic.refresh -url -username -password -application
-component -files -delete -root

Where:


url is the URL of your WebLogic Administration Server.

username is the username for system administration.

password is your system administration password.

application is the name of an Enterprise Application that contains the Web Application being refreshed. If your Web Application is not part of an Enterprise Application, enter the name of the Web Application.

component is the name of the Web Application being refreshed.

files is a comma-separated list of files to be refreshed. The files can be specified using wildcards, e.g., *.jsp or *.gif. Note that to specify multiple files you cannot use both wildcards and multiple comma-separated files. Filenames must be relative filenames to the root of the Web Application, so if the file is ball.gif and is contained in a subdirectory \foo of the Web Application root directory, the filename is foo\ball.gif. If a file does not exist on the server, it will be created, along with any specified subdirectories.

if delete is set, named files will be deleted.

root is the directory from which files should be picked up for refresh. Default is the current directory.
For example, the following command refreshes the files HelloWorld.jsp and foo\ball.gif in the myWebApp Web Application:

java weblogic.refresh -url t3://localhost:7001 -username
myUsername -password myPassword  -application myApplication
-component myWebApp -root c:\stagedir\myWebApp
HelloWorld.jsp,foo\ball.gif

0
 
LVL 23

Expert Comment

by:rama_krishna580
Comment Utility
Hi,

You can look at the documentation provided by the Weblogic ....
@ http://e-docs.bea.com/wls/docs61/webapp/deployment.html   in particularly...
@ http://e-docs.bea.com/wls/docs61/webapp/deployment.html#149386

And...You are deploying a Web Application or Enterprise Application that contains static files that you will periodically update. In this case, it is more convenient to deploy the application as an exploded directory, because you can update and refresh the static files without re-creating the archive.

For more info refer to again documentation by Weblogic
@ http://e-docs.bea.com/wls/docs81/deployment/overview.html

i hope it may help you...

best of luck..
R.K
0
 
LVL 1

Author Comment

by:feliciayong
Comment Utility
Hi,

Really appreciate all the prompt responses. Thanks!
But sorry, I think i have not clearly defined my question & requirements earlier.

Currently I'm deploying the following components in weblogic 8:
1) Application EAR (contains dynamic files like jsps & servlets)
2) Web Application (deployed as an exploded directory, containing static html files)

Consideration Points:
Pt A) It works in a single server (i.e. a non-clustered environment). When updated, the static html file changes are reflected immediately on the JSP.

Pt B) However when it's deployed in a clustered environment, the update would not be reflected unless the static web application is redeployed. This is unacceptable as there's this requirement to update the html changes on a regular basics by end-users and they do not know about weblogic deployment.

The following's the codes extracts of one of the jsps that's residing in the EAR file:

<body style="MARGIN: 0px;margin-left: 0px">
 <%
      ServletContext sc= application.getContext("/xxx_static/");
      RequestDispatcher rd = null;
      rd = sc.getRequestDispatcher("/aaa/home.htm"); // "/aaa/home.htm" resides in Web Application's exploded dir
      rd.include(request, response);
 %>

Is there any way to ensure that this kind of static files can be refreshed without redeploying in Weblogic's clustered environment, i.e. user just need to refresh web browser to see the html changes instantly (to achieve Pt A in a clustered environment)?

0
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 300 total points
Comment Utility
Hi,

Now at this situation, the best and easy solution is you write a BUILD.XML file for the deployment and before that locate the deployment location and delete the EAR/JAR/WAR files and re-deploy using this Ant-Build XML file. It will be easy for you to maintain the application changes and with latest update changes in side the application(s). When ever you change any thing you need to just run the build.xml file then it will do every thing for you.

So you go for Build.xml file ....

best of luck...
R.K
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now