Hi Andrea,
Sorry for my confusing cxf.xml definition.
My means of 'same as cxf.xml on the classpath' is the cfgFile which is
passed to ConfigurerImple by System properties is same as the
DEFAULT_USER_CFG_FILE.
Here is the real error, if the cfgFile passed by System properties was
an URL string like "file:///local/customer_cxf.xml", the below code
can't work.
And we mostly want to pass the configuration file's absolute path to CXF.
Thanks,
Willem.
Andrea Smyth wrote:
Jiang Ning wrote:
Hi Andrea,
In current cxf user defined configuration file name was passed by
System Properity
-Dcxf.config.file=user_defined_configuration
This user defined configuration file name will be treat as
ClassPathResource.
public ConfigurerImpl(String cfgFile) {
if (null == cfgFile) {
cfgFile = System.getProperty(USER_CFG_FILE_PROPERTY_NAME);
}
if (null == cfgFile) {
cfgFile = DEFAULT_USER_CFG_FILE;
}
ClassPathResource cpr = new ClassPathResource(cfgFile);
if (cpr.exists()) {
try {
ApplicationContext ac = new
JaxbClassPathXmlApplicationContext(cfgFile);
setApplicationContext(ac);
} catch (BeansException ex) {
LogUtils.log(LOG, Level.WARNING,
"APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[])null);
}
} else {
LOG.log(Level.INFO, new
Message("USER_CFG_FILE_NOT_FOUND_MSG", LOG, cfgFile).toString());
}
}
There is an issue about the user defined configuration. If the
user_defined_configuration file name is same as cxf.xml in the classpath
or the user_defined_configuration file not in the classpath. The
user_defined_configuration file would not be loaded rightly.
Hi Willem,
What do you mean with 'same as cxf.xml on the classpath'? The default
user cfg file (cxf.xml) is not the same as META-INF/cxf/cxf.xml.
I don't see a problem as there is no cxf.xml on the classpath unless a
user puts one there.
Andrea.
My suggestion is configurer treats the user_defined_configuration
file as URL like Celtix had done before, to make sure the
configuration file right there.
Any other thought?
Willem.
--
Willem Jiang
Software Engineer
IONA Asia Pacific Software Development Center
2/F, Unit A, Information Center
Zhongguancun Software Park Haidian District,
Beijing, P.R.China (100094)
Tel: +86-10-82825151 - 523
Fax: +86-10-82825210
Email: [EMAIL PROTECTED]