You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2012/05/02 00:24:53 UTC
[jira] [Created] (CXF-4281) uribuilder from null?
Romain Manni-Bucau created CXF-4281:
---------------------------------------
Summary: uribuilder from null?
Key: CXF-4281
URL: https://issues.apache.org/jira/browse/CXF-4281
Project: CXF
Issue Type: Bug
Reporter: Romain Manni-Bucau
in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13267556#comment-13267556 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
I've committed the test, see:
http://svn.apache.org/viewvc?rev=1333527&view=rev
What is different in your case ?
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268355#comment-13268355 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
doesnt work with jersey too for me
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266642#comment-13266642 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
well i have not the test right now (will try to have a look a bit later) but this exception is fine.
using some allowed combination (calling fromPath(null)) you'll get an uri looking to http:/foo:12434/bar instead of http://...
that's was the issue (and why we patched the builder this way).
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266652#comment-13266652 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
OK, please help with reproducing the issues and we'll get the fixes applied asap
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Beryozkin resolved CXF-4281.
-----------------------------------
Resolution: Not A Problem
Assignee: Sergey Beryozkin
Hi Romain, we are preparing for 2.6.1 so I'm closing it as Not A problem for now, given UriBuilder implementation is consistent with the RI one. Please feel free to reopen if you can get some confirmation proving otherwise. Would also appreciate if you can update whenever you get a chance in what you have found with respect to setting a schema component to null. cheers
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
> Assignee: Sergey Beryozkin
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13267886#comment-13267886 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
yep i didn't reproduce it too, maybe a contextual issue?
now i have the following:
UriBuilder.fromUri("http://foo:1234").scheme(null).build().getRawSchemeSpecificPart() != null
i'll dig further
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268694#comment-13268694 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
Hi, I think
> UriBuilder.fromPath(null) doesn't throw any exception. It should throw a IllegalArgumentException, no?
Yes - which actually highlights the problem with the API implementation that you use, recall you mentioning
URIBuilder.fromPath() calls replacePath() [1] on the newly created UriBuilder, where supplying 'null' is perfectly valid.
Effectively we are talking about the API in question breaking the 'negative' part of the UriBuilder.fromPath contract
[1] http://docs.oracle.com/javaee/6/api/javax/ws/rs/core/UriBuilder.html#replacePath%28java.lang.String%29
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268779#comment-13268779 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
opened GERONIMO-6344
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268232#comment-13268232 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
I think it should produce a getRawSchemeSpecificPart() == null
@Test
public void testFromEncodedDuplicateVar3() {
String expected = "http://localhost:8080/1/2/3/1";
URI uri = UriBuilder.fromPath("http://localhost:8080")
.path("/{a}/{b}/{c}/{a}")
.buildFromEncoded("1", "2", "3");
assertEquals(expected, uri.toString());
}
doesn't pass for me. I'm using the snapshot.
i'm on irc (rmb/rmannibucau) if you want
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266822#comment-13266822 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
managed to reproduce the issue simply doing it:
System.out.println(UriBuilder.fromPath("http://localhost:8080").build());
it got me: "http:/localhost:8080"
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13267904#comment-13267904 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
here what i get doing it:
UriBuilder.fromPath("http://localhost:8080").path("/{a}/{b}/{c}/{a}").
buildFromEncoded("1", "2", "3")
in org.apache.cxf.jaxrs.impl.UriBuilderImpl#buildPath i get the following paths:
http:, localhost:8080, {a} ....(then expected ones)
so then with the current algorithm it adds only one '/' after http:
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268497#comment-13268497 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
just tried the trunk
it is really better but i got one issue: UriBuilder.fromPath(null) doesn't throw any exception. It should throw a IllegalArgumentException, no?
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Glen Mazza (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268265#comment-13268265 ]
Glen Mazza commented on CXF-4281:
---------------------------------
Testing with Jersey 1.12:
testing: System.out.println(UriBuilder.fromUri("http://foo:1234").scheme(null).build().toString())"
returns //foo:1234
testing: System.out.println(UriBuilder.fromPath("").replacePath("http://localhost:8080").path("/{a}/{b}/{c}/{a}").buildFromEncoded("1", "2", "3").toString());
returns http://localhost:8080/1/2/3/1
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268249#comment-13268249 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
Lets see how CXF 2.5.x build reacts to http://svn.apache.org/viewvc?rev=1333860&view=rev :-)
As for the 'UriBuilder.fromUri("http://foo:1234").scheme(null).build().getRawSchemeSpecificPart() != null', I think that setting the scheme to 'null' should only affect the 'http' part from the original URI which would leave the scheme specific part as 'foo:1234'.
Write now I can see CXF printing "//localhost:8080" in this case which is useless. I think the right outcome should be either "http://foo:1234" where UriBuilder detects that scheme specific part is set but the actual scheme is not and thus defaults to 'http' or throw IllegalArgumentException at scheme(null)
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266640#comment-13266640 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
This test passes for me locally:
{code:java}
@Test(expected = IllegalArgumentException.class)
public void testFromNullPath() {
UriBuilder.fromPath(null);
fail();
}
{code}
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268219#comment-13268219 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
The following test works for me locally, we have few of tests like this one:
{code:java}
@Test
public void testFromEncodedDuplicateVar3() {
String expected = "http://localhost:8080/1/2/3/1";
URI uri = UriBuilder.fromPath("http://localhost:8080")
.path("/{a}/{b}/{c}/{a}")
.buildFromEncoded("1", "2", "3");
assertEquals(expected, uri.toString());
}
{code}
Can you get a breakpoint inside UriBuilderImpl.doPath(...) ? You should hit a block specifically checking if a given path represents a URI and if yes then it gelegates to a uri handler. May be also ping me on IRC ?
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268339#comment-13268339 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
UriBuilder.replacePath now delegates to the uri handler when it sees absolute http uris
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271281#comment-13271281 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
Romain, please also watch http://java.net/jira/browse/JAX_RS_SPEC-194
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268777#comment-13268777 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
i'll open a geronimo jira
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268284#comment-13268284 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
Romain - it would return the same value you see with CXF given that UriBuilder.build produces URI
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268226#comment-13268226 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
> UriBuilder.fromUri("http://foo:1234").scheme(null).build().getRawSchemeSpecificPart() != null
I don't even know what that is supposed to produce, but UriBuilder does allow it.
I can imagine using UriBuilder.scheme() in combination with UriBuilder.schemeSpecificPart, when building a uri from scratch.
What do you think
UriBuilder.fromUri("http://foo:1234").scheme(null).build()
should produce ? I'd consider throwing IllegalArgumentException in cases where the scheme and schemeSpecificParts have already been initialized from the existing URI
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Glen Mazza (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268298#comment-13268298 ]
Glen Mazza commented on CXF-4281:
---------------------------------
Romain, to do your own testing on Jersey, very simple, just download the Jersey samples (http://maven.java.net/service/local/artifact/maven/redirect?r=releases&g=com.sun.jersey.samples&a=jersey-samples&v=1.12&e=zip&c=project), navigate to the helloworld sample and alter its Main.getBaseURI() method adding in a System.out.println(UriBuilder...whatever you want.toString()) and then run mvn compile exec:java from that sample (as stated in its README). You'll see the results from a terminal window.
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266622#comment-13266622 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
What exactly is happening in this case ?
According to
http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/UriBuilder.html#fromPath(java.lang.String)
"java.lang.IllegalArgumentException - if path is null"
Do you not see this exception ?
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13270484#comment-13270484 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
Hi Romain, ping me please on IRC/email re the info on how to deal with the schema(null) issue
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268272#comment-13268272 ]
Romain Manni-Bucau commented on CXF-4281:
-----------------------------------------
@Glen what does return jersey for uri.getRawSchemeSpecificPart() when scheme(null) was called?
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268249#comment-13268249 ]
Sergey Beryozkin edited comment on CXF-4281 at 5/4/12 10:36 AM:
----------------------------------------------------------------
Lets see how CXF 2.5.x build reacts to http://svn.apache.org/viewvc?rev=1333860&view=rev :-)
As for the 'UriBuilder.fromUri("http://foo:1234").scheme(null).build().getRawSchemeSpecificPart() != null', I think that setting the scheme to 'null' should only affect the 'http' part from the original URI which would leave the scheme specific part as 'foo:1234'.
Right now I can see CXF printing "//localhost:8080" in this case which is useless. I think the right outcome should be either "http://foo:1234" where UriBuilder detects that scheme specific part is set but the actual scheme is not and thus defaults to 'http' or throw IllegalArgumentException at scheme(null)
was (Author: sergey_beryozkin):
Lets see how CXF 2.5.x build reacts to http://svn.apache.org/viewvc?rev=1333860&view=rev :-)
As for the 'UriBuilder.fromUri("http://foo:1234").scheme(null).build().getRawSchemeSpecificPart() != null', I think that setting the scheme to 'null' should only affect the 'http' part from the original URI which would leave the scheme specific part as 'foo:1234'.
Write now I can see CXF printing "//localhost:8080" in this case which is useless. I think the right outcome should be either "http://foo:1234" where UriBuilder detects that scheme specific part is set but the actual scheme is not and thus defaults to 'http' or throw IllegalArgumentException at scheme(null)
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-4281) uribuilder from null?
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268268#comment-13268268 ]
Sergey Beryozkin commented on CXF-4281:
---------------------------------------
Hi Glen, thanks for the help, next time I'll run Jersey tests myself :-)
So, the way Jersey manages scheme(null) is consistent with the way CXF does it so I guess we can not worry about it.
Minor update to the way CXF handles UriBuilder.replacePath when the http based URIs are provided is on the way
> uribuilder from null?
> ---------------------
>
> Key: CXF-4281
> URL: https://issues.apache.org/jira/browse/CXF-4281
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
>
> in tomee/openejb we need to patch the uri builder to be able to satisfied some cases (UriBuilder.fromPath(null) for instance)
> here is the patched builder working for us: http://svn.apache.org/repos/asf/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/OpenEJBRuntimeDelegateImpl.java
> any way to get it merged with cxf?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira