Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-16
6
Medium Priority
?
1,738 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 4

Expert Comment

by:illusionz70
ID: 11817810
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
ID: 11827214
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
ID: 11831473
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 1200 total points
ID: 11889582
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

604 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