You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Benson Margulies (Created) (JIRA)" <ji...@apache.org> on 2011/12/20 14:03:31 UTC

[jira] [Created] (CXF-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

incompatible change in JAX-RS from 2.5.0 to 2.5.1
-------------------------------------------------

                 Key: CXF-3987
                 URL: https://issues.apache.org/jira/browse/CXF-3987
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.5.1
            Reporter: Benson Margulies


One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.

My function looks like:

{code}

    @Produces("text/html")
    @Consumes("multipart/form-data")
    @Path("/processFormTextToJson")
    @Descriptions({ 
        @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
        @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
     })
    public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
                                          @Multipart(value = "options") String optionsString,
                                          @Description(value = "Input text", target = DocTarget.PARAM)
                                          @Multipart(value = "data") InputStream data) {
{code}

and the code leading to the exception in CXF is:

{code}

 public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
                                                Annotation[] anns,
                                                MultipartBody body, 
                                                boolean decode) {
 

       List<Attachment> atts = body.getAllAttachments();
        for (Attachment a : atts) {
            ContentDisposition cd = a.getContentDisposition();
            if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
                || cd.getParameter("name") == null) {
                Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
                
                if (id == null || id.required()) {
                    throw new WebApplicationException(400);
                } else {
                    return;
                }
            }

{code}


--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Sergey Beryozkin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173180#comment-13173180 ] 

Sergey Beryozkin commented on CXF-3987:
---------------------------------------

In 2.5.0 it was:

{code:java}
if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
                || cd.getParameter("name") == null) {
                throw new WebApplicationException(415);
            }
{code}
in 2.5.1:
{code:java}
if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
                || cd.getParameter("name") == null) {
                Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
                
                if (id == null || id.required()) {
                    throw new WebApplicationException(400);
                } else {
                    return;
                }
            }
{code}

It is actually less strict in 2.5.1 as we give users a chance to state that a given part is not required to be present
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173262#comment-13173262 ] 

Benson Margulies commented on CXF-3987:
---------------------------------------

Now I think I've lost my mind. I added content-disposition to the attachments, and it does not show up in the log message from the in-interceptor on the service side.
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Sergey Beryozkin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173589#comment-13173589 ] 

Sergey Beryozkin commented on CXF-3987:
---------------------------------------

Benson, I removed some of the code which made it into 2.5.1 to minimize the confusion but either way I think it's Not A Problem issue. When we have multipart/form-data payloads, we do expect Content-Disposition with the "form-data" type; if we relax it then we can capture by mistake the data meant to be processed by MultipartProvider.

If you disagree then let me know please what do you think can be improved 
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Sergey Beryozkin (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173991#comment-13173991 ] 

Sergey Beryozkin edited comment on CXF-3987 at 12/21/11 10:23 AM:
------------------------------------------------------------------

By the way, I updated that FormUtils code to check Content-Id in case of missing Content-Dispositions - which should let your old code continue working without having to add CDs; can we close this JIRA as Duplicate of 3988 and chat about possible Attachment enghancements in JIRA-3988 ?
                
      was (Author: sergey_beryozkin):
    By the way, I updated that FormUtils code to check Content-Id in case of missing Content-Dispositions - which should you old code working without having to add CDs; can we close this JIRA as Duplicate of 3988 and chat about possible Attachment enghancements in JIRA-3988 ?
                  
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Sergey Beryozkin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173989#comment-13173989 ] 

Sergey Beryozkin commented on CXF-3987:
---------------------------------------

May be I don't understand something, what is wrong with this code which you used:
{code:java}
MetadataMap<String, String> headers = new MetadataMap<String, String>(false, true);
        headers.putSingle("Content-ID", id);
        headers.putSingle("Content-Type", mediaType);
        headers.putSingle("Content-Disposition", String.format("form-data; name=\"%s\"", id));
        return new Attachment(new ByteArrayInputStream(baos.toByteArray()), headers);
{code}

This code produces a self-contained part with headers and the data.
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173244#comment-13173244 ] 

Benson Margulies commented on CXF-3987:
---------------------------------------

In 2.5.0, the wire data looks rather similar, so the mystery is, why is the ContentDisposition reference null?
{noformat}
ID: 6
Address: http://localhost:51102/r4dws/services/doc/processFormTextToJson
Encoding: ISO-8859-1
Http-Method: POST
Content-Type: multipart/form-data; type="application/json"; boundary="uuid:22187f34-ab19-411a-b13e-5af4486ef93c"; start="<options>"; start-info="application/json"
Headers: {Accept=[text/html], cache-control=[no-cache], connection=[keep-alive], content-type=[multipart/form-data; type="application/json"; boundary="uuid:22187f34-ab19-411a-b13e-5af4486ef93c"; start="<options>"; start-info="application/json"], host=[localhost:51102], pragma=[no-cache], transfer-encoding=[chunked], user-agent=[Apache CXF 2.5.0]}
Payload: ^M
--uuid:22187f34-ab19-411a-b13e-5af4486ef93c^M
Content-Type: application/json^M
Content-Transfer-Encoding: binary^M
Content-ID: <options>^M
^M
{"languageDetection":{"language":"UNKNOWN","strategy":"MULTIPLE"},"text":null}^M
--uuid:22187f34-ab19-411a-b13e-5af4486ef93c^M
Content-Type: application/octet-stream^M
Content-Transfer-Encoding: binary^M
Content-ID: <data>
{noformat}
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13174056#comment-13174056 ] 

Benson Margulies commented on CXF-3987:
---------------------------------------

Yes.
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Sergey Beryozkin (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-3987.
-----------------------------------

    Resolution: Duplicate

Duplicate of https://issues.apache.org/jira/browse/CXF-3988
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Sergey Beryozkin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173174#comment-13173174 ] 

Sergey Beryozkin commented on CXF-3987:
---------------------------------------

Hi Benson

How did it work before ?
@Multipart in case of form-data just points to an expected Content-Disposition's name parameter.

Can you show the sample payload please ?
Sergey
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Sergey Beryozkin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173991#comment-13173991 ] 

Sergey Beryozkin commented on CXF-3987:
---------------------------------------

By the way, I updated that FormUtils code to check Content-Id in case of missing Content-Dispositions - which should you old code working without having to add CDs; can we close this JIRA as Duplicate of 3988 and chat about possible Attachment enghancements in JIRA-3988 ?
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173288#comment-13173288 ] 

Benson Margulies commented on CXF-3987:
---------------------------------------

Here's the function I wrote to work around this:

{code}
    private Attachment makeBrowerLikeAttachment(String id, String mediaType, Object data) throws IOException {
        JsonFactory factory = new MappingJsonFactory();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        JsonGenerator gen = factory.createJsonGenerator(baos);
        gen.writeObject(data);
        gen.flush();
        MetadataMap<String, String> headers = new MetadataMap<String, String>(false, true);
        headers.putSingle("Content-ID", id);
        headers.putSingle("Content-Type", mediaType);
        headers.putSingle("Content-Disposition", String.format("form-data; name=\"%s\"", id));
        return new Attachment(new ByteArrayInputStream(baos.toByteArray()), headers);
    }
{code}
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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] [Updated] (CXF-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benson Margulies updated CXF-3987:
----------------------------------

    Description: 
One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.

My function looks like:

{code}

    @Produces("text/html")
    @Consumes("multipart/form-data")
    @Path("/processFormTextToJson")
    @Descriptions({ 
        @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
        @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
     })
    public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
                                          @Multipart(value = "options") String optionsString,
                                          @Description(value = "Input text", target = DocTarget.PARAM)
                                          @Multipart(value = "data") InputStream data) {
{code}

and the code leading to the exception in CXF is:

{code}

 public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
                                                Annotation[] anns,
                                                MultipartBody body, 
                                                boolean decode) {
 

       List<Attachment> atts = body.getAllAttachments();
        for (Attachment a : atts) {
            ContentDisposition cd = a.getContentDisposition();
            if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
                || cd.getParameter("name") == null) {
                Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
                
                if (id == null || id.required()) {
                    throw new WebApplicationException(400);
                } else {
                    return;
                }
            }

{code}

The annotations present are:

{noformat}
[@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
{noformat}

Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?


  was:
One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.

My function looks like:

{code}

    @Produces("text/html")
    @Consumes("multipart/form-data")
    @Path("/processFormTextToJson")
    @Descriptions({ 
        @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
        @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
     })
    public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
                                          @Multipart(value = "options") String optionsString,
                                          @Description(value = "Input text", target = DocTarget.PARAM)
                                          @Multipart(value = "data") InputStream data) {
{code}

and the code leading to the exception in CXF is:

{code}

 public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
                                                Annotation[] anns,
                                                MultipartBody body, 
                                                boolean decode) {
 

       List<Attachment> atts = body.getAllAttachments();
        for (Attachment a : atts) {
            ContentDisposition cd = a.getContentDisposition();
            if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
                || cd.getParameter("name") == null) {
                Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
                
                if (id == null || id.required()) {
                    throw new WebApplicationException(400);
                } else {
                    return;
                }
            }

{code}


    
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173280#comment-13173280 ] 

Benson Margulies commented on CXF-3987:
---------------------------------------

OK, I see one thing. You can't add a header to an Attachment once you make it. Another jira, coming up.

                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173239#comment-13173239 ] 

Benson Margulies commented on CXF-3987:
---------------------------------------

WebClient code that produced this ...

{code}
 List<Attachment> atts = new LinkedList<Attachment>();
 atts.add(new Attachment("options", "application/json", ptio));
 atts.add(new Attachment("data", "application/octet-stream", FileUtils
 readFileToByteArray(new File(btRoot, "rlp/samples/data/Spanish-French-German.txt"))));
{code}
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Sergey Beryozkin (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173991#comment-13173991 ] 

Sergey Beryozkin edited comment on CXF-3987 at 12/21/11 10:23 AM:
------------------------------------------------------------------

By the way, I updated that FormUtils code to check Content-Id in case of missing Content-Dispositions - which should let your old code continue working without having to add CDs; can we close this JIRA as Duplicate of 3988 and chat about possible Attachment enhancements in JIRA-3988 ?
                
      was (Author: sergey_beryozkin):
    By the way, I updated that FormUtils code to check Content-Id in case of missing Content-Dispositions - which should let your old code continue working without having to add CDs; can we close this JIRA as Duplicate of 3988 and chat about possible Attachment enghancements in JIRA-3988 ?
                  
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173237#comment-13173237 ] 

Benson Margulies commented on CXF-3987:
---------------------------------------

No content disposition? start= instead?
{noformat}
----------------------------
ID: 1
Address: http://localhost:15000/r4dws/services/doc/processFormTextToJson
Encoding: ISO-8859-1
Http-Method: POST
Content-Type: multipart/form-data; type="application/json"; boundary="uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e"; start="<options>"; start-info="application/json"
Headers: {Accept=[text/html], cache-control=[no-cache], connection=[keep-alive], content-type=[multipart/form-data; type="application/json"; boundary="uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e"; start="<options>"; start-info="application/json"], host=[localhost:15000], pragma=[no-cache], transfer-encoding=[chunked], user-agent=[Apache CXF 2.5.1]}
Payload: 
--uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e
Content-Type: application/json
Content-Transfer-Encoding: binary
Content-ID: <options>

{"languageDetection":{"language":"UNKNOWN","strategy":"MULTIPLE"},"text":null}
--uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <data>

1 de junio de 2003, 18h01

Bush y Chirac sonríen para las cámaras en tensa cumbre del G-8


EVIAN, Francia (Reuters) - Los presidentes George W. Bush y Jacques Chirac sonrieron el domingo para las cámaras al inicio de una cumbre del Grupo de los Ocho eclipsada por el enfrentamiento franco-estadounidense por la guerra de Irak y la inquietud sobre los próximos movimientos de Washington.


Bush recibió un corto apretón de manos y una sonrisa agarrotada de su crítico más duro a su llegada a Evian, el balneario francés en el Lago Ginebra que acoge la cumbre de este año de las principales potencias industrializadas. Chirac dio a otros líderes una bienvenida mucho más calurosa.


Tanto Bush como Chirac han dicho que polémica sobre Irak, en la que Francia lideró a Alemania y Rusia en su oposición a los planes de invasión de Estados Unidos, era ya historia, y ambas partes debían mirar hacia el futuro.


Bush se reunirá con Chirac el lunes por la mañana, pero abandona Evian esa tarde, un día antes de que termine la cumbre del G-8, haciendo de ella lo que un periódico local calificó de "cumbre-escala", intercalada entre otras reuniones de alto nivel en Rusia y Oriente Medio.


"No puedo imaginar que se reúnan sin hablar sobre Irak", dijo la portavoz de Chirac, Catherine Colonna, a periodistas. "Si lo hacen, no se tratará de mirar al pasado - eso difícilmente sería útil - sino de mirar al futuro".


Al margen de la cumbre, un alto cargo estadounidense emitió una velada advertencia a París de que no intentara de nuevo unir a los europeos contra Washington, mientras que Colonna subrayó que Francia quería un "mundo multipolar" con las Naciones Unidas desempeñando un papel crucial.


Colonna no descartó una discusión de la cumbre sobre la reciente caída del dólar estadounidense, una cuestión que los líderes del G-8 han intentando minimizar, y dijo que la reunión debería enviar al mundo "un mensaje de confianza en el crecimiento económico".


Por su parte, un alto cargo de la administración Bush dijo que el presidente estadounidense instará a los líderes del G-8 a poner en forma sus alicaídas economías y derribar las barreras al comercio mundial durante la cumbre.


Washington ha dejado claro que quiere que los otros países del G-8 aumenten su contribución al estímulo de la economía mundial.


Hablando bajo la condición del anonimato, el responsable dijo que Bush hablaría sobre las medidas que ha tomado para impulsar el crecimiento, como el recorte de impuestos, y escucharía lo que otros planeaban hacer.


Estados Unidos está presionando para liberalizar el comercio mediante la rebaja de los aranceles y una drástica reducción de las ayudas agrarias, una propuesta a la que Francia - como el principal beneficiario de los generosos subsidios agrícolas de la Unión Europea - se opondrá.


VIOLENTAS PROTESTAS


Más allá de varios anillos de seguridad fuertemente vigilados, anarquistas y anticapitalistas se comportaron violentamente en localidades de Francia y la vecina Suiza, destrozando escaparates y bloqueando carreteras para protestar contra el club de ricos que dicen controla el mundo.


Decenas de miles de manifestantes se concentraron para la principal protesta anti-G8 en la frontera franco-suiza al sur de Ginebra, observada por una masiva presencia de policías antidisturbios franceses y suizos.


Los manifestantes acusan al Grupo de los Ocho - Estados Unidos, Japón, Alemania, Francia, Reino Unido, Italia, Canadá y Rusia - de ser un club elitista que dirige la economía mundial.


El presidente sudafricano, Thabo Mbeki, uno de los 12 líderes de países en desarrollo invitado a Evian, dijo que los países africanos consideraban que anteriores compromisos de ayuda acordados en otras cumbres no se habían cumplido.


Les membres du G8 approuvent la création d'une force africaine de maintien de la paix 

EVIAN (AP) - Les membres du G8 se sont engagés dimanche soir à soutenir la création d'ici 2010 d'une force africaine de maintien de la paix et à favoriser le développement du continent africain.

Après avoir rencontré les présidents de quatre des cinq pays africains (Afrique du Sud, Algérie, Sénégal, Nigeria) membres du comité de pilotage du Nouveau partenariat pour le développement économique de l'Afrique (NEPAD), les membres du G8 ont approuvé dans une déclaration commune la mise en place d'une force prépositionnée dans les cinq "sous-régions" africaines capable d'intervenir partout en Afrique.

Le seul absent à cette réunion était le président égyptien Hosni Moubarak, parti avant le dîner.

Le président nigérian Olusegun Obasanjo a salué cette l'engagement du G8, déclarant que "la condition majeure au développement est l'absence de conflit". La porte-parole de la présidence française, Catherine Colonna, a pour sa part qualifié la réunion d'"exceptionnelle". 


Sonntag 1. Juni 2003, 17:56 Uhr
Schröder strahlte
 
Bild vergrößern  
Berlin (AP) Der Kanzler strahlte: «Ich gestehe, dass ich 90 Prozent Zustimmung zum Leitantrag weder erwartet noch erhofft habe», sagte Gerhard Schröder am Sonntag zum Ende des SPD-Sonderparteitags in Berlin. Den 500 Delegierten bescheinigte er Geschlossenheit und Disziplin und versprach, dies auch im Kabinett durchzusetzen. An die «Mitglieder meiner wunderbaren Regierung» und an sich selbst richtete Schröder die Mahnung: «Ein Interview weniger tut's auch.»

Vor dem Reformparteitag waren 80 Prozent ANZEIGE 
  
Zustimmung zu Schröders Agenda 2010 als gutes Ergebnis gehandelt worden. SPD-Generalsekretär Olaf Scholz hatte sogar erklärt, schon 51 Prozent seien eine Mehrheit. Als die Delegierten dann bei der Abstimmung über Schröders Reformpläne die Hand hoben, verkündete Tagungspräsident Peer Steinbrück, Ministerpräsident in Nordrhein-Westfalen: «Aus der Sicht des Präsidiums eine Zustimmung von 90 Prozent.»

Von Schröder fiel sichtlich eine Last ab. Er hatte die Abstimmung über seine Reformpläne mit seinem politischen Schicksal verknüpft - den Weg zum Parteitag mit Rücktrittsforderungen gepflastert, wie die Parteilinke Andrea Nahles kritisierte. Und der Kanzler war eingeschritten, als der linke Flügel in seinen Augen die Beschlüsse des Parteitags verwässern wollte.

Die Forderung, bei der Bezugsdauer für das Arbeitslosengeld für Ältere und bei der paritätischen Finanzierung des Krankengelds alles beim Alten zu lassen, lehnte Schröder ab. Man müsse «richtig fair» miteinander umgehen, forderte er. Dazu gehöre nicht, ihn über in letzter Minute gestellte Initiativanträge nach dem Motto disziplinieren zu wollen: «Wir wollen ihn ja behalten, aber zu unseren Bedingungen.» Das sei «nur begrenzt möglich». Aus «inhaltlichen Motiven» und «unser selbst willen» müsse Klarheit geschaffen werden.

Doch gegen seine Überzeugung ließ der Kanzler einen Achtungserfolg der Parteilinken zu. Bis zum nächsten regulären SPD-Parteitag im November in Bochum überprüft eine Arbeitsgruppe die Vorschläge für eine Wachstumsstrategie - und dabei soll die Vermögensteuer wieder eine Rolle spielen. «Wir wollen die Vermögens- und Erbschaftsbesteuerung weiterentwickeln, um eine angemessene Belastung von großen Vermögensbesitzern zu erreichen», beschlossen die Delegierten. «Dieses Ziel ist auch dann richtig und wird weiter verfolgt, wenn es keine aktuellen Bundesratsmehrheiten für seine Umsetzung gibt.»

Dank, Respekt und Verehrung zollte Schröder den beiden sozialdemokratischen Urgesteinen Erhard Eppler und Hans-Jochen Vogel. Sie hätten enorm viel für die Partei und für das Land geleistet. Beide hatten auf dem Sonderparteitag den Delegierten eindringlich ins Gewissen geredet.

Eppler sagte, er müsse gestehen, dass «meine Begeisterung begrenzt war», als er Schröders Reformagenda mit den Einschnitten ins soziale Netz gelesen habe. Seine Begeisterung sei aber noch viel geringer gewesen, als er die Kritiker gehört habe. Sie diskutierten wie in «einer leergeräumten Welt» ohne Bundesrat und EU-Gesetzgebung. «Das hat für mich surrealistische Züge.»

Als alter Mann habe er einen Wunsch, sagte Eppler. «Hört endlich auf damit.» Die Botschaft des Parteitags dürfe nicht sein, dass die SPD ihre Grundwerte Freiheit, Gerechtigkeit und Solidarität über Bord geworfen habe, sondern: «Die Sozialdemokraten haben begriffen, in welcher Welt sie leben.»

Der frühere Parteichef Vogel nannte es entscheidend, dass die SPD zur Kenntnis nimmt, dass sich die Wirklichkeit verändert habe. «Wer seine Politik von der Realität trennt, geht ins Abseits - und da gehört die SPD nicht hin.» Vogel räumte ein, dass auch ihm vieles an Schröders Agenda nicht gefallen habe. Eine breite und intensive Diskussion darüber sei nötig gewesen. Doch mit der «Ungeschütztheit des Alters» fügte er hinzu: Wer von den Sozialdemokraten in die Opposition wolle, solle dies auch sagen. Und, ohne detailliert auf die Krise in der rot-grünen Koalition in Nordrhein-Westfalen einzugehen, richtete Vogel die Mahnung an die Genossen in Düsseldorf: «Überlegt Euch gut, was ihr da tut. NRW ist nicht irgendein Land.»

--uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e--
--------------------------------------
{noformat}
                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173237#comment-13173237 ] 

Benson Margulies edited comment on CXF-3987 at 12/20/11 3:22 PM:
-----------------------------------------------------------------

No content disposition? start= instead?
{noformat}
----------------------------
ID: 1
Address: http://localhost:15000/r4dws/services/doc/processFormTextToJson
Encoding: ISO-8859-1
Http-Method: POST
Content-Type: multipart/form-data; type="application/json"; boundary="uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e"; start="<options>"; start-info="application/json"
Headers: {Accept=[text/html], cache-control=[no-cache], connection=[keep-alive], content-type=[multipart/form-data; type="application/json"; boundary="uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e"; start="<options>"; start-info="application/json"], host=[localhost:15000], pragma=[no-cache], transfer-encoding=[chunked], user-agent=[Apache CXF 2.5.1]}
Payload: 
--uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e
Content-Type: application/json
Content-Transfer-Encoding: binary
Content-ID: <options>

{"languageDetection":{"language":"UNKNOWN","strategy":"MULTIPLE"},"text":null}
--uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <data>

1 de junio de 2003, 18h01

Bush y Chirac sonríen para las cámaras en tensa cumbre del G-8

                
      was (Author: bmargulies):
    No content disposition? start= instead?
{noformat}
----------------------------
ID: 1
Address: http://localhost:15000/r4dws/services/doc/processFormTextToJson
Encoding: ISO-8859-1
Http-Method: POST
Content-Type: multipart/form-data; type="application/json"; boundary="uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e"; start="<options>"; start-info="application/json"
Headers: {Accept=[text/html], cache-control=[no-cache], connection=[keep-alive], content-type=[multipart/form-data; type="application/json"; boundary="uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e"; start="<options>"; start-info="application/json"], host=[localhost:15000], pragma=[no-cache], transfer-encoding=[chunked], user-agent=[Apache CXF 2.5.1]}
Payload: 
--uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e
Content-Type: application/json
Content-Transfer-Encoding: binary
Content-ID: <options>

{"languageDetection":{"language":"UNKNOWN","strategy":"MULTIPLE"},"text":null}
--uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <data>

1 de junio de 2003, 18h01

Bush y Chirac sonríen para las cámaras en tensa cumbre del G-8


EVIAN, Francia (Reuters) - Los presidentes George W. Bush y Jacques Chirac sonrieron el domingo para las cámaras al inicio de una cumbre del Grupo de los Ocho eclipsada por el enfrentamiento franco-estadounidense por la guerra de Irak y la inquietud sobre los próximos movimientos de Washington.


Bush recibió un corto apretón de manos y una sonrisa agarrotada de su crítico más duro a su llegada a Evian, el balneario francés en el Lago Ginebra que acoge la cumbre de este año de las principales potencias industrializadas. Chirac dio a otros líderes una bienvenida mucho más calurosa.


Tanto Bush como Chirac han dicho que polémica sobre Irak, en la que Francia lideró a Alemania y Rusia en su oposición a los planes de invasión de Estados Unidos, era ya historia, y ambas partes debían mirar hacia el futuro.


Bush se reunirá con Chirac el lunes por la mañana, pero abandona Evian esa tarde, un día antes de que termine la cumbre del G-8, haciendo de ella lo que un periódico local calificó de "cumbre-escala", intercalada entre otras reuniones de alto nivel en Rusia y Oriente Medio.


"No puedo imaginar que se reúnan sin hablar sobre Irak", dijo la portavoz de Chirac, Catherine Colonna, a periodistas. "Si lo hacen, no se tratará de mirar al pasado - eso difícilmente sería útil - sino de mirar al futuro".


Al margen de la cumbre, un alto cargo estadounidense emitió una velada advertencia a París de que no intentara de nuevo unir a los europeos contra Washington, mientras que Colonna subrayó que Francia quería un "mundo multipolar" con las Naciones Unidas desempeñando un papel crucial.


Colonna no descartó una discusión de la cumbre sobre la reciente caída del dólar estadounidense, una cuestión que los líderes del G-8 han intentando minimizar, y dijo que la reunión debería enviar al mundo "un mensaje de confianza en el crecimiento económico".


Por su parte, un alto cargo de la administración Bush dijo que el presidente estadounidense instará a los líderes del G-8 a poner en forma sus alicaídas economías y derribar las barreras al comercio mundial durante la cumbre.


Washington ha dejado claro que quiere que los otros países del G-8 aumenten su contribución al estímulo de la economía mundial.


Hablando bajo la condición del anonimato, el responsable dijo que Bush hablaría sobre las medidas que ha tomado para impulsar el crecimiento, como el recorte de impuestos, y escucharía lo que otros planeaban hacer.


Estados Unidos está presionando para liberalizar el comercio mediante la rebaja de los aranceles y una drástica reducción de las ayudas agrarias, una propuesta a la que Francia - como el principal beneficiario de los generosos subsidios agrícolas de la Unión Europea - se opondrá.


VIOLENTAS PROTESTAS


Más allá de varios anillos de seguridad fuertemente vigilados, anarquistas y anticapitalistas se comportaron violentamente en localidades de Francia y la vecina Suiza, destrozando escaparates y bloqueando carreteras para protestar contra el club de ricos que dicen controla el mundo.


Decenas de miles de manifestantes se concentraron para la principal protesta anti-G8 en la frontera franco-suiza al sur de Ginebra, observada por una masiva presencia de policías antidisturbios franceses y suizos.


Los manifestantes acusan al Grupo de los Ocho - Estados Unidos, Japón, Alemania, Francia, Reino Unido, Italia, Canadá y Rusia - de ser un club elitista que dirige la economía mundial.


El presidente sudafricano, Thabo Mbeki, uno de los 12 líderes de países en desarrollo invitado a Evian, dijo que los países africanos consideraban que anteriores compromisos de ayuda acordados en otras cumbres no se habían cumplido.


Les membres du G8 approuvent la création d'une force africaine de maintien de la paix 

EVIAN (AP) - Les membres du G8 se sont engagés dimanche soir à soutenir la création d'ici 2010 d'une force africaine de maintien de la paix et à favoriser le développement du continent africain.

Après avoir rencontré les présidents de quatre des cinq pays africains (Afrique du Sud, Algérie, Sénégal, Nigeria) membres du comité de pilotage du Nouveau partenariat pour le développement économique de l'Afrique (NEPAD), les membres du G8 ont approuvé dans une déclaration commune la mise en place d'une force prépositionnée dans les cinq "sous-régions" africaines capable d'intervenir partout en Afrique.

Le seul absent à cette réunion était le président égyptien Hosni Moubarak, parti avant le dîner.

Le président nigérian Olusegun Obasanjo a salué cette l'engagement du G8, déclarant que "la condition majeure au développement est l'absence de conflit". La porte-parole de la présidence française, Catherine Colonna, a pour sa part qualifié la réunion d'"exceptionnelle". 


Sonntag 1. Juni 2003, 17:56 Uhr
Schröder strahlte
 
Bild vergrößern  
Berlin (AP) Der Kanzler strahlte: «Ich gestehe, dass ich 90 Prozent Zustimmung zum Leitantrag weder erwartet noch erhofft habe», sagte Gerhard Schröder am Sonntag zum Ende des SPD-Sonderparteitags in Berlin. Den 500 Delegierten bescheinigte er Geschlossenheit und Disziplin und versprach, dies auch im Kabinett durchzusetzen. An die «Mitglieder meiner wunderbaren Regierung» und an sich selbst richtete Schröder die Mahnung: «Ein Interview weniger tut's auch.»

Vor dem Reformparteitag waren 80 Prozent ANZEIGE 
  
Zustimmung zu Schröders Agenda 2010 als gutes Ergebnis gehandelt worden. SPD-Generalsekretär Olaf Scholz hatte sogar erklärt, schon 51 Prozent seien eine Mehrheit. Als die Delegierten dann bei der Abstimmung über Schröders Reformpläne die Hand hoben, verkündete Tagungspräsident Peer Steinbrück, Ministerpräsident in Nordrhein-Westfalen: «Aus der Sicht des Präsidiums eine Zustimmung von 90 Prozent.»

Von Schröder fiel sichtlich eine Last ab. Er hatte die Abstimmung über seine Reformpläne mit seinem politischen Schicksal verknüpft - den Weg zum Parteitag mit Rücktrittsforderungen gepflastert, wie die Parteilinke Andrea Nahles kritisierte. Und der Kanzler war eingeschritten, als der linke Flügel in seinen Augen die Beschlüsse des Parteitags verwässern wollte.

Die Forderung, bei der Bezugsdauer für das Arbeitslosengeld für Ältere und bei der paritätischen Finanzierung des Krankengelds alles beim Alten zu lassen, lehnte Schröder ab. Man müsse «richtig fair» miteinander umgehen, forderte er. Dazu gehöre nicht, ihn über in letzter Minute gestellte Initiativanträge nach dem Motto disziplinieren zu wollen: «Wir wollen ihn ja behalten, aber zu unseren Bedingungen.» Das sei «nur begrenzt möglich». Aus «inhaltlichen Motiven» und «unser selbst willen» müsse Klarheit geschaffen werden.

Doch gegen seine Überzeugung ließ der Kanzler einen Achtungserfolg der Parteilinken zu. Bis zum nächsten regulären SPD-Parteitag im November in Bochum überprüft eine Arbeitsgruppe die Vorschläge für eine Wachstumsstrategie - und dabei soll die Vermögensteuer wieder eine Rolle spielen. «Wir wollen die Vermögens- und Erbschaftsbesteuerung weiterentwickeln, um eine angemessene Belastung von großen Vermögensbesitzern zu erreichen», beschlossen die Delegierten. «Dieses Ziel ist auch dann richtig und wird weiter verfolgt, wenn es keine aktuellen Bundesratsmehrheiten für seine Umsetzung gibt.»

Dank, Respekt und Verehrung zollte Schröder den beiden sozialdemokratischen Urgesteinen Erhard Eppler und Hans-Jochen Vogel. Sie hätten enorm viel für die Partei und für das Land geleistet. Beide hatten auf dem Sonderparteitag den Delegierten eindringlich ins Gewissen geredet.

Eppler sagte, er müsse gestehen, dass «meine Begeisterung begrenzt war», als er Schröders Reformagenda mit den Einschnitten ins soziale Netz gelesen habe. Seine Begeisterung sei aber noch viel geringer gewesen, als er die Kritiker gehört habe. Sie diskutierten wie in «einer leergeräumten Welt» ohne Bundesrat und EU-Gesetzgebung. «Das hat für mich surrealistische Züge.»

Als alter Mann habe er einen Wunsch, sagte Eppler. «Hört endlich auf damit.» Die Botschaft des Parteitags dürfe nicht sein, dass die SPD ihre Grundwerte Freiheit, Gerechtigkeit und Solidarität über Bord geworfen habe, sondern: «Die Sozialdemokraten haben begriffen, in welcher Welt sie leben.»

Der frühere Parteichef Vogel nannte es entscheidend, dass die SPD zur Kenntnis nimmt, dass sich die Wirklichkeit verändert habe. «Wer seine Politik von der Realität trennt, geht ins Abseits - und da gehört die SPD nicht hin.» Vogel räumte ein, dass auch ihm vieles an Schröders Agenda nicht gefallen habe. Eine breite und intensive Diskussion darüber sei nötig gewesen. Doch mit der «Ungeschütztheit des Alters» fügte er hinzu: Wer von den Sozialdemokraten in die Opposition wolle, solle dies auch sagen. Und, ohne detailliert auf die Krise in der rot-grünen Koalition in Nordrhein-Westfalen einzugehen, richtete Vogel die Mahnung an die Genossen in Düsseldorf: «Überlegt Euch gut, was ihr da tut. NRW ist nicht irgendein Land.»

--uuid:00b0aabf-6dc8-4a22-a5c4-a5d2eaa2264e--
--------------------------------------
{noformat}
                  
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

--
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-3987) incompatible change in JAX-RS from 2.5.0 to 2.5.1

Posted by "Benson Margulies (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173702#comment-13173702 ] 

Benson Margulies commented on CXF-3987:
---------------------------------------

Sergey,

I think that the issue here is the client side. Absolutely none of the constructors for Attachment build something that corresponds to what a browser does. The documented examples on the client side don't work.

Though, breaking working clients in a double-point release might be a cause for concern.

I'll add a constructor or a factory for Attachment.

--benson

                
> incompatible change in JAX-RS from 2.5.0 to 2.5.1
> -------------------------------------------------
>
>                 Key: CXF-3987
>                 URL: https://issues.apache.org/jira/browse/CXF-3987
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.1
>            Reporter: Benson Margulies
>
> One of my multipart tests is now failing with a 400. The 400 is thrown from FormUtils in the runtime. It runs just fine in 2.5.0.
> My function looks like:
> {code}
>     @Produces("text/html")
>     @Consumes("multipart/form-data")
>     @Path("/processFormTextToJson")
>     @Descriptions({ 
>         @Description(value = "Accepts text from an HTML form, returns analysis results in JSON.", target = DocTarget.METHOD),
>         @Description(value = "Json containing all of the analysis results", target = DocTarget.RETURN)
>      })
>     public Response processFormTextToJson(@Description(value = "Json specification of the processing options.", target = DocTarget.PARAM)
>                                           @Multipart(value = "options") String optionsString,
>                                           @Description(value = "Input text", target = DocTarget.PARAM)
>                                           @Multipart(value = "data") InputStream data) {
> {code}
> and the code leading to the exception in CXF is:
> {code}
>  public static void populateMapFromMultipart(MultivaluedMap<String, String> params,
>                                                 Annotation[] anns,
>                                                 MultipartBody body, 
>                                                 boolean decode) {
>  
>        List<Attachment> atts = body.getAllAttachments();
>         for (Attachment a : atts) {
>             ContentDisposition cd = a.getContentDisposition();
>             if (cd == null || !MULTIPART_FORM_DATA_TYPE.equalsIgnoreCase(cd.getType())
>                 || cd.getParameter("name") == null) {
>                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
>                 
>                 if (id == null || id.required()) {
>                     throw new WebApplicationException(400);
>                 } else {
>                     return;
>                 }
>             }
> {code}
> The annotations present are:
> {noformat}
> [@org.apache.cxf.jaxrs.model.wadl.Description(title=, target=param, value=Json specification of the processing options., lang=, docuri=), @org.apache.cxf.jaxrs.ext.multipart.Multipart(value=options, required=true, type=*/*)]
> {noformat}
> Note that the required flag is on. cd is null. In other words, even if the names match, if there is no content disposition, we get a 400. Is that really right? Why require a cd? What's wrong with the plain old name field of the part?

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