Supposedly, this problem is
with Apache SOAP 2.2 embedded in Oracle's JDeveloper and Oracle
Application Server. My simple application fails if I call the server too
frequently. Here is the scenario:
1. Build the Oracle JDeveloper
SOAP tutorial (very simple service just to
get system date).
2. In the sample client, I added a
loop to call the server many times as in :
public
static void main(String[] args)
{
int i = 0;
{
int i = 0;
try
{
EmbeddedMyJavaClass1WSStub stub = new EmbeddedMyJavaClass1WSStub();
// Add your own code here.
long time = System.currentTimeMillis();
for(i = 0; i < 10000; i++) {
stub.getDate();
}
System.out.println("Elapsed time was " + (System.currentTimeMillis() - time));
}
catch(Exception ex)
{
System.out.println("Failed after " + i + " iterations");
{
EmbeddedMyJavaClass1WSStub stub = new EmbeddedMyJavaClass1WSStub();
// Add your own code here.
long time = System.currentTimeMillis();
for(i = 0; i < 10000; i++) {
stub.getDate();
}
System.out.println("Elapsed time was " + (System.currentTimeMillis() - time));
}
catch(Exception ex)
{
System.out.println("Failed after " + i + " iterations");
ex.printStackTrace();
}
}
}
3. This will fail after some number of interations with the following exception:
3. This will fail after some number of interations with the following exception:
Failed after 2298
iterations
[SOAPException: faultCode=SOAP-ENV:IOException; msg=Address already in use: connect; targetException=java.net.BindException: Address already in use: connect]
[SOAPException: faultCode=SOAP-ENV:IOException; msg=Address already in use: connect; targetException=java.net.BindException: Address already in use: connect]
at
oracle.soap.transport.http.OracleSOAPHTTPConnection.send(OracleSOAPHTTPConnection.java:765)
at
org.apache.soap.rpc.Call.invoke(Call.java:261)
at
mypackage3.EmbeddedMyJavaClass1WSStub.getDate(EmbeddedMyJavaClass1WSStub.java:70)
at
mypackage3.EmbeddedMyJavaClass1WSStub.main(EmbeddedMyJavaClass1WSStub.java:39)
If you restart the program it will -- typically -- fail almost immediately. If you wait some time, it will work again. If you add a sleep for about 40 to 100 ms, then it will work continuously.
Any suggestions? I can probably
live with the problem since my application will not have thousands of calls per
minute, but something is wrong somewhere. I have not tried this in Axis so
far -- anyone know if it has the same problems?
I have tried running this with the
stand-alone OC4J with the same results. Changing memory has no effect.
Best,
Joe McDaniel
The Institute for Genomic Research
The Institute for Genomic Research