You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wink.apache.org by Bin Zhu <lu...@gmail.com> on 2014/02/26 14:13:01 UTC

@WADLDoc for method resource doesn't work in JDK7.5.1 , linux

Our app was deploying on Linux with JDK7.5.1, we are using @WADLDoc to set
the WADL title, and find it doesn't work for method resource, but will only
work when setting title for class resource.
This issue is only found on linux platform with JDK 7.5.1. There is no such
issue on Windows platform with same JDK version. The Wink version is 1.1.
Any idea if it's a wink bug or jdk bug?  Is there any workaround to set
wadl doc title besides @WADLDoc?  Thanks in advance.
***************************************************************
Cases don't work:
Provider code:
  @GET
    public String getMethod(@WADLDoc(value = "This is path parameter
message1") @PathParam("pathparam") List<String> pathParam) {
        return "getMethod";
    }

Client code will failed to get the doc and the title:

List<Param> params = wadlResource.getParam();
for (Param param : params) {
    if ("pathparam".equals(param.getName())) {
        pathParamFound = true;
        assertEquals(ParamStyle.TEMPLATE, param.getStyle());
        docs = param.getDoc();
        assertEquals(1, docs.size());
        doc = docs.get(0);
        assertEquals("This is path parameter message1", doc.getTitle());

******************************************************************
Cases will work:
Provider code:
@WADLDoc("This is MyWADLResource")
@Path("wadl/{pathparam:[[a-z][A-Z]]*}")
public class MyWADLResource extends MyWADLAbstractClass

Client code will get the doc and title;
      org.apache.wink.common.model.wadl.Resource wadlResource =
resourceList.get(0);
assertEquals("wadl/{pathparam}", wadlResource.getPath());
List<Doc> docs = wadlResource.getDoc();
assertEquals(1, docs.size());
Doc doc = docs.get(0);
assertEquals("This is MyWADLResource", doc.getTitle());
*********************************************************************************

Re: @WADLDoc for method resource doesn't work in JDK7.5.1 , linux

Posted by Bin Zhu <lu...@gmail.com>.
Thanks for the response. we are only supposed to use 1.1 due to some
reasons in our production env..  Try to reproduce using wink 1.4 in test
env but the app failed to start due to some other errors.
With 1.1,  when compare the traces with good ones, it is found that
 response messages for "pathparam" wadl part is incomplete with java 7.5.1
on linux platform:
The bad one is only having <param name="pathparam" style="template"/>
while it is supposed to be
<param style="template" name="pathparam">
<doc title="This is path parameter message1"/>
</param>

There is no this issue for other resources (e.g. matrixparam) with @WADLDoc.
It seems like a potential bug for pathparam with @WADLDoc.
Any idea which part of wink code might be related with generating the
pathparam response messages?


*******************************************
bad response:
<resource path="wadl/{pathparam}">
<doc title="This is MyWADLResource"/>
<param name="pathparam" style="template"/>

<param name="matrixparam" style="matrix">
<doc title="This is a matrix param"/>
</param>
**********************************************
good response:
<resource path="wadl/{pathparam}">
<doc title="This is MyWADLResource"/>
<param style="template" name="pathparam">
<doc title="This is path parameter message1"/>
</param>

<param style="matrix" name="matrixparam">
<doc title="This is a matrix param"/>
</param>
**********************************************************




2014-02-27 0:31 GMT+08:00 Luciano Resende <lu...@gmail.com>:

> If you are still using Wink 1.1, I'd recommend you try the latest version
> and see if you still can reproduce the issue.
>
>
> On Wed, Feb 26, 2014 at 5:13 AM, Bin Zhu <lu...@gmail.com> wrote:
>
> > Our app was deploying on Linux with JDK7.5.1, we are using @WADLDoc to
> set
> > the WADL title, and find it doesn't work for method resource, but will
> only
> > work when setting title for class resource.
> > This issue is only found on linux platform with JDK 7.5.1. There is no
> such
> > issue on Windows platform with same JDK version. The Wink version is 1.1.
> > Any idea if it's a wink bug or jdk bug?  Is there any workaround to set
> > wadl doc title besides @WADLDoc?  Thanks in advance.
> > ***************************************************************
> > Cases don't work:
> > Provider code:
> >   @GET
> >     public String getMethod(@WADLDoc(value = "This is path parameter
> > message1") @PathParam("pathparam") List<String> pathParam) {
> >         return "getMethod";
> >     }
> >
> > Client code will failed to get the doc and the title:
> >
> > List<Param> params = wadlResource.getParam();
> > for (Param param : params) {
> >     if ("pathparam".equals(param.getName())) {
> >         pathParamFound = true;
> >         assertEquals(ParamStyle.TEMPLATE, param.getStyle());
> >         docs = param.getDoc();
> >         assertEquals(1, docs.size());
> >         doc = docs.get(0);
> >         assertEquals("This is path parameter message1", doc.getTitle());
> >
> > ******************************************************************
> > Cases will work:
> > Provider code:
> > @WADLDoc("This is MyWADLResource")
> > @Path("wadl/{pathparam:[[a-z][A-Z]]*}")
> > public class MyWADLResource extends MyWADLAbstractClass
> >
> > Client code will get the doc and title;
> >       org.apache.wink.common.model.wadl.Resource wadlResource =
> > resourceList.get(0);
> > assertEquals("wadl/{pathparam}", wadlResource.getPath());
> > List<Doc> docs = wadlResource.getDoc();
> > assertEquals(1, docs.size());
> > Doc doc = docs.get(0);
> > assertEquals("This is MyWADLResource", doc.getTitle());
> >
> >
> *********************************************************************************
> >
>
>
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
> http://twitter.com/lresende1975
> http://lresende.blogspot.com/
>

Re: @WADLDoc for method resource doesn't work in JDK7.5.1 , linux

Posted by Luciano Resende <lu...@gmail.com>.
If you are still using Wink 1.1, I'd recommend you try the latest version
and see if you still can reproduce the issue.


On Wed, Feb 26, 2014 at 5:13 AM, Bin Zhu <lu...@gmail.com> wrote:

> Our app was deploying on Linux with JDK7.5.1, we are using @WADLDoc to set
> the WADL title, and find it doesn't work for method resource, but will only
> work when setting title for class resource.
> This issue is only found on linux platform with JDK 7.5.1. There is no such
> issue on Windows platform with same JDK version. The Wink version is 1.1.
> Any idea if it's a wink bug or jdk bug?  Is there any workaround to set
> wadl doc title besides @WADLDoc?  Thanks in advance.
> ***************************************************************
> Cases don't work:
> Provider code:
>   @GET
>     public String getMethod(@WADLDoc(value = "This is path parameter
> message1") @PathParam("pathparam") List<String> pathParam) {
>         return "getMethod";
>     }
>
> Client code will failed to get the doc and the title:
>
> List<Param> params = wadlResource.getParam();
> for (Param param : params) {
>     if ("pathparam".equals(param.getName())) {
>         pathParamFound = true;
>         assertEquals(ParamStyle.TEMPLATE, param.getStyle());
>         docs = param.getDoc();
>         assertEquals(1, docs.size());
>         doc = docs.get(0);
>         assertEquals("This is path parameter message1", doc.getTitle());
>
> ******************************************************************
> Cases will work:
> Provider code:
> @WADLDoc("This is MyWADLResource")
> @Path("wadl/{pathparam:[[a-z][A-Z]]*}")
> public class MyWADLResource extends MyWADLAbstractClass
>
> Client code will get the doc and title;
>       org.apache.wink.common.model.wadl.Resource wadlResource =
> resourceList.get(0);
> assertEquals("wadl/{pathparam}", wadlResource.getPath());
> List<Doc> docs = wadlResource.getDoc();
> assertEquals(1, docs.size());
> Doc doc = docs.get(0);
> assertEquals("This is MyWADLResource", doc.getTitle());
>
> *********************************************************************************
>



-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Re: @WADLDoc for method resource doesn't work in JDK7.5.1 , linux

Posted by Luciano Resende <lu...@gmail.com>.
If you are still using Wink 1.1, I'd recommend you try the latest version
and see if you still can reproduce the issue.


On Wed, Feb 26, 2014 at 5:13 AM, Bin Zhu <lu...@gmail.com> wrote:

> Our app was deploying on Linux with JDK7.5.1, we are using @WADLDoc to set
> the WADL title, and find it doesn't work for method resource, but will only
> work when setting title for class resource.
> This issue is only found on linux platform with JDK 7.5.1. There is no such
> issue on Windows platform with same JDK version. The Wink version is 1.1.
> Any idea if it's a wink bug or jdk bug?  Is there any workaround to set
> wadl doc title besides @WADLDoc?  Thanks in advance.
> ***************************************************************
> Cases don't work:
> Provider code:
>   @GET
>     public String getMethod(@WADLDoc(value = "This is path parameter
> message1") @PathParam("pathparam") List<String> pathParam) {
>         return "getMethod";
>     }
>
> Client code will failed to get the doc and the title:
>
> List<Param> params = wadlResource.getParam();
> for (Param param : params) {
>     if ("pathparam".equals(param.getName())) {
>         pathParamFound = true;
>         assertEquals(ParamStyle.TEMPLATE, param.getStyle());
>         docs = param.getDoc();
>         assertEquals(1, docs.size());
>         doc = docs.get(0);
>         assertEquals("This is path parameter message1", doc.getTitle());
>
> ******************************************************************
> Cases will work:
> Provider code:
> @WADLDoc("This is MyWADLResource")
> @Path("wadl/{pathparam:[[a-z][A-Z]]*}")
> public class MyWADLResource extends MyWADLAbstractClass
>
> Client code will get the doc and title;
>       org.apache.wink.common.model.wadl.Resource wadlResource =
> resourceList.get(0);
> assertEquals("wadl/{pathparam}", wadlResource.getPath());
> List<Doc> docs = wadlResource.getDoc();
> assertEquals(1, docs.size());
> Doc doc = docs.get(0);
> assertEquals("This is MyWADLResource", doc.getTitle());
>
> *********************************************************************************
>



-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/