Timeout problem using HTTP connection in MIDP

Hi,
I have one thread that does a HTTP connection (StreamConnection)with the server. In some cases, the connection is established to the server and request is sent to server, then connection hangs. I cannot check the response code since the response doesn't return back. In this case, my app also hangs on the progress bar screen. Is there any way to handle timeouts in these circumstances? How do I know if the response object doesn't return back?
Has anyone faced this problem before? Any help is appreciated.
Thanks in advance.

Hi,
i am getting the same problem. my application hangs when i close the connection when the request has been sent to the server and before the data starts downloading on the client. i mean if i cancel the connection with in that time span it hangs otherwise if i close the connection while the data is being downloaded from the sever then it works fine.
if you have sloved this problem before please explain how to slove it.
thanks,
Omar Rehman

Similar Messages

  • RFC to send an idoc PEXR2002 using HTTP connection to an external server

    Hi,
      Iam working on RFC to send an idoc PEXR2002 using HTTP connection to an external server. first time iam working on this particular scenario on http connections. please clarify on this and explai me in detail about this.
    Points will be rewarded **
    Thanks & Regards,
    Ravi

    HI Jagruthi,
    Have you loaded the metadata into the XI system by using IDX2?
    If it is done then try to delete once and do once again.
    And also delete the IDoc from IR and reimport the IDoc and activate it once again.
    Regards
    Goli Sridhar

  • Problems using https protocol to connect to open a web site

    Hi,
    I am trying to connect to a web site from my java programme. When I try connecting using htpp protocol, I am able to open the web page then I am giving the username,password to login into that web site..its working fine.
    But, When I try connecting using https protocol connection, I am not getting the page opened and after some time I am getting below error
    Exception in thread "main" org.apache.xmlrpc.XmlRpcException: I/O error while communicating with HTTP server: Connection timed out: connect
         at org.apache.xmlrpc.client.XmlRpcCommonsTransport.writeRequest(XmlRpcCommonsTransport.java:244)
         at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:151)
         at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
         at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
         at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
         at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
         at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
         at com.wipro.bugc.Test1.call(Test1.java:94)
         at com.wipro.bugc.Test1.main(Test1.java:124)
    Caused by: java.net.ConnectException: Connection timed out: connect
    Can anyone please suggest or give sample code to work with https web sites in java.
    I will have to use only https protocol to open any browser as my server only opens the web pages using https protocol
    Thanks in advance

    Hi,
    Thank you for your immediate reply. Please find the below code for your infomationa and please let me know where I am wrong..
    Below is the example we used to connect to "rojects.maemo.org" site and end up with the error I mentioned in the previous topic.
    package com.wipro.bugc;
    import java.net.Authenticator;
    import java.net.URL;
    import java.security.cert.X509Certificate;
    import java.util.HashMap;
    import java.util.Map;
    import javax.net.ssl.HostnameVerifier;
    import javax.net.ssl.HttpsURLConnection;
    import javax.net.ssl.SSLContext;
    import javax.net.ssl.SSLSession;
    import javax.net.ssl.TrustManager;
    import javax.net.ssl.X509TrustManager;
    import org.apache.http.HttpEntity;
    import org.apache.http.HttpHost;
    import org.apache.http.HttpResponse;
    import org.apache.http.auth.AuthScope;
    import org.apache.http.auth.NTCredentials;
    import org.apache.http.auth.UsernamePasswordCredentials;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.methods.HttpGet;
    import org.apache.http.impl.client.DefaultHttpClient;
    import org.apache.http.protocol.BasicHttpContext;
    import org.apache.http.protocol.HttpContext;
    import org.apache.xmlrpc.client.XmlRpcClient;
    import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
    import org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory;
    public class Test1 {
        private static void install() throws Exception {
            // Create a trust manager that does not validate certificate chains
            TrustManager[] trustAllCerts = new TrustManager[] {
                new X509TrustManager() {
                    public X509Certificate[] getAcceptedIssuers() {
                        return null;
                    public void checkClientTrusted(X509Certificate[] certs, String authType) {
                        // Trust always
                    public void checkServerTrusted(X509Certificate[] certs, String authType) {
                        // Trust always
            // Install the all-trusting trust manager
            SSLContext sc = SSLContext.getInstance("SSL");
            // Create empty HostnameVerifier
            HostnameVerifier hv = new HostnameVerifier() {
                public boolean verify(String arg0, SSLSession arg1) {
                        return true;
            sc.init(null, trustAllCerts, new java.security.SecureRandom());
            HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
            HttpsURLConnection.setDefaultHostnameVerifier(hv);
        public static void call(String url) throws Exception {
             HttpClient httpClient = new HttpClient();
             httpClient.setHttpConnectionFactoryTimeout(600000000);
            httpClient.getParams().setAuthenticationPreemptive(false);
           Credentials defaultcreds = new UsernamePasswordCredentials("username", "password");
           httpClient.getState().setCredentials(new AuthScope("projects.maemo.org", 443, AuthScope.ANY_REALM), defaultcreds);     
              HttpHost targetHost = new HttpHost("projects.maemo.org", -1, "https");
              System.setProperty("proxySet", "true");
              System.setProperty("http.proxyHost", "xxxx.com");
              System.setProperty("http.proxyPort", "xxxx");
              Authenticator proxyAuthenticator = new HttpAuthenticateProxy(
                        "username", "password");
              Authenticator.setDefault(proxyAuthenticator);
              XmlRpcClient rpcClient = new XmlRpcClient();
              XmlRpcCommonsTransportFactory factory = new XmlRpcCommonsTransportFactory(
                        rpcClient);
              factory.setHttpClient(httpClient);
              rpcClient.setTransportFactory(factory);
            XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
            config.setServerURL(new URL(url));
            config.setEnabledForExtensions(true);
              config.setEnabledForExceptions(true);           
              config.setBasicUserName("username");
              config.setBasicPassword("password");
              rpcClient.setConfig(config);      
              Map<String, String> loginMap = new HashMap<String, String>();
              String bugzillaUserName = "username";
              String bugzillaPassword = "password";
              loginMap.put("login", bugzillaUserName);
              loginMap.put("password", bugzillaPassword);
              Object loginResult = rpcClient.execute("User.login",new Object[] { loginMap });
              System.out.println("loginResult.toString() "
                        + loginResult.toString());
        public static void main(String[] args) throws Exception {
            String url = "https://projects.maemo.org/bugzilla_sandbox/xmlrpc.cgi";
            Test1.install();
            Test1.call(url);
            System.out.println("Finished.");
    }

  • Problem Using HTTP Dispatcher -- Could Not able to get the data in JSP

    Hi, I am using HTTP Dispatcher to send my events to particular URL which is a JSP page. I am trying to populate the received event through URL and populate to a oracle data base. But could not able to get the data in Oracle database.
    Code is :
    <h1>JSP Page</h1>
    <%
    long type = 0;
    String tagId = null;
    String timeStr = "0";
    String deviceName = "";
    // Get Event Parameters
    // Available Parameters: id, siteName, deviceName, data, time, type, subtype, sourceName, correlationId
    try
    type = Long.parseLong(request.getParameter("type")); // Get type
    tagId = request.getParameter("id"); // Get tagId
    timeStr = request.getParameter("time"); // Get time
              deviceName = request.getParameter("deviceName");
    catch (Exception e)
    out.println( "Error: "+e.getMessage() );
              // Write into DB.
              try {
              if ((tagId == null) || (type != 200) ){
                   // Do Nothing
                   //return;
              } else {
                   OracleDataSource ods = new OracleDataSource();
                   String URL = "jdbc:oracle:thin:@//3.235.173.16:1525/vislocal";     
                   ods.setURL(URL);
                   ods.setUser("cus");
                   ods.setPassword("cus");
                   Connection myConn = ods.getConnection();     
                   Statement stmt = myConn.createStatement();
                   String selectQuery =
                             "SELECT MAX(rfid_raw_reads_id) as max_id FROM "+
                        "cus.rfid_raw_reads ";
                   ResultSet rs = stmt.executeQuery(selectQuery);
                   String maxId = "1";
                   if (rs.next()) {
                        maxId = rs.getString(1);               
                   String selectMaxTagIDQuery =
                             "SELECT MAX(rfid_raw_reads_id) as max_id FROM "+
                        "cus.rfid_raw_reads WHERE tag_id = '" + tagId + "'" ;
                   stmt = myConn.createStatement();
                   rs = stmt.executeQuery(selectMaxTagIDQuery);
                   String maxTagId = "1";
                   if (rs.next()) {
                        maxTagId = rs.getString(1);               
                   long primaryKey = 1;
                   long tagKey = 1;
                   try {
                        primaryKey = Long.parseLong(maxId) + 1;
                        tagKey = Long.parseLong(maxTagId) + 1;
                   } catch (Exception e) {
                   long currentTime = System.currentTimeMillis();
                   long updateKey = (tagKey - 1);
                   String updateQuery = " UPDATE cus.rfid_raw_reads SET read_end_time = " + currentTime + " WHERE rfid_raw_reads_id = " + updateKey;
                   Statement updateStmt = myConn.createStatement();
                   updateStmt.execute(updateQuery);     
                   String query =
                        "INSERT INTO cus.rfid_raw_reads (rfid_raw_reads_id, tag_id,device_name,read_start_time) VALUES ("+ primaryKey + ",'" + tagId + "'," + deviceName + "'," + System.currentTimeMillis() + " )" ;
                   Statement insertStmt = myConn.createStatement();
                   insertStmt.execute(query);     
                   myConn.commit();
                   myConn.close();
              } catch (Exception e) {
    %>
    <p>For browser debug:
    <%
    out.println( "Type="+type+" ID="+tagId +" time="+timeStr );
    %>
    Kindly suggest where is the problem...
    Thanks and regards
    Mohammad Nasim Akhtar

    HI Prabhat,
    Thanx for your reply, I worked out and able to receive the data in oracle database, Actually there was some problem in insert Query. Now I have tested the same... and able to edit the same in the Database.....
    But I am facing a new problem, Http Dispatcher in SES console is displaying all the Events generated as well as event in Que but there is no events in the Event Send. I guess it is not able to send the events.....?????
    Event statical is showing like this
    Events Received: 0 (0.00/sec)
    Events Generated: 311 (0.19/sec)
    Events Sent: 2 (0.19/sec)
    Queued Events: 309 (0.19/sec)
    Kindly suggest where is the problem, Is it a JSP problem or OSES end problem.....
    Thanks and regards
    Nasim

  • Failed to use HTTPS connecting to a remote machine (SP3 WLS6.1 )

    we are currently having problem with one of our environment. When we
    try to use SSL to connect to a remote system, it seems that wls
    implementation try to do a dns lookup first before even going out
    through the proxy. The problem is that from that system wls will not
    be able to do the lookup needed. The dns is available at the proxy
    level. Thus when we use ssl in our application we always received
    UnknownHostException.
    However, the problem does not happen in the other environment running
    SP2 (NT 4.0 SP6a). For HTTP either SP2/3 works fine also.
    Have anyone experience the same problem? or can this confirm to be a
    'bug' from SP3?
    FYI: Our application (servlet) perform a request using https to a
    remote server to query some information needed (i.e. wls acting as a
    client instead of a server). To connect to the remote system, it
    needs to go through a proxy first.
    Thanks.
    Iwan.

    Chukii,
    take care that you are using the same jdk version on server and client (1.3 or 1.3.1).
    prop.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    prop.put(Context.PROVIDER_URL, "iiop://servername:1051"); works nice. I tested it - but on Windows machines.
    Your questions:
    1. yes, that's an interesting question. Next one...
    2. localhost is a good choice. I didn't change this setting
    3. JNDI is a directory service like DNS. The EJBs are registered there and can be found with the lookup(...). If you try to find something like '/home/usr...' you'll get an error message '... not bound' (or something like that). You can find your EJB with the JNDI name you entered in the Deployment Tool.
    4. Add your remote servers with 'File|Add Server...' and you'll get deploy your application on any server of your choice.
    5. iiop. ldap is for looking up something in a directory service like NIS, ActiveDirectory, etc. rmi looks quite nice, but the communication is defined as RMI over IIOP.
    hope it helps
    -chris

  • Use HTTP connection over SAPROUTER?

    hallo
    i have 2 saprouters connected so i can access sap with sapgui by using saprouter string
    /H/212.xx.xx.xxx/S/sapdp99/H/212.yy.yy.yyy/S/sapdp99/H/
    so far no problem
    i added entries in saprouttab for port 8000 as well (same es for oss service required)
    how can i now access to bsp application by using this saprouter-tunnel?
    i find a lot of documentation how to setup the saprouttab for http connection but not how to use it
    regards
    joerg

    > I bet the same applies for http.
    yes.
    If the SAP support clicks on an HTTP connection some local scripts on their PCs will act as a proxy, so basically the connect "locally" and internal programs/proxies forward that through the saprouter connections.
    To make an HTTP access from outside the network possible you can install an apache webserver and configure it as a reverse proxy.
    Markus

  • Issues using HTTP Connection Manager to run SSRS reports from SSIS

    In my package, I have a HTTP Connection Manager called "ReportServer". And I have two variables called "ReportURL" and "ReportFile". "ReportURL" is the URL for the report. I won't get into the details of this
    URL because I don't think this is the issue. "ReportFile" is the complete path and name of the output file I want to generate from "ReportURL".
    With these things in place, I have a script component that that looks like this.
    Public Sub Main()
    'Connect to http conn mgr
    Dim httpConn As ConnectionManager = Dts.Connections("ReportServer")
    Dim clientConn As HttpClientConnection = New HttpClientConnection(httpConn.AcquireConnection(Nothing))
    'file name with path
    Dim ReportFile As String = Dts.Variables("ReportFile").Value.ToString
    'report url
    Dim ReportURL As String = Dts.Variables("ReportURL").Value.ToString
    clientConn.ServerURL = ReportURL
    'Download PDFReport
    clientConn.DownloadFile(ReportFile, True)
    Dts.TaskResult = ScriptResults.Success
    End Sub
    I don't know too much about the inner workings of the above script. It's from a template I copied from somewhere and it's been working fine.
    But, today all of a sudden, it started a mysterious behavior. Let me see if I can describe it to see if this sounds familiar to anyone.
    For some reason, a run of this package failed at time T1, running with a certain value of "ReportURL" and "ReportFile". Now everytime I try to fun the package with the same "ReportURL" and "ReportFile", it fails because
    it tries to write out two files with the same name, "ReportFile", one from the current one and another from the failed one at time T1. It looks like somehow, the connection is still open from the failed one in time T1 and it won't go away.... does
    this sound like anything? Can you understand the problem I am describing?

    May it be that this post is NOT SSIS related?
    Arthur My Blog

  • Problem using HTTPS

    I am trying to post a message using HTTPS in XI.  I have defined a RFC connection to an external HTTPs partner and when I test the connection I am getting errors (the full log from dev_icm is below).  I am using client certificates and have created a PSE for it.  The third party has added my certificate to their trusted store.  The third party gets a message about non matching ciphers when I try to do the test connection.  Does anyone have any suggestions on things I can try to get this to work?  Our SAP SSL library is at the latest level.
    Regards,
    Jason
    [Thr  7] NiICheckPendConnection: connection of hdl 18 to 156.134.6.212:443 established
    [Thr  7] NiIConnect: hdl 18 took local address 14.134.160.97:64558
    [Thr  7] NiIConnect: state of hdl 18 NI_CONNECTED
    [Thr  7] <<- SapSSLSessionInit()==SAP_O_K
    [Thr  7]      in: args = "role=1 (CLIENT), auth_type=3 (USE_CLIENT_CERT)"
    [Thr  7]     out: sssl_hdl = 0x600000000097b3a0
    [Thr  7] NiIBlockMode: set blockmode for hdl 18 TRUE
    [Thr  7]   SSL NI-sock: local=14.134.160.97:64558  peer=124.148.6.212:443
    [Thr  7] <<- SapSSLSetNiHdl(sssl_hdl=0x600000000097b3a0, ni_hdl=18)==SAP_O_K
    [Thr  7]   SapISSLComposeFilename(): Filename = "/usr/sap/XID/DVEBMGS55/sec/SAPSSLTESTCL.pse"
    [Thr  7] <<- SapSSLSetSessionCredential(sssl_hdl=0x600000000097b3a0)==SAP_O_K
    [Thr  7]      in: cred_name = "/usr/sap/XID/DVEBMGS55/sec/SAPSSLTESTCL.pse"
    [Thr  7] <<- SapSSLSetTargetHostname(sssl_hdl=0x600000000097b3a0)==SAP_O_K
    [Thr  7]      in: hostname = "esmart.test.com.au"
    [Thr  7] *** ERROR during SecudeSSL_SessionStart() from SSL_connect()==SSL_ERROR_SSL
    [Thr  7]    session uses PSE file "/usr/sap/XID/DVEBMGS55/sec/SAPSSLTESTCL.pse"
    [Thr  7] SecudeSSL_SessionStart: SSL_connect() failed --
      secude_error 536875072 (0x20001040) = "received a fatal SSLv3 handshake failure alert message from the peer"
    [Thr  7] >> -
    Begin of Secude-SSL Errorstack -
    >>
    [Thr  7] WARNING in ssl3_read_bytes: (536875072/0x20001040) received a fatal SSLv3 handshake failure alert message from the peer
    [Thr  7] << -
    End of Secude-SSL Errorstack -
    [Thr  7]   SSL_get_state() returned 0x00002120 "SSLv3 read server hello A"
    [Thr  7]   No certificate request received from Server
    [Thr  7] <<- ERROR: SapSSLSessionStart(sssl_hdl=0x600000000097b3a0)==SSSLERR_SSL_CONNECT
    [Thr  7] <<- SapSSLErrorName()==SSSLERR_SSL_CONNECT
    [Thr  7] *** ERROR => IcmConnInitClientSSL: SapSSLSessionStart failed (-57): SSSLERR_SSL_CONNECT [icxxconn_mt.c 2012]
    [Thr  7] <<- SapSSLSessionDone(sssl_hdl=0x600000000097b3a0)==SAP_O_K
    [Thr  7] IcmConnConnect(id=1/20625): free MPI request blocks
    [Thr  7] MPI<55b>2#7 GetInbuf -1 1a6ca0 306 (1) -> 6
    [Thr  7] MPI<55a>3#4 GetOutbuf -1 1c6d20 65536 (0) -> 0xc0000001ac1c6d40 0
    [Thr  7] NiIGetServNo: servicename '8055' = port 1F.77/8055
    [Thr  7] MPI<55a>3#5 FlushOutbuf l-1 1 1 1c6d20 2168 6 -> 0xc0000001ac1c6d20 0
    [Thr  7] NiICloseHandle: shutdown and close hdl 18 / sock 30
    [Thr  7] IcmConnFreeContext: context 1 released
    [Thr  7] IcmServDecrRefCount: xidsapci.test.local:8056 - serv_ref_count: 1
    [Thr  7] IcmWorkerThread: Thread 3: Waiting for event

    Hello Jason,
    I believe the possible issue could be due to incorrect values to the following profile parameter
    snc/permit_insecure_start
    If SNC is activated (parameter snc/enable = 1 ), by default the
    gateway does not start any programs that communicate without
    SNC.
    This is allowed with snc/permit_insecure_start.
    Please check the instance profile parameter for the same.
    Cheers

  • Problem using HP Connect with my HP Photosmart C410

    I am trying to use HP Connect apps with my HP Photosmart C410 printer. I can add the device, but none of the apps seem to work with my printer It'a not THAT old. Any suggestions?
    This question was solved.
    View Solution.

    HI beachgrl,
    Welcome back to the HP Support forums.  I understand that you would like to learn what printables are available for your Photosmart C410 printer in HP Connected.
    Once you are signed into your HP Connected account, if you type the link listed below into the address bar on your browser it should take you to a page that shows the printables you already have on your printer. Below the "Recommended Printables" section there is a search function.  If you type in your printer model it will list the printables available for the Photosmart C410a. The results will be grouped by category.  I have included a screen shot.
    The address you need to type into your browser address bar is  https://printables.hpconnected.com
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • Problem with socket connection in midp 2.0

    hello everyone.
    I'm new one in j2me and I am learning socket connection in j2me. I'm using basic socket,datagram example wich is come with sun java wireless toolkit 2.5. for it i wrote small socket server program on c# and tested it example on my pc and its working fine. also socket server from another computer via internet working fine. But when i instal this socket example into my phone on nokia n78 (Also on nokia 5800) it's not working didn't connect to socket server.. On phone I'm using wi-fi internet. Can anybody help me with this problem? I hear it's need to modify manifest file and set appreciate pressions like this
    MIDlet-Permissions: javax.microedition.io.Connector.socket,javax.microedition.io.Connector.file.write,javax.microedition.io.Connector.ssl,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.http,javax.microedition.io.Connector.https
    is it true?
    can anybody suggest me how can i solve this problem?
    where can I read full information about socket connection specifiecs in j2me?
    Thanks.

    Maybe this can be helpful:
    [http://download-llnw.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/index.html]
    you can check there the Datagram interface anda DatagramConnection interface and learn a little about that.
    If the client example runs fine in the wireless toolkit emulator, it should run the same way in your phone; i suggest to try to catch some exception that maybe is hapenning and display it on a Alert screen, this in the phone.

  • Problem using JDBC connection

    I'am using 9iAS R2 and I have a entity bean using a DataSource with out any problem, but I also have a client program using the same datasource. I can lookup the datasource without any problems, I get a connection, but when I try to createStatement() on the connection I get an Exception see below.
    I hope some one can help me!
    Regards
    Morten
    java.lang.NullPointerException
         at com.evermind.sql.OrionPooledDataSource.addUsedConnection(OrionPooledDataSource.java:539)
         at com.evermind.sql.OrionPooledDataSource.getPooledInstance(OrionPooledDataSource.java:290)
         at com.evermind.sql.OrionCMTConnection.setConnection(OrionCMTConnection.java:189)
         at com.evermind.sql.OrionCMTConnection.intercept(OrionCMTConnection.java:127)
         at com.evermind.sql.FilterConnection.getMetaData(FilterConnection.java:75)
         at com.evermind.sql.FilterConnection.getMetaData(FilterConnection.java:76)
         at dk.modulus.regelmaskine.RegelParamDAO.getRegelParametre(RegelParamDAO.java:33)

    Hi Morten,
    Have you tried running OC4J in "debug" mode? This web page has more details:
    http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
    You may also like to try "P6Spy"
    http://www.theserverside.com/home/thread.jsp?thread_id=8337
    And here is a web page from Oracle's "Technet" site regarding debugging
    OC4J:
    http://otn.oracle.com/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.html
    Hope this helps you.
    Good Luck,
    Avi.

  • Weird problem with http connection

    hi,
    i'm trying to implement a midlet that connects the mobile to an http server. i've downloaded several midlets and also tried the method given in the MIDP2 api documentation, but i doesn't work, it can't connect.
    i tried it on several phones and some of them freeze during the Connector.open method, but the Nokia 6230i tells that i have to register to GPRS services before i can connect this way. :(
    how is it that i can't connect with my midlet but i can do it through the wap function of the phone ? how can i bypass this problem ?
    thanks.

    i went to the parameters menu and changed "GPRS connection" to "permanent" but it didn't change anything. there doesn't to be any other paramter that could help with this. :(

  • Problems with https connection

    Hi there.
    I use java1.4 and tomcat 4.0.I have trusted certificate.
    And my code is:
    try{
    URL url = new URL("https://localhost:443/index.html");
    URLConnection con = url.openConnection();
    BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String str;
    while((str=reader.readLine())!=null)System.out.println(str);
    It makes exception:
    java.io.IOException: HTTPS hostname wrong: should be <localhost>
    at sun.net.www.protocol.https.HttpsClient.b(DashoA6275)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA6275)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:556)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(DashoA6275)
    at zmrd.main(zmrd.java:23)
    What have I done to avoid it?
    Thnaks for your answer.
    Tomas

    Some things you could check are: Make sure the value of CN in your certificate contains your host name and also make sure your host name in the Tomcat host aliases this might help: http://java.sun.com/webservices/docs/1.0/tutorial/doc/Admintool4.html#64446

  • Problem using jsf  connection db

    i have this problem:
    I have defined a connection as a variable in a jsfbean with scope session scope.
    Clicking very quicly on a field on the form I get the message: sql result set closed and my connection variable is null.
    It seems a thread problem ; only one browser is open and I click inside the only form that I have.
    How may I resolve the problem ?
    I use Myfaces 1.1.5 and Tomahawk 1.1.5

    i have this problem:
    I have defined a connection as a variable in a jsfbean with scope session scope.
    Clicking very quicly on a field on the form I get the message: sql result set closed and my connection variable is null.
    It seems a thread problem ; only one browser is open and I click inside the only form that I have.
    How may I resolve the problem ?
    I use Myfaces 1.1.5 and Tomahawk 1.1.5

  • Using Https to connect to a secure site in J2ME

    I have successfully been able to get a midlet using HTTPS connections to work using the J2ME wireless toolkit and following the instructions in this paper.
    http://developers.sun.com/techtopics/mobility/midp/articles/https/
    I would like to get Https working on a real device now like the Moto RAZR or Samsung A900 etc. Was wondering if someone has experience with HTtps on devices and help answer my questions.
    Would I have to use certificates issued by one of the following CAs like thawte,verisign etc and include it on the apache server and then the device would automatically install the certificate when a HTTPS connection is made to the server?
    Can self signed certificates be used on the devices , if yes how can they be imported onto the device?
    Please help.
    Thanks!

    Hi jpsscott,
    I am glad to hear you resolved the issue. Thanks for sharing your experience here, it is good to other members who experience the same issue in the community. If you
    have any other questions about XCode and TFS, you can open a new thread in
    TFS- Eclipse and cross platform forum for a better response.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Verizon Edge Truth

    So after endless research and speaking with CS reps, I've decided to share the interesting details that I've come across for any that may be interested.  Background:  About 2 weeks ago I contacted Verizon in regards to the Edge program.  I "thought"

  • IPod cannot be updated/restored/ejected--files in use by another app

    Since I downloaded iTunes7, I cannot update, restore, or eject my iPod from iTunes. I get the error "<iPod name> cannot be updated(restored, ejected) because it contains files in use by another application." I'm still able to sync music and tv shows

  • Dot1x not working in conjunction with PortSecurity on Cisco 4500

    It's observed that – Phones are not coming up on network when 802.1x is enabled on port. After troubleshooting it's noted that Port-Security restricts phones not to operate either in Data or Voice Vlans. Problem gets resolved by disabling port-securi

  • Sound problem during play-back

    Dear friends After recording images with my MSI TV-Tuner card, i cant get any sound during play back. First i had Win-Amp installed on my system that i thought may be it is the cause of the problem. After uninstalling the win amp, again the problem e

  • To create custom colors for exception

    Hi experts...... I need to create custom colors for my report in order to set exceptions. Shades of red,yellow and green is just not enough for my client, they want to see blue as well when certain exception rises. Can someone please give me a hint a