Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4519FD73C for ; Fri, 12 Oct 2012 13:41:03 +0000 (UTC) Received: (qmail 71393 invoked by uid 500); 12 Oct 2012 13:41:03 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 71370 invoked by uid 500); 12 Oct 2012 13:41:03 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 71362 invoked by uid 99); 12 Oct 2012 13:41:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Oct 2012 13:41:02 +0000 Date: Fri, 12 Oct 2012 13:41:02 +0000 (UTC) From: "csupi (JIRA)" To: issues@cxf.apache.org Message-ID: <255162238.37164.1350049262964.JavaMail.jiratomcat@arcas> In-Reply-To: <968614454.37161.1350049028377.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (CXF-4559) Part of SoapMessage content interchange between two concurrent webservice calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] csupi updated CXF-4559: ----------------------- Environment: Java 64-Bit Server 1.6.0_31 Ubuntu 12.04 64-Bit was:Ubuntu 12.04 > Part of SoapMessage content interchange between two concurrent webservice calls > ------------------------------------------------------------------------------- > > Key: CXF-4559 > URL: https://issues.apache.org/jira/browse/CXF-4559 > Project: CXF > Issue Type: Bug > Components: JAX-WS Runtime > Affects Versions: 2.5.4, 2.5.5, 2.5.6 > Environment: Java 64-Bit Server 1.6.0_31 > Ubuntu 12.04 64-Bit > Reporter: csupi > Priority: Critical > > I have a simple cxf webservice call with a DTO parameter. There is a HashMap and some other fields in the DTO. > I realized that there are some cases where the content in the map is changed somewhere on the server side. > I created a simple unit test. I put a String into the map and into a field where the map is. Create a webservice with jetty and create 15 clients to call my webservice 1000 times. > After the test execution I realized that about in the 2% of the calls, the String in the map differs from the value in the field. > Here is my unit test: > {noformat} > import java.io.Serializable; > import java.util.ArrayList; > import java.util.Collection; > import java.util.HashMap; > import java.util.UUID; > import java.util.concurrent.Callable; > import java.util.concurrent.ExecutionException; > import java.util.concurrent.Executors; > import java.util.concurrent.Future; > import java.util.concurrent.atomic.AtomicInteger; > import javax.jws.WebParam; > import javax.jws.WebService; > import javax.xml.bind.annotation.XmlAccessType; > import javax.xml.bind.annotation.XmlAccessorType; > import org.apache.cxf.interceptor.LoggingInInterceptor; > import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; > import org.apache.cxf.jaxws.JaxWsServerFactoryBean; > import org.junit.Test; > public class WebserviceEndpointIt { > private static final int number_of_clients = 15; > private final AtomicInteger badCounter = new AtomicInteger(0); > private final AtomicInteger successCounter = new AtomicInteger(0); > @XmlAccessorType(XmlAccessType.FIELD) > public static class Event implements Serializable { > private static final long serialVersionUID = 1L; > private final HashMap map = new HashMap(); > private String expected; > private String i; > private String thread; > } > @WebService > public interface MockWebservice { > void doit(@WebParam(name = "message") Event message); > } > public class MockWebserviceImpl implements MockWebservice { > @Override > public void doit(final Event message) { > /* > * read the two strings from the FIELD and the MAP > */ > final String expected = message.expected; > final Object idFromMap = message.map == null ? null : message.map.get("expected"); > if (expected == null || idFromMap == null || !expected.equals(idFromMap)) { > WebserviceEndpointIt.this.badCounter.incrementAndGet(); > } else { > WebserviceEndpointIt.this.successCounter.incrementAndGet(); > } > } > } > @Test > public void testMyWebService() throws InterruptedException, ExecutionException { > final MockWebservice endpoint = new MockWebserviceImpl(); > final JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean(); > svrFactory.setServiceClass(MockWebservice.class); > svrFactory.setAddress("http://localhost:9000/myService"); > svrFactory.setServiceBean(endpoint); > svrFactory.create(); > svrFactory.getInInterceptors().add(new LoggingInInterceptor()); > final Collection> clients = new ArrayList>(); > for (int i = 0; i < number_of_clients; i++) { > final int thread = i; > clients.add(new Callable() { > @Override > public Object call() throws Exception { > final MockWebservice client = createClient(); > for (int i = 0; i < 1000; i++) { > final Event message = new Event(); > final String id = Integer.valueOf(thread).toString() + "-" + Integer.valueOf(i).toString() + " " > + UUID.randomUUID().toString(); > /* > * put the same string into the MAP and the FIELD > */ > message.map.put("expected", id); > message.expected = id; > message.map.put("thread", Integer.valueOf(thread)); > message.map.put("i", Integer.valueOf(i)); > message.thread = Integer.valueOf(thread).toString(); > message.i = Integer.valueOf(i).toString(); > client.doit(message); > } > return null; > } > }); > } > for (final Future item : Executors.newFixedThreadPool(number_of_clients).invokeAll(clients)) { > item.get(); > } > System.out.println("bad: " + this.badCounter.get() + " success: " + this.successCounter.get()); > } > private MockWebservice createClient() { > final JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); > factory.setServiceClass(MockWebservice.class); > factory.setAddress("http://localhost:9000/myService"); > final MockWebservice client = (MockWebservice) factory.create(); > return client; > } > } > {noformat} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira