[jboss-jira] [JBoss JIRA] (DROOLS-1074) Kie-spring read resources on EAP not working

Petr Široký (JIRA) issues at jboss.org
Tue Mar 1 03:59:00 EST 2016


     [ https://issues.jboss.org/browse/DROOLS-1074?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Petr Široký updated DROOLS-1074:
--------------------------------
    Component/s: integration


> Kie-spring read resources on EAP not working
> --------------------------------------------
>
>                 Key: DROOLS-1074
>                 URL: https://issues.jboss.org/browse/DROOLS-1074
>             Project: Drools
>          Issue Type: Bug
>          Components: integration
>    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