[ 
https://issues.apache.org/jira/browse/TUSCANY-2882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790246#action_12790246
 ] 

Phil Housley commented on TUSCANY-2882:
---------------------------------------

Well, I completely forget about this issue for most of a year, and so obviously 
it has come back to haunt me.  I've been looking at porting my patch to 1.5.1 
for a current project, and found that things have changed a bit in the 
implementation-spring packages.  What I have pasted together for now is 
changing the assumption that all paths are relative:

{code}
parentPath.substring(0, parentPath.lastIndexOf("/") + 1) + location;
{code}

To consider that they may begin with a "classpath:":

{code}
if (location.startsWith("classpath:")) {
  location = location.substring(10);
  resource = 
Thread.currentThread().getContextClassLoader().getResource(location);
}
{code}

Would this make an acceptable patch, or would it be too hacky?  There is 
already a "FIXME - need to find a right way of generating this path" in the 
code, so I don't think I'm really making things worse.

> Relative path imports don't work in Spring implementations.
> -----------------------------------------------------------
>
>                 Key: TUSCANY-2882
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2882
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Spring Implementation Extension
>    Affects Versions: Java-SCA-1.4
>            Reporter: Phil Housley
>
> Using implementation.spring, the Tuscany bean file parser and Spring's parser 
> interpret import links in different ways.  Spring sees them as relative, 
> tuscany as absolute, so one parser will generally fail unless everything goes 
> into a root folder.
> I have a patch for this, using Spring's relative resource system, but I 
> cannot guarantee that the two parsers now use the same mechanisms.  I'll 
> attach when I've cleaned it up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to