Hi,
I have a
java class (source code given below)loaded inside Oracle 9i. The status of the class file is valid in the database. This java class has to call the
servlet running on the web server. HTTP being used to connect to the webserver.
At run time I am getting the following error when I try to connect to the web server.
java.net.SocketException: Invalid argument
Invalid argument
at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
at java.net.Socket.<init>(Socket.java:273)
at java.net.Socket.<init>(Socket.java:100)
at sun.net.NetworkClient.doConnect(NetworkClient.java:55)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:335)
The java class loaded inside database is :
import java.net.URL;
import java.net.URLConnection;
import java.io.*;
public class CargoDstMsg {
public static
String doCall(int seq_num, int flag) {
try {
String servletURL = "http://" + url1 + ":" + 9099 + "/TestWebApp/SessionServlet" ;
URL url = new URL(servletURL);
URLConnection conn = url.openConnection();
conn.setRequestProperty("obj","Message from Stored Procedure");
conn.connect();
return "success";
} catch(Exception ex ) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
String status = sw.toString();
return status;
}
}
}
If any one knows how to tackle with this exception please do let us know.
Thanks,
Abdur Rahman.