[jboss-jira] [JBoss JIRA] (DROOLS-1074) Kie-spring read resources on EAP not working
David virgil naranjo (JIRA)
issues at jboss.org
Mon Feb 29 13:16:02 EST 2016
David virgil naranjo created DROOLS-1074:
--------------------------------------------
Summary: Kie-spring read resources on EAP not working
Key: DROOLS-1074
URL: https://issues.jboss.org/browse/DROOLS-1074
Project: Drools
Issue Type: Bug
Affects Versions: 6.4.0.Beta2
Reporter: David virgil naranjo
Assignee: Petr Široký
had to touch little bit the Kie-Spring to get the resources correctly. This is the only class I had to touch:
https://gist.github.com/dvirgiln/0f65d184c2004127b1db#file-gistfile1-txt-L90-L95
getClass().getResource("/") is failing on EAP, it returns null
This code needs to get the path of the kie-spring.jar. This is the only way I found to get the containing jar path.
This code is working. Maybe you know another way.
ClassLoader cl = getClass().getClassLoader();
URL url = getClass().getProtectionDomain().getCodeSource().getLocation();
configFilePath = url.getPath();
if (configFilePath.endsWith("!/")) {
configFilePath = configFilePath.substring(0, configFilePath.length() - 2);
}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list