[
https://jira.jboss.org/browse/JBESB-3085?page=com.atlassian.jira.plugin.s...
]
David Ward commented on JBESB-3085:
-----------------------------------
I don't understand what the problem is here. I'm comparing XsltAction's
template loading, and comparing it to AbstractPropertyRulesRouter's ruleSetConfig
loading, and here's what I see:
- In XsltAction.createTemplate(String,TransformerFactory), StreamUtils.getResource(String)
is used, which in turn calls StreamUtils.getResource(String,Class). This
1) checks to see if it is an existing file, and if not found
2) tries loading it from the classpath using ClassUtil.getResourceAsStream(String,Class),
and if not found
3) if it is an absolute URI, calls toURL().openStream() on it.
- In AbstractPropertyRulesRouter.loadRules(), it
1) checks to see if it is an existing file, and if not found
2) tries loading it from the classpath using ClassUtil.getResourceAsStream(String,Class)
The only difference between the two is that AbstractPropertyRulesRouter.loadRules() does
not check to see if the ruleSetConfig is an absolute URI. So, what is the problem
here???
Misloading of Template Files in ContentBasedRouter
--------------------------------------------------
Key: JBESB-3085
URL:
https://jira.jboss.org/browse/JBESB-3085
Project: JBoss ESB
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Content Based Routing
Affects Versions: 4.7
Reporter: Fernando Ribeiro
Assignee: David Ward
Fix For: 4.9
Unlike XsltAction, for example, ContentBasedRouter tries to find the template file in the
file system before loading it from the classpath.
// Get the properties file stream...
if (ruleSetFile.exists()) {
try {
ruleStream = new FileInputStream(ruleSetFile);
} catch (FileNotFoundException e) {
throw new MessageRouterException("Unable to open rule properties file
'" + ruleSetFile.getAbsolutePath() + "'.", e);
}
lastLoaded = ruleSetFile.lastModified();
} else {
ruleStream = ClassUtil.getResourceAsStream(ruleSetConfig,
AbstractPropertyRulesRouter.class);
}
(from AbstractPropertyRulesRouter.java)
It is an easy miss because it is the only parameter that can't begin with
"/".
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira