You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Jose Luis Alba (JIRA)" <ji...@apache.org> on 2007/12/21 13:54:43 UTC

[jira] Created: (SYNAPSE-207) Support classpath resources in registry entries

Support classpath resources in registry entries
-----------------------------------------------

                 Key: SYNAPSE-207
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-207
             Project: Synapse
          Issue Type: Improvement
          Components: Core
    Affects Versions: 1.1
            Reporter: Jose Luis Alba
            Priority: Minor
             Fix For: 1.1


When defining a localEntry the src attribute specifies a URL resource. It would be useful to load the resources from classpath using something like (spring) src="classpath:someFile.xml".


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


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


[jira] Commented: (SYNAPSE-207) Support classpath resources in registry entries

Posted by "Jose Luis Alba (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556501#action_12556501 ] 

Jose Luis Alba commented on SYNAPSE-207:
----------------------------------------

Asankha, I'm using the war distribution of Synapse. :(

> Support classpath resources in registry entries
> -----------------------------------------------
>
>                 Key: SYNAPSE-207
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-207
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1
>            Reporter: Jose Luis Alba
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> When defining a localEntry the src attribute specifies a URL resource. It would be useful to load the resources from classpath using something like (spring) src="classpath:someFile.xml".

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


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


[jira] Commented: (SYNAPSE-207) Support classpath resources in registry entries

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556374#action_12556374 ] 

Andreas Veithen commented on SYNAPSE-207:
-----------------------------------------

I completely agree that this is better than nothing. I just posted my comment to make people aware of the fact that it doesn't work in all deployment scenarios.

In the OSGi platform they have the same problem and they partially solved it, but I don't think their hack works properly in a servlet container. The URLStreamHandlerFactory solution has one big advantage, which is that it is completely transparent, i.e. there is no need to modify code and it also works with third party libraries. What is interesting to see is that in the Spring framework they don't use it, probably because they came to the conclusion that it doesn't work in a servlet container. A long term solution for Synapse could be to integrate the Spring resource framework. What do you think?

> Support classpath resources in registry entries
> -----------------------------------------------
>
>                 Key: SYNAPSE-207
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-207
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1
>            Reporter: Jose Luis Alba
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> When defining a localEntry the src attribute specifies a URL resource. It would be useful to load the resources from classpath using something like (spring) src="classpath:someFile.xml".

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


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


[jira] Commented: (SYNAPSE-207) Support classpath resources in registry entries

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556375#action_12556375 ] 

Asankha C. Perera commented on SYNAPSE-207:
-------------------------------------------

I agree that integrating with the Spring framework would be a better solution.. which reminds me, we need to properly fix the Spring libraries we depend on :) .. Do you know what it takes to re-use the classpath handler from Spring? i.e. if its a trivial fix I would rather do it right now..

> Support classpath resources in registry entries
> -----------------------------------------------
>
>                 Key: SYNAPSE-207
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-207
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1
>            Reporter: Jose Luis Alba
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> When defining a localEntry the src attribute specifies a URL resource. It would be useful to load the resources from classpath using something like (spring) src="classpath:someFile.xml".

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


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


[jira] Commented: (SYNAPSE-207) Support classpath resources in registry entries

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556366#action_12556366 ] 

Asankha C. Perera commented on SYNAPSE-207:
-------------------------------------------

Yep.. since this was asked as an improvement by a user, I thought something would be better than nothing for right now...I was reading through this -> http://unicon.net/node/776.. so this comes with limitations.. 

Jose, are you using the standalone version of Synapse?

> Support classpath resources in registry entries
> -----------------------------------------------
>
>                 Key: SYNAPSE-207
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-207
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1
>            Reporter: Jose Luis Alba
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> When defining a localEntry the src attribute specifies a URL resource. It would be useful to load the resources from classpath using something like (spring) src="classpath:someFile.xml".

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


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


[jira] Updated: (SYNAPSE-207) Support classpath resources in registry entries

Posted by "Jose Luis Alba (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jose Luis Alba updated SYNAPSE-207:
-----------------------------------

    Fix Version/s:     (was: 1.1)

> Support classpath resources in registry entries
> -----------------------------------------------
>
>                 Key: SYNAPSE-207
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-207
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1
>            Reporter: Jose Luis Alba
>            Priority: Minor
>
> When defining a localEntry the src attribute specifies a URL resource. It would be useful to load the resources from classpath using something like (spring) src="classpath:someFile.xml".

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


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


[jira] Commented: (SYNAPSE-207) Support classpath resources in registry entries

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556260#action_12556260 ] 

Andreas Veithen commented on SYNAPSE-207:
-----------------------------------------

The fix based on URL.setURLStreamHandlerFactory does not work when Synapse is deployed as a WAR. Indeed, URL.setURLStreamHandlerFactory can only be called once per VM and it will be called already by the servlet container.

> Support classpath resources in registry entries
> -----------------------------------------------
>
>                 Key: SYNAPSE-207
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-207
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1
>            Reporter: Jose Luis Alba
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> When defining a localEntry the src attribute specifies a URL resource. It would be useful to load the resources from classpath using something like (spring) src="classpath:someFile.xml".

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


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


[jira] Commented: (SYNAPSE-207) Support classpath resources in registry entries

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556396#action_12556396 ] 

Andreas Veithen commented on SYNAPSE-207:
-----------------------------------------

The Spring framework defines a ResourceLoader interface as a replacement for the URLStreamHandlerFactory mechanism. The DefaultResourceLoader handles standard URLs (those supported by the JRE) as well as classpath: URLs. There are also implementations that support servlet context resources properly.

Note that in my comment above I said that "The URLStreamHandlerFactory solution has one big advantage, which is that it is completely transparent, i.e. there is no need to modify code and it also works with third party libraries." The blog article you cite also says something along those lines. However this is actually incorrect. The reason is that you can always translate a classpath: URL into a URL supported by the JRE (either jar: or file: in the standalone case or jndi: in the servlet container case).

Actually the modifications required to support this in Synapse would be:
* In the initialization code (ServerManager?) create an appropriate ResourceLoader instance.
* In the code that parses the configuration (and only there, but except endpoint URLs obviously), all expressions that create URL objects from Strings should be replaced by a call to ResourceLoader#getResource#getURL. This will produce a standard URL to access the resource.

The only thing still to investigate is what will happen in the code that serializes the Synapse configuration to XML.

> Support classpath resources in registry entries
> -----------------------------------------------
>
>                 Key: SYNAPSE-207
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-207
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1
>            Reporter: Jose Luis Alba
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> When defining a localEntry the src attribute specifies a URL resource. It would be useful to load the resources from classpath using something like (spring) src="classpath:someFile.xml".

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


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


[jira] Resolved: (SYNAPSE-207) Support classpath resources in registry entries

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asankha C. Perera resolved SYNAPSE-207.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.1
         Assignee: Asankha C. Perera

fixed

> Support classpath resources in registry entries
> -----------------------------------------------
>
>                 Key: SYNAPSE-207
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-207
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1
>            Reporter: Jose Luis Alba
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> When defining a localEntry the src attribute specifies a URL resource. It would be useful to load the resources from classpath using something like (spring) src="classpath:someFile.xml".

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


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org