You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Bo Xu <bx...@yahoo-inc.com> on 2007/01/19 20:20:29 UTC

be aware of the trap that AXIS client stub hangs

I like to share what I found lately. AXIS client code generated by WSDL2JAVA
hangs forever. It is blocked on reading /dev/random. 
Under the following conditions you client soap app is likely to hang
forever:
1. On UNIX, like FreeBSD.
2. ${JAVAHOME}/jre/lib/security/java.security, securerandom.source is set to
"file:/dev/random".

Here is how to fix it: change "/dev/random" to "/dev/urandom" in the file
java.security or with java command line option 
"-Djava.security.egd=file:/dev/urandom"

It looks like AXIS client stub code tries to read a random number from
/dev/random for composing a TCP session ID, why it needs to do this?
For more information on /dev/random, /dev/urandom, please do on UNIX:
man 4 random
Or check the site: http://people.freebsd.org/~dougb/randomness.html

Bo


[1] java.io.FileInputStream.readBytes (native method)
  [2] java.io.FileInputStream.read (FileInputStream.java:194)
  [3] java.io.BufferedInputStream.read1 (BufferedInputStream.java:220)
  [4] java.io.BufferedInputStream.read (BufferedInputStream.java:277)
  [5] java.io.BufferedInputStream.fill (BufferedInputStream.java:183)
  [6] java.io.BufferedInputStream.read1 (BufferedInputStream.java:222)
  [7] java.io.BufferedInputStream.read (BufferedInputStream.java:277)
  [8] sun.security.provider.SeedGenerator$URLSeedGenerator.getSeedByte
(SeedGenerator.java:467)
  [9] sun.security.provider.SeedGenerator.getSeedBytes
(SeedGenerator.java:137)
  [10] sun.security.provider.SeedGenerator.generateSeed
(SeedGenerator.java:132)
  [11] sun.security.provider.SecureRandom.engineGenerateSeed
(SecureRandom.java:112)
  [12] sun.security.provider.SecureRandom.engineNextBytes
(SecureRandom.java:169)
  [13] java.security.SecureRandom.nextBytes (SecureRandom.java:381)
  [14] org.apache.axis.utils.SessionUtils.generateSessionId
(SessionUtils.java:62)
  [15] org.apache.axis.SOAPPart.<init> (SOAPPart.java:164)
  [16] org.apache.axis.Message.setup (Message.java:377)
  [17] org.apache.axis.Message.<init> (Message.java:246)
  [18] org.apache.axis.client.Call.invoke (Call.java:2,425)
  [19] org.apache.axis.client.Call.invoke (Call.java:2,366)
  [20] org.apache.axis.client.Call.invoke (Call.java:1,812)


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org