In this case I'd say xwork is broken. The solution is for it to not bother monitoring files that are in jars.

On Mar 9, 2004, at 11:53 AM, Craig Raw wrote:

Hi,

After spending some time with the xwork/oscore code, I find that what you say is not wrong, but it is broken in this case. The problem is in FileManager, which stores a reference to the file and its last modified timestamp as you say, to check if it needs reloading later. Before storing this however, FileManager checks if the file exists and is readable (reasonably so, since it needs to obtain the last modified timestamp). However, in the case of deployment on JBoss and sharing the xwork/oscore libs, the file does not exist. JBoss does not explode its shared libs, and the file url that FileManager obtains looks something like ..../jboss/server/default/lib/webwork-2.0.jar!/webwork-default.xml.

Since this doesn't exist, webwork-default.xml is never added to FileManagers references, XmlConfigurationProvider.needsReload() always returns true and thus every request to the site means all the configuration files are reloaded.

Note that this only happens with the <include file="webwork-default.xml"> type references in xwork.xml, not xwork.xml itself, but XmlConfigurationProvider checks all of its referenced files for reloading.

I don't whether jboss or xwork/oscore is broken here, but I'd appreciate any suggestions.

Thanks,
Craig

Jason Carreira wrote:
It doesn't actually re-parse the configuration XML file every time. The
ConfigurationManager calls provider.needsReload() on every
ConfigurationProvider to see if that config provider thinks it needs to
reload (so any custom ConfigurationProvider can implement this in its
own way). The XmlConfigurationProvider, which parses xwork.xml or any
file using that DTD, uses the FileManager from OSCore which I wrote
(stole from some of Hani's code :-) )... That utility maintains a
reference to the file and checks its timestamp vs. the time stamp the
last time we read it to see if the file timestamp has changed. Note that if you set this flag the same check will be done for all
validation files and conversion property files, although not for text
bundles (complain to Sun, it's their PropertyResourceBundle). Jason
-----Original Message-----
From: Craig Raw [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 7:37 AM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] XWork, Webwork and reloading xml



Hi,


I have run into issues surrounding xwork and the reloading of classes using hot deploy. My deployment environment is JBoss, where I am sharing the webwork/xwork libraries between ears (to keep the ear file size down) and using a separate loader repository for each ear (to keep the configurations separated by classloader namespace).

The problem comes with the flag, webwork.configuration.xml.reload. When set to false, xwork holds on the xwork.xml file (loaded by a classloader) even after a hot redeploy. This causes all the classes loaded by that classloader to remain accessible as well, and the hot redeploy fails in the sense that the deployed classes do not change, and neither does the xwork configuration. (This would not happen if I bundled the xwork/webwork libraries into the ear/war, at the cost of a much larger ear file size.)

If the flag is true, hot redeploy works fine, but com.opensymphony.work.config.ConfigurationManager reloads xwork.xml on every request to the server.

I would like to be in a situation where I can hot deploy to a production server, to avoid having to drop all the deployments and restart the server just to update one. However, I am concerned as to the additional load caused by constantly reloading xwork.xml. I see that there is a comment in the class mentioned above, on line 127:

@todo it currently appears that the reload strategy is to check on each call to getConfiguration(). this seems extremely burdensome. a caching mechanism should be implemented

Is it possible to have the best of both worlds, and have the xwork.xml reloaded only on redeploy?

TIA,
Craig


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/? ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Opensymphony-webwork mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork



------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork




------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to