Here is the code, followed by the output of the printstacktrace
command:
CODE:
import oracle.sql.CLOB;
import oracle.sql.*;
import java.security.*;
import java.net.URL;
import java.net.*;
import java.io.*;
public class ManageSSLConnection{
// POST an XML document to a Service's URL, returning response
public static String sendXMLoverSSL(oracle.sql.CLOB xmlToPost,
String target) {
String response = "No TIME data posted to Visualization server.";
try {
System.setProperty("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider());
// Open an HTTP connection to the target URL
HttpURLConnection conn = null;
URL vistarget = new URL(target);
conn = (HttpURLConnection)vistarget.openConnection();
if (conn == null) return "Error connecting to Visualization
server.\n\n";
// Use HTTP POST
conn.setRequestMethod("POST");
// Indicate that the content type is XML with appropriate MIME
type
conn.setRequestProperty("Content-type","text/xml");
// Set up for writing and reading from the connection
conn.setDoOutput(true);
conn.setDoInput(true);
conn.connect();
// Read from the CLOB stream and write to a string
String xml_string = xmlToPost.getSubString(1L,
(int)xmlToPost.length());
// Write the XML document into the connection's output stream
DataOutputStream out = new
DataOutputStream(conn.getOutputStream());
out.writeBytes(xml_string);
out.flush();
out.close();
// Get header response from the server
// Need to call getHeaderFieldKey method so that
// getResponseCode and getResponseMessage methods will
// not return FileNotFoundException when return code > 400.
// This is a known Java bug that is expected to be fixed in v.
1.4
int resp_code = conn.getResponseCode();
String resp_msg = conn.getResponseMessage();
response = resp_code + " " + resp_msg;
conn.disconnect();
return response + "\n\n";
}
catch (FileNotFoundException e1) {
return("Java FileNotFoundException\n\n");
}
catch (IOException e2) {
e2.printStackTrace();
return(response + " Java IOException\n\n");
}
catch (Exception e3) {
e3.printStackTrace();
return(response + " Unknown Java Exception\n\n");
}
}
}
Here is the trace info:
Dump file /u01/app/oracle/admin/visual/udump/visual_ora_347.trc
Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
With the Partitioning option
JServer Release 8.1.7.2.0 - Production
ORACLE_HOME = /u01/app/oracle/product/8.1.7
System name: SunOS
Node name: surge-dev
Release: 5.6
Version: Generic_105181-23
Machine: sun4u
Instance name: visual
Redo thread mounted by this instance: 1
Oracle process number: 13
Unix process pid: 347, image: oracle@surge-dev (TNS V1-V3)
*** 2001-11-21 10:20:05.129
*** SESSION ID:(15.56179) 2001-11-21 10:20:05.105
java.lang.ArrayStoreException
at java.lang.System.arraycopy(System.java)
at java.util.Vector.copyInto(Vector.java:156)
at com.sun.net.ssl.internal.www.protocol.https.ChunkedInputStream.c([DashoPro-
V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.ChunkedInputStream.<init>([Dash
oPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.b([DashoPro-V1.2-120
198])
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.a([DashoPro-V1.2-120
198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStre
am([DashoPro-V1.2-120198])
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:145)
at ManageSSLConnection.sendXMLoverSSL(ManageSSLConnection.java:68)
In the JSSE doc, it says you can view all debugging messages by
specifying the following property: javax.net.debug=all
i.e.,
from the command line
java -Djavax.net.debug=all MyApp
This lets you see the messages before encryption and after decryption.
junkmai...@yahoo.com (Don) wrote in message news:<c08f3424.0111...@posting.google.com>...