1 Reply Latest reply on Mar 2, 2005 9:43 AM by rafcio

    javax.net.ssl.HttpsURLConnection Problem

    rafcio

      Hi,

      I want make an HTTPS connection from JBoss:

       // build url and connection
       URL url = null;
       try {
       url = new URL(mmsURL);
       }
       catch (MalformedURLException murle) {
       logger.fatal("sendMMS() failed build url to mmsURL=" + mmsURL, murle);
       throw new OMAException("MMS::sendMMS() failed build url to mmsURL=" + mmsURL, murle, ErrorIDs.FATAL_ERROR);
       }
      
       // open connection
       javax.net.ssl.HttpsURLConnection conn = null;
       try {
       conn = (javax.net.ssl.HttpsURLConnection) url.openConnection();
       conn.setSSLSocketFactory(ctx.getSocketFactory());
       }
       catch (IOException ioe) {
       logger.fatal("sendMMS() open connection failed to mmsURL=" + mmsURL, ioe);
       throw new OMAException("MMS::sendMMS() open connection failed to mmsURL=" + mmsURL, ioe, ErrorIDs.FATAL_ERROR);
       }
      


      But I get an ClassCastException while url.openConnection() an

      com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
      


      What cann I do?


      Regards,
      Rafal