You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Phil Housley (JIRA)" <de...@tuscany.apache.org> on 2009/02/26 15:05:01 UTC

[jira] Created: (TUSCANY-2882) Relative path imports don't work in Spring implementations.

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.


[jira] Updated: (TUSCANY-2882) Relative path imports don't work in Spring implementations.

Posted by "Phil Housley (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2882?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Housley updated TUSCANY-2882:
----------------------------------

    Attachment: tuscany-spring-url.zip

Test case of various different spring configurations.  This file is a zipped maven project (and eclipse project files) for a web application, using tuscany filter.

The aim is to load a composite called "One", which loads a Spring context from a beans file in the war, which imports a further beans file from inside a jar in the lib folder.  End result should be the output "TestBean()" as a spring bean is created.

The example will work if you change the compositeContext-One.xml file to import a relative path, as per the comment in the file.

For comparison, the commented out section in One.composite will trigger programatic starting of the spring context using ClassPathXmlApplicationContext, rather than using implementation.spring.

Please let me know if this could be clearer.

> 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.5
>            Reporter: Phil Housley
>         Attachments: tuscany-spring-url.zip
>
>
> 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.


[jira] Updated: (TUSCANY-2882) Relative path imports don't work in Spring implementations.

Posted by "Phil Housley (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2882?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Housley updated TUSCANY-2882:
----------------------------------

    Affects Version/s:     (was: Java-SCA-1.4)
                       Java-SCA-1.5

> 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.5
>            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.


[jira] Commented: (TUSCANY-2882) Relative path imports don't work in Spring implementations.

Posted by "ant elder (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793164#action_12793164 ] 

ant elder commented on TUSCANY-2882:
------------------------------------

As far as I can see the SCA Spring spec doesnt say how imports should work so it seems reasonable to have them work the same as native spring does them. If you're saying thats not the case and Tuscany uses absolute paths them that sounds like a bug to me (unless theres something in the spec ive missed). Would you be able to attach a testcase demonstrating the issue to this JIRA? It would be good to make sure the OASIS spec is clear about how this should work.


> 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.5
>            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.


[jira] Commented: (TUSCANY-2882) Relative path imports don't work in Spring implementations.

Posted by "Phil Housley (JIRA)" <de...@tuscany.apache.org>.
    [ 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.