• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

X509CertificateImpl CastException in JSP

Kevin Scott
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I have a jsp page that calls a cold fusion web page over https, and reads the data found there. My code is as follows:
String urlString = /*https URL here*/
java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("javax.net.ssl.trustStore","keystore"); System.setProperty("javax.net.ssl.trustStorePassword","keystore password");
URL url = new URL(urlString);
URLConnection conn_c = url.openConnection();
HttpURLConnection conn = (HttpURLConnection)conn_c;
InputStream stream = conn.getInputStream();
BufferedReader in = new BufferedReader(new InputStreamReader(stream));
String line = "";
String valid = "";
while( (line = in.readLine()) != null){
valid = line;
This seems to work fine, but the jsp is crashing sometimes with the error: java.lang.ClassCastException: oracle.security.cert.X509CertificateImpl at the line of code where I open the InputStream from the connection. Once this starts, only an opmnctl stopall and startall seem to fix this error. Once this is working, it seems to continue working correctly for quite a while (a few days at least). We have other systems that use the same code, and they don't seem to suffer from this problem, does anyone have any idea what is incorrect here to cause this?
Thanks in advance
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic