You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Derek Shaw (JIRA)" <ji...@apache.org> on 2007/07/16 22:15:04 UTC
[jira] Created: (CXF-800) Resouce matching in jra seems incorrect
Resouce matching in jra seems incorrect
---------------------------------------
Key: CXF-800
URL: https://issues.apache.org/jira/browse/CXF-800
Project: CXF
Issue Type: Bug
Components: Core
Affects Versions: 2.0
Environment: Windows XP, Java 1.5
Reporter: Derek Shaw
For me, this resource
@Get
@HttpResource(location = "/player/most/comments/{maxCount}")
@WebResult(name = "PlayerList")
public List<Integer> getMostCommented(@WebParam(name = "maxCount") int maxCount);
Is matching this resource
@Get
@HttpResource(location = "/player/{ID}")
@WebResult(name = "Player")
public Player getPlayer(@WebParam(name = "ID") int ID) throws PlayerNotFoundFault;
The reason is that in ResourceUtil.java on line 38
if (i == resource.length()) {
// if } is the last part of the resource, assume the
// rest of the request uri matches
return reqUri.length();
}
This seems incorrect to me ( could easily be wrong here ) seem like since you are assuming '}' to be the end, then you should return resource.length() and not the request lenght.
Later when the correct resource ( the one that matches reqUri) is sent in, we already have a bestMatch = reqUri.lenth and the the check in URIMapper.java at line 46 does a > test so does not use the correct match.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (CXF-800) Resouce matching in jra seems incorrect
Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Diephouse closed CXF-800.
-----------------------------
Resolution: Fixed
Fix Version/s: 2.0.1
Hi Derek, I fixed this and have published a new JRA snapshot: http://snapshots.repository.codehaus.org/org/codehaus/jra/jra/1.0-alpha-4-SNAPSHOT/jra-1.0-alpha-4-20070725.215950-1.jar.
Just replace the jra-1.0-alpha-3.jar on your classpath with the above one and it should work fine. I'll do another JRA release once I've heard back from you and before our 2.0.1 release. Thanks!
> Resouce matching in jra seems incorrect
> ---------------------------------------
>
> Key: CXF-800
> URL: https://issues.apache.org/jira/browse/CXF-800
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0
> Environment: Windows XP, Java 1.5
> Reporter: Derek Shaw
> Assignee: Dan Diephouse
> Fix For: 2.0.1
>
>
> For me, this resource
> @Get
> @HttpResource(location = "/player/most/comments/{maxCount}")
> @WebResult(name = "PlayerList")
> public List<Integer> getMostCommented(@WebParam(name = "maxCount") int maxCount);
> Is matching this resource
> @Get
> @HttpResource(location = "/player/{ID}")
> @WebResult(name = "Player")
> public Player getPlayer(@WebParam(name = "ID") int ID) throws PlayerNotFoundFault;
> The reason is that in ResourceUtil.java on line 38
> if (i == resource.length()) {
> // if } is the last part of the resource, assume the
> // rest of the request uri matches
> return reqUri.length();
> }
> This seems incorrect to me ( could easily be wrong here ) seem like since you are assuming '}' to be the end, then you should return resource.length() and not the request lenght.
> Later when the correct resource ( the one that matches reqUri) is sent in, we already have a bestMatch = reqUri.lenth and the the check in URIMapper.java at line 46 does a > test so does not use the correct match.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-800) Resouce matching in jra seems incorrect
Posted by "Derek Shaw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515722 ]
Derek Shaw commented on CXF-800:
--------------------------------
I have verified the fix on my end as well. Wonderful !
> Resouce matching in jra seems incorrect
> ---------------------------------------
>
> Key: CXF-800
> URL: https://issues.apache.org/jira/browse/CXF-800
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0
> Environment: Windows XP, Java 1.5
> Reporter: Derek Shaw
> Assignee: Dan Diephouse
> Fix For: 2.0.1
>
>
> For me, this resource
> @Get
> @HttpResource(location = "/player/most/comments/{maxCount}")
> @WebResult(name = "PlayerList")
> public List<Integer> getMostCommented(@WebParam(name = "maxCount") int maxCount);
> Is matching this resource
> @Get
> @HttpResource(location = "/player/{ID}")
> @WebResult(name = "Player")
> public Player getPlayer(@WebParam(name = "ID") int ID) throws PlayerNotFoundFault;
> The reason is that in ResourceUtil.java on line 38
> if (i == resource.length()) {
> // if } is the last part of the resource, assume the
> // rest of the request uri matches
> return reqUri.length();
> }
> This seems incorrect to me ( could easily be wrong here ) seem like since you are assuming '}' to be the end, then you should return resource.length() and not the request lenght.
> Later when the correct resource ( the one that matches reqUri) is sent in, we already have a bestMatch = reqUri.lenth and the the check in URIMapper.java at line 46 does a > test so does not use the correct match.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (CXF-800) Resouce matching in jra seems incorrect
Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Diephouse reassigned CXF-800:
---------------------------------
Assignee: Dan Diephouse
> Resouce matching in jra seems incorrect
> ---------------------------------------
>
> Key: CXF-800
> URL: https://issues.apache.org/jira/browse/CXF-800
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0
> Environment: Windows XP, Java 1.5
> Reporter: Derek Shaw
> Assignee: Dan Diephouse
>
> For me, this resource
> @Get
> @HttpResource(location = "/player/most/comments/{maxCount}")
> @WebResult(name = "PlayerList")
> public List<Integer> getMostCommented(@WebParam(name = "maxCount") int maxCount);
> Is matching this resource
> @Get
> @HttpResource(location = "/player/{ID}")
> @WebResult(name = "Player")
> public Player getPlayer(@WebParam(name = "ID") int ID) throws PlayerNotFoundFault;
> The reason is that in ResourceUtil.java on line 38
> if (i == resource.length()) {
> // if } is the last part of the resource, assume the
> // rest of the request uri matches
> return reqUri.length();
> }
> This seems incorrect to me ( could easily be wrong here ) seem like since you are assuming '}' to be the end, then you should return resource.length() and not the request lenght.
> Later when the correct resource ( the one that matches reqUri) is sent in, we already have a bestMatch = reqUri.lenth and the the check in URIMapper.java at line 46 does a > test so does not use the correct match.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-800) Resouce matching in jra seems incorrect
Posted by "Derek Shaw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515307 ]
Derek Shaw commented on CXF-800:
--------------------------------
Not surprising, i did not spend that much time digging into the issue, as I have a project I am trying to ship at the moment :) Please let me know if there is anything I can do to help, provide more use cases, etc. thanks.
> Resouce matching in jra seems incorrect
> ---------------------------------------
>
> Key: CXF-800
> URL: https://issues.apache.org/jira/browse/CXF-800
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0
> Environment: Windows XP, Java 1.5
> Reporter: Derek Shaw
> Assignee: Dan Diephouse
>
> For me, this resource
> @Get
> @HttpResource(location = "/player/most/comments/{maxCount}")
> @WebResult(name = "PlayerList")
> public List<Integer> getMostCommented(@WebParam(name = "maxCount") int maxCount);
> Is matching this resource
> @Get
> @HttpResource(location = "/player/{ID}")
> @WebResult(name = "Player")
> public Player getPlayer(@WebParam(name = "ID") int ID) throws PlayerNotFoundFault;
> The reason is that in ResourceUtil.java on line 38
> if (i == resource.length()) {
> // if } is the last part of the resource, assume the
> // rest of the request uri matches
> return reqUri.length();
> }
> This seems incorrect to me ( could easily be wrong here ) seem like since you are assuming '}' to be the end, then you should return resource.length() and not the request lenght.
> Later when the correct resource ( the one that matches reqUri) is sent in, we already have a bestMatch = reqUri.lenth and the the check in URIMapper.java at line 46 does a > test so does not use the correct match.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-800) Resouce matching in jra seems incorrect
Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515291 ]
Dan Diephouse commented on CXF-800:
-----------------------------------
Just an update: I've take a look into this. unfortunately your proposed fix doesn't solve things. I am still working on a fix though and will keep you posted when one is available.
> Resouce matching in jra seems incorrect
> ---------------------------------------
>
> Key: CXF-800
> URL: https://issues.apache.org/jira/browse/CXF-800
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0
> Environment: Windows XP, Java 1.5
> Reporter: Derek Shaw
> Assignee: Dan Diephouse
>
> For me, this resource
> @Get
> @HttpResource(location = "/player/most/comments/{maxCount}")
> @WebResult(name = "PlayerList")
> public List<Integer> getMostCommented(@WebParam(name = "maxCount") int maxCount);
> Is matching this resource
> @Get
> @HttpResource(location = "/player/{ID}")
> @WebResult(name = "Player")
> public Player getPlayer(@WebParam(name = "ID") int ID) throws PlayerNotFoundFault;
> The reason is that in ResourceUtil.java on line 38
> if (i == resource.length()) {
> // if } is the last part of the resource, assume the
> // rest of the request uri matches
> return reqUri.length();
> }
> This seems incorrect to me ( could easily be wrong here ) seem like since you are assuming '}' to be the end, then you should return resource.length() and not the request lenght.
> Later when the correct resource ( the one that matches reqUri) is sent in, we already have a bestMatch = reqUri.lenth and the the check in URIMapper.java at line 46 does a > test so does not use the correct match.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.