wink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kumar, Munirathnam" <munirathnam.ku...@hp.com>
Subject Inconsistent Unmarshalling during Concurrent requests
Date Thu, 08 Dec 2011 14:05:38 GMT
Hi
I am requesting  Concurrent requests to a Resource.
But on the Resource, bean objects are not completely populated for some request and gets populated
completely for other requests.

Please see the Client,Bean and Resource Class below.

For few client request the request.getSelectedOptions() always returns null .

Is this a bug with Wink ?

Can you please help


-          kumar

Client

class Multi implements Runnable{
    Resource resource;
    String xml = "<UserSubscription>"
            +       "<selectedOptions><entry><key >Amount of Memory (MB)</key><value
>2000</value></entry>" +
                                           "<entry><key>Number of CPUs</key><value>1</value></entry>"
+
                                           "<entry><key>Number of Servers</key><value>1</value></entry>"
            +      "</selectedOptions>"
            +   "</UserSubscription>";

    Multi(Resource resource){
        this.resource = resource;

    }
    public void run(){
             String res = resource.contentType(MediaType.APPLICATION_XML).accept(MediaType.TEXT_PLAIN).post(String.class,xml);
             System.out.println("thread - " + Thread.currentThread().getName() + " : " + 
res);
    }
}

Bean Class

@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "UserSubscription")
public class ServiceRequest {
                private Properties modelInputs;


                public  void setSelectedOptions(Properties modelInputs) {
                                this.modelInputs = modelInputs;
                }

                @XmlElementWrapper(name = "selectedOptions", required = true, nillable = false)
                public  Properties getSelectedOptions() {
                                return this.modelInputs;
                }
}


Resource Class

@Path("/test")
public class PropResource {

@POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.TEXT_PLAIN)
    public Response getLogs(ServiceRequest request){

    String res = "";
    if( request.getSelectedOptions() == null){
        res = "Serialization Failed";
    } else if(request.getSelectedOptions() != null ){
        res = "Serialization Passed";
    }
    return Response.ok(res).build();
    }

}


Mime
View raw message