axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michele Mazzucco <Michele.Mazzu...@ncl.ac.uk>
Subject [axis2] ServiceClient.sendReceive blocks application forever
Date Tue, 22 Jan 2008 17:14:12 GMT
Hi all,

after some calls to ServiceClient.sendReceive() my client app. blocks
forever. On the server side there are no error messages, the same on the
client.
By using jstack I've found out that my client blocks on sendReceive(),
however the target operation is very fast

Here is the output of jstack

Full thread dump Java HotSpot(TM) Server VM (1.6.0_03-b05 mixed mode):

"Attach Listener" daemon prio=10 tid=0x08790800 nid=0x32bf runnable
[0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Axis2 Task" daemon prio=10 tid=0x08762800 nid=0x3261 in Object.wait()
[0x8240d000..0x8240e030]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x85b10070> (a
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
$ConnectionPool)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:509)
        - locked <0x85b10070> (a
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
$ConnectionPool)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:394)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:152)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
        at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:520)
        at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191)
        at
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
        at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
        at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
        at org.apache.axis2.engine.AxisEngine
$TransportNonBlockingInvocationWorker.run(AxisEngine.java:516)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:665)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
        - None

"HttpListener-11000-1" prio=10 tid=0x08761c00 nid=0x3260 runnable
[0x8245e000..0x8245efb0]
   java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
        - locked <0x85b10430> (a java.net.SocksSocketImpl)
        at java.net.ServerSocket.implAccept(ServerSocket.java:453)
        at java.net.ServerSocket.accept(ServerSocket.java:421)
        at
org.apache.axis2.transport.http.server.DefaultConnectionListener.run(DefaultConnectionListener.java:79)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:665)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
        - None

"MultiThreadedHttpConnectionManager cleanup" daemon prio=10
tid=0x08758000 nid=0x325f in Object.wait() [0x824af000..0x824b0130]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x85b10610> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x85b10610> (a java.lang.ref.ReferenceQueue$Lock)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
$ReferenceQueueThread.run(MultiThreadedHttpConnectionManager.java:1082)

   Locked ownable synchronizers:
        - None

"DestroyJavaVM" prio=10 tid=0x0805a800 nid=0x3251 waiting on condition
[0x00000000..0xb7e3b080]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"pool-1-thread-1" prio=10 tid=0x0863cc00 nid=0x325e in Object.wait()
[0x82500000..0x825010b0]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x85b10070> (a
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
$ConnectionPool)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:509)
        - locked <0x85b10070> (a
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
$ConnectionPool)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:394)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:152)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
        at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:520)
        at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191)
        at
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
        at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
        at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
        at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
        at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
        at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
        at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
        at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
        at
ncl.qosp.test.client.streams.delayed.Sender.sendAddStreamMsg(Sender.java:215)
        at
ncl.qosp.test.client.streams.delayed.Sender.init(Sender.java:157)
        at
ncl.qosp.test.client.streams.delayed.QueueController.addStream(QueueController.java:262)
        at
ncl.qosp.test.client.streams.delayed.QueueController.execute(QueueController.java:151)
        at
ncl.qosp.test.client.streams.delayed.QueueController.run(QueueController.java:182)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
        - <0x85b215a0> (a java.util.concurrent.locks.ReentrantLock
$NonfairSync)

"Timer-1" daemon prio=10 tid=0x08566800 nid=0x325d in Object.wait()
[0x8255b000..0x8255be30]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x85b10950> (a java.util.TaskQueue)
        at java.util.TimerThread.mainLoop(Timer.java:509)
        - locked <0x85b10950> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:462)

   Locked ownable synchronizers:
        - None

"Timer-0" daemon prio=10 tid=0x086bb000 nid=0x325c in Object.wait()
[0x825ad000..0x825addb0]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x85cb1348> (a java.util.TaskQueue)
        at java.util.TimerThread.mainLoop(Timer.java:509)
        - locked <0x85cb1348> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:462)

   Locked ownable synchronizers:
        - None

"Low Memory Detector" daemon prio=10 tid=0x08115c00 nid=0x325a runnable
[0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"CompilerThread1" daemon prio=10 tid=0x08114400 nid=0x3259 waiting on
condition [0x00000000..0x8291d5c8]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"CompilerThread0" daemon prio=10 tid=0x08112c00 nid=0x3258 waiting on
condition [0x00000000..0x8299e548]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Signal Dispatcher" daemon prio=10 tid=0x08111800 nid=0x3257 runnable
[0x00000000..0x829efe10]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Surrogate Locker Thread (CMS)" daemon prio=10 tid=0x08110800 nid=0x3256
waiting on condition [0x00000000..0x82a4129c]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Finalizer" daemon prio=10 tid=0x080fcc00 nid=0x3255 in Object.wait()
[0x82ad3000..0x82ad3e30]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x85cb1328> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x85cb1328> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at java.lang.ref.Finalizer
$FinalizerThread.run(Finalizer.java:159)

   Locked ownable synchronizers:
        - None

"Reference Handler" daemon prio=10 tid=0x080fc400 nid=0x3254 in
Object.wait() [0x82b24000..0x82b24db0]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x85cb13d8> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:485)
        at java.lang.ref.Reference
$ReferenceHandler.run(Reference.java:116)
        - locked <0x85cb13d8> (a java.lang.ref.Reference$Lock)

   Locked ownable synchronizers:
        - None

"VM Thread" prio=10 tid=0x080f9800 nid=0x3253 runnable

"Concurrent Mark-Sweep GC Thread" prio=10 tid=0x0806cc00 nid=0x3252
runnable
"VM Periodic Task Thread" prio=10 tid=0x08117400 nid=0x325b waiting on
condition

JNI global references: 771



This is the sendAddStreamMsg

/**
     * Sends the specified addStream message.
     * 
     * @return The cookie.
     * @throws AxisFault If an error occurs or if the stream was not
accepted.
     */
    private final long sendAddStreamMsg(OMElement payload) throws
AxisFault {
        Options options = new Options();
        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
        options.setCallTransportCleanup(true);
        options.setTo(StreamClient.getRouterEpr());
        options.setAction(TestConstants.ADD_STREAM_SOAP_ACTION);

options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
        
        this.sender.setOptions(options);
        OMElement result = sender.sendReceive(payload);	// line 215
        
        final long cookie = Long.valueOf(result.getText());
        if (log.isDebugEnabled()) {
            StringBuilder sb = new StringBuilder("Worker ");
            sb.append(getService());
            sb.append(", worker ");
            sb.append(this.id);
            sb.append(" received cookie ");
            sb.append(cookie);
            log.debug(sb.toString());
        }
        return cookie;
    }


The sender field is a global variable (it's used to accomplish
asynchronous operations as well) which is initialized inside the
constructor with

sender = new ServiceClient(getParams().configurationContext, null);
synchronized (ENGAGE_MODULE_LOCK) {
    sender.engageModule(Constants.MODULE_ADDRESSING);
}

Finally, the custom configuration context is the following:

configurationContext = ConfigurationContextFactory
				.createConfigurationContextFromFileSystem(axis2Home
						.concat("/repository"), "bin/ncl/qosp/test/client/axis2.xml");

		
connectionManager = new MultiThreadedHttpConnectionManager();
HttpConnectionManagerParams connectionManagerParams = new
HttpConnectionManagerParams();
		// 10 seconds
connectionManagerParams.setConnectionTimeout(10000);
connectionManagerParams.setMaxConnectionsPerHost(
	HostConfiguration.ANY_HOST_CONFIGURATION, 5);
		connectionManagerParams.setDefaultMaxConnectionsPerHost(3);
connectionManagerParams.setMaxTotalConnections(100);
connectionManagerParams.setTcpNoDelay(true);
connectionManagerParams.setStaleCheckingEnabled(true);
connectionManagerParams.setLinger(-1);

HttpClient httpClient = new HttpClient(connectionManager);

try {
	configurationContext.setThreadPool(new ThreadPool(1, 5));
} catch (AxisFault e) {
	System.err.println("Unable to set the thread pool");
}

		configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
			Boolean.TRUE);
		configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
			httpClient);


I attach the axis2.xml.



Does anybody know what's going on?


Thanks in advance,
Michele

Mime
View raw message