[
https://issues.jboss.org/browse/DROOLS-184?page=com.atlassian.jira.plugin...
]
Geoffrey De Smet edited comment on DROOLS-184 at 7/1/13 11:44 AM:
------------------------------------------------------------------
Just double checked with Mark, this a bug, not intended design:
<conan_>
kieResources.newClassPathResource("src/main/resource/xxx/org/cheese/myCheeseRules.drl")
// ???
<conan_> would make no sense
...
<ge0ffrey> conan_: ... you agree that
kieResources.newClassPathResource("/org/cheese/myCheeseRules.drl") should work?
<conan_> yes
was (Author: ge0ffrey):
Just double check with Mark, this a bug, not intended design:
<conan_>
kieResources.newClassPathResource("src/main/resource/xxx/org/cheese/myCheeseRules.drl")
// ???
<conan_> would make no sense
...
<ge0ffrey> conan_: ... you agree that
kieResources.newClassPathResource("/org/cheese/myCheeseRules.drl") should work?
<conan_> yes
kieResources.newClassPathResource() violates the Class.getResource()
conventions
--------------------------------------------------------------------------------
Key: DROOLS-184
URL:
https://issues.jboss.org/browse/DROOLS-184
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 6.0.0.Beta4
Reporter: Geoffrey De Smet
Assignee: Edson Tirelli
Suppose I have a jar like this:
{code}
cheeseProject-1.0.0.jar
/org/cheese/MyCheeseApp.class
/org/cheese/myCheeseRules.drl
{code}
There are 2 ways in plain old Java, to get that drl classpath resource:
{code}
getClass().getResource("/org/cheese/myCheeseRules.drl") // OK
getClass().getResource("myCheeseRules.drl") // OK
{code}
The KnowledgeBase's classpath resource creation expected similar parameters.
In KieBase I expected it to work in the same way:
{code}
kieResources.newClassPathResource("/org/cheese/myCheeseRules.drl") // FAILS
kieResources.newClassPathResource("myCheeseRules.drl", MyCheeseApp.class) //
FAILS
{code}
Instead it expects something like this:
{code}
kieResources.newClassPathResource("src/main/resource/xxx/org/cheese/myCheeseRules.drl")
// ???
{code}
That's not compatible with the JDK definition of a classpath resource, and therefore
shouldn't be called newClassPathResource(...). And I 'd like to be able to use the
real newClassPathResource() variation.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira