Non-Blocking SocketChannel read give Connection timed out

Hi,
My program is using Non-Block NIO SocketChannel for both Server and Client sides. However, if the connection between server and client has been idle for a while, when the client try to communicate with server, it gets blocked for a while (15 minutes) and then receives the following exception:
java.io.IOException: Connection timed out
     at sun.nio.ch.FileDispatcher.read0(Native Method)
     at sun.nio.ch.SocketDispatcher.read(Unknown Source)
     at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
     at sun.nio.ch.IOUtil.read(Unknown Source)
     at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
How can this be since the read is in Non-Blocking mode? Also, is there anyway to determine the timeout without being blocked?

This would mean that you are trying to read from the socket without having properly completed the connection, which timed out. I would say you are connecting in non-blocking mode but not calling finishConnect() when you get OP_CONNECT.

Similar Messages

  • OpenMarket sms api gives "Connection timed out: connect"

    Hello All,
    I am new to web applications with sms services.
    I am trying to send sms from my java application to mobile device. But I am getting below error.
    Aug 25, 2010 10:55:58 AM com.eha.sms.ema.EMACMMessageSendProxy init
    INFO: Move to send the receiver initialization.
    Destination address = +**********
    Source addres = +*****
    Sending message to Simplewire...
    REQUEST XML ==
    <?xml version="1.0" ?>
    <request version="3.0" protocol="wmp" type="submit">
         <user agent="Java/SMS/2.9.16"/>
         <account id="******************" password="***************"/>
         <option type="production"/>
         <source ton="0" address="+*****"/>
         <destination ton="0" address="+**********"/>
         <message udhi="false" text="Hello World!"/>
    </request>
    protocol: http
    remote host: ******Some site given to us by open market people that opens on browser**********
    remote port: 8080
    remote file: /wmp
    {main} [10:55:58.722] Conn: added module com.simplewire.http.RetryModule
    {main} [10:55:58.725] Conn: added module com.simplewire.http.AuthorizationModule
    {main} [10:55:58.726] Conn: added module com.simplewire.http.DefaultModule
    {main} [10:55:58.747] Conn: Creating Socket: smsc-01.openmarket.com:8080
    {main} [10:56:19.759] Conn: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at com.simplewire.http.HTTPConnection$_A.run(Unknown Source)
    Message was not sent!
    Error Code: 106
    Error Description: A connection could not be established with the Simplewire network. Connection timed out: connect
    Error Resolution:
    The code I am using is as below.
    private void config()
              Properties properties = new Properties();
              InputStream smscmReceiver = EMACMMessageSendProxy.class.getClassLoader().getResourceAsStream("sms.properties");
              try
                   properties.load(smscmReceiver);
                   System.out.println(properties.getProperty("SMS.SubscriberID").trim());
                   System.out.println(properties.getProperty("SMS.Password").trim());
                   System.out.println(properties.getProperty("SMS.DestinationAddress").trim());
                   System.out.println(properties.getProperty("SMS.SourceAddress").trim());
                   SMS sms = new SMS();
                   // subscriber settings
                   sms.setRemoteHost(" ******Some site given to us by open market people that opens on browser**********");
                   sms.setDebugMode(true);
                   sms.setRemotePort(8080);
                   sms.setSubscriberID(properties.getProperty("SMS.SubscriberID").trim());
                   sms.setSubscriberPassword(properties.getProperty("SMS.Password").trim());
                   // Message Settings
                   sms.setDestinationAddr(properties.getProperty("SMS.DestinationAddress").trim());          // recipient of message
                   sms.setSourceAddr(properties.getProperty("SMS.SourceAddress").trim());               // originator of message
                   sms.setMsgText("Hello World!");
                   System.out.println("Sending message to Simplewire...");
                   // submit message and check results
                   if (sms.submit())
                        System.out.println("Message was sent!");
         System.out.println("Ticket ID: " + sms.getMsgTicketID());
                   else
                        System.out.println("Message was not sent!");
                        System.out.println("Error Code: " + sms.getErrorCode());
                        System.out.println("Error Description: " + sms.getErrorDesc());
                        System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n");
              } catch (IOException e)
              log.error("Load profile sms.properties failed to send Move.", e);
    I am using windows 7 and the required info from the java code is picked up from a property file.
    destination address is a "+" sign followed by cell number of client in US and I am in diff country.
    source code I am using is "+" sign followed by a short code given by client.
    I am also not aware what short codes are for.
    I am also not sure whether I am passing correct parameters.
    I just followed a demo code from the api's sample file. (open market api......swsms-2.9.16 is the jar used.).
    would like to know If destination address can be my cell number.
    The open market people have configured the demo short code for our SMS messaging account.
    This feature will allow us to test our platform to send and receive SMS messages
    while we are waiting for our dedicated short code.
    Mobile Originated messages MUST start with our assigned keyword(s) to be routed to you.
    We have a few keywords but don't know how to use them.
    Please help!
    Thanks in advance.
    Edited by: Vish_1x1 on Aug 24, 2010 11:06 PM

    I had a same problem.
    It was definately URL and SOAP Action Problem.
    Also, I didnt configure the Proxy too.
    Please dont waste more time in looking inot other configs.
    Just give a careful look at Target URL and SOAP Action, again and again.
    Sweta , Please make this question Answerd , it will be useful for other users.
    And Bahvesh Deserves good points..
    Thanks ,
    Deo.

  • Add-on connection timed out Error

    Hi all,
          I have created an add on following sdk help. (ie; a blanket project). The add - on installs properly but while runnig it gives connection timed out error. I have found a lot of similar threads in the form. but all of them uses B1DE. And the B1DE is not getting installed properly in my system . the installation of B1DE completes sucessfully but i dont find any SAP templates in my Visual studio 2005. I suppose its a B1DE version problem since while installing it is asking for vsual basic .net 2003 path where as I have oly VS 2005. From where do I get B1DE versionfor VS 2005 ?
    Regards,
    Priya

    Priya,
    You download B1DE from the same area as you download the B1DE for VS 2003.
    https://www.sdn.sap.com/irj/sdn/businessone?rid=/webcontent/uuid/a175fb62-0c01-0010-a8b5-fa58a13b1cf7 [original link is broken]
    You need to download B1DE for VS 2005.
    Eddy

  • Wget - Connection timed out when using "long" strings

    I'm having a problem with a little script to change some settings for IP-phones. Here is the script:
    #!/bin/bash
    for i in "0" #"4"
    do
    for j in $(seq 176 176)
    do
    wget --timeout=1 --tries=1 --keep-session-cookies --save-cookies cookies.txt --post-file=postfile http://192.168.$i.$j/dologin.htm
    wget --timeout=1 --tries=1 --load-cookies cookies.txt --post-file=postfile2 http://192.168.$i.$j/update.htm
    done
    done
    postfile looks like this and is just for logging in:
    P2=<pass>&
    postfile2 looks like this:
    P270=123456&
    The problem now is, when using it like above, everything works fine. But if I make the text in postfile2 one character longer, I get this:
    Connecting to 192.168.0.176:80... connected.
    HTTP request sent, awaiting response... Read error (Connection timed out) in headers.
    Giving up.
    It doesn't matter where I put the character to make the string longer (I can for example use P32=1234567& and it works). I have tested the script from different machines and used different phones, always the same. Any ideas?

    daf666 wrote:The two files look identical, are you sure that the "bad" one is actually a capture of the timed out session? (both have same data length and same value in the content-length header).
    Yes, they are different and the bad is is from the timeout .
    daf666 wrote:Anyway, this timeout might occur, if for some reason wget will say content length is 10 and send only 9 characters in the post request..
    Any idea what I can do about it? There is something fishy going on. I did this once before a few month ago when I wanted to change other settings. I tried to do the same thing again but even this doesn't work anymore. Maybe I should just try curl .

  • I started getting a Timed Out error message on my iPhone 5 when browsing the web that reads Page could not be loaded.  Connection timed out.  I performed a Reset Network Settings and still get the error.  What is the fix?

    I started getting a Timed Out error message on my iPhone 5 when trying to browse the internet tthat reads Page could not be loaded.  Connection timed out.  I performed a Reset Network Settings and am still getting the error message.  What is the fix?

    Thanks so much for more direction. 
    I realized that I bought this iPod T4 about a year ago, so decided to check the date and it is still under the 1 year ltd. warranty until 21 Dec.  I contacted Apple via Chat and was informed that the problem may lie in the version of iTunes I was running 10.7.  Today Apple released v. 11 of iTunes which I was instructed to download.  It's TOTALLY different from iTunes 10.7 - drastically different in fact. 
    The Apple Chat Rep set up a phone call appointment forl 8:00 pm ET tonight where another Rep will call me to make sure the restore was accomplished OK.  With v. 11 of iTunes I can't even find the restore option!!!  The phone Rep will have to help me navigate v. 11 of iTunes.  It doesn't seem intuitive at all.  Maybe it's just me?!?!
    Thank you for sending this new link for firmware.  It's not clear to me right now whether I'll need it or not.  The phone Rep will probably somehow be able to resolve the problem.  If not, they'll probably send me to the nearest Apple store if the problem is hardware, as it would be covered under the warranty.  I will give another update as to what transpires as a result of the phone call with the Apple Rep.
    Again, thank you so much for helping me. 

  • I tried to update my iphone to ios 5 but it gives me error ( the network connection timed out )

    i tried to update my iphone to ios 5 but it gives me error ( the network connection timed out )

    If you don't tell us the error, we can't help you

  • Nokia Internet Radio Error: Connection Timed Out. ...

    Hi,
    I'm having an issue with the Nokia Internet Radio application on the Nokia N95. The app launches ok but if I try and browse the station directory or perform a search I get the error 'Connection Timed Out. Try Again' This happens almost instantly i.e. it doesn't look like it's even trying to connect. If I go to the shoutcast site and click on the 'Tune In' button next to a station the Internet radio app launches and I get an error saying 'General: System Error' and the application closes then goes back to the browser and a message saying 'Web: No Gateway Reply' The application worked fine up until recently. I upgraded to FW V 21.0.016 and hasn't worked since so it may be that this has caused the problem. I've removed and re-downloaded \ re-installed the software but still get the same issue. Web browsing works fine, so I know my internet settings are fine, and the old open-source version of the radio player even works so it's just an issue with this app. Any advice on how to fix it would be much appreciated. Thanks.

    I had the same problem and I fixed it.  For me, it was because I am on the Rogers network in Canada.  Regardless of where you are many cellular neworks use firewalls and something called NAT (Network Address Translation).  Nokia should really make people aware of this because probably 50% of people around the world have this problem.  The solution for me was to use Rogers VPN or Public IP to access the internet.  Rogers blocks access to this internet connection so you have to add the service to your account for $10 per month but I have heard that other carriers like FIDO have not blocked access to it.
    On the Nokia n79 this requires creating a new access point under TOOLS>SETTINGS>CONNECTIONS>DESTINATIONS.  Add a new access point with the following settings:
    Connection Name: Rogers VPN (or whatever you want to call it)
    Data Bearer: Packet Data
    Access Point Name: vpn.com
    User Name: wapuser1
    Prompt Password: No
    Password: wapuser
    Authenticaiton: Normal
    Homepage: None
    Use Access Point: After Confirmation (or change if you want something else)
    That's it. When you load the internet radio Application and it lists your options select "Rogers VPN".  If you don't see it in the list, press the soft button for Options then "Select Access Point" and you will see the full list.  If you want the VPN to be the first thing you see you can change the priority under destination settings.  Just select the VPN and press "Organize" then "Change priority". 

  • Cannot login to Facebook on my iPhone 5 iOS 8.1 - Connection timed out - Error signing in

    The other day, I had logged out of Facebook on my iPhone, and when I tried logging back in, it wouldn't let me. When I try to log in through the settings page, it stays on verifying for a while and says "Error signing in" and tells me there is no internet connection and when I try logging in through the facebook app, it says "Connection timed out" and asks me to make sure i have an active internet connection. The fact is my internet is working, and I can log in to facebook through safari, but not my app.
    And one more thing. I have tried most of the methods mentioned in the forums. I have spent the last 2 days trying all of them from trying to create a new account using the old details, remove the phone number from facebook and try again, hard reboot by pressing the home and power buttons, resetting network and privacy settings, and reinstalling the app about 3-4 times. None of these work.
    I'd be grateful if somebody can help me out with this .
    Phone specs: iPhone 5, 16GB memory,  iOS 8.1

    Dear Sir,
    I did some research about your subject and I found these, please check it out
    iPhone stuck on Apple logo!!! PLEASE HELP!
    It may help you
    <Link Edited By Host>

  • Error: Network Connection Timed Out

    I am beyond ****** off at the moment. My iTunes was working perfectly until two weeks ago, and now it insists my Network Connection Timed Out when I try to access the store or update podcasts.
    It can't be my internet connection, because as you can see, I'm able to access the internet. For some reason it's this specific copy of iTunes (7.5), because the iT7 downstairs works perfectly. Of course, since Apple are so fecking stingy, I can't add a few files from there without wiping everything off my iPod.
    So here's the run-down:
    I'm using a Dell Inspiron 8600, Windows XP, browsing with Firefox and attempting to load the latest podcasts onto my iPod Shuffle. I don't give a toss about downloading songs, I just want to update my podcasts without having to search the net for the source file.
    I ran the Network Diagnostics and it insists the Conneciton to iTunes failed, suggesting I adjust my cable (i don't have one - it's wireless) or flush my dns settings (which i've done several times).
    I found a thread on these forums from March and tried every solution:
    - uninstalling and reinstalling itunes... doesn't work.
    - opening Internet Explorer 7, then opening iTunes... doesn't work.
    - searching for a host file and removing the phobos apple line... doesn't work. The phobos line wasn't there
    - using itunes 7... doesn't work.
    - flushing my dns... doesn't work.
    - turning off my firewall.... doesn't work.
    - avoiding clashes with mcafee or zone alarm... doesn't work, cos i don't use those
    I think it's appalling that I've tried all this, and i'm still no closer to knowing what the problem is, and that Apple failed to respond to any of the other people's problems in the earlier thread. And that i spent about ten minutes signing up to this fecking forum just to ask for help. Surely support should be readily available to anyone!
    Can anybody help me? In the other thread, people found alternative sites for buying music, but has anyone got an alternative, ipod-compatible podcasting program?

    I have this same problem. Here's what I can add to this discussion - iTunes accessed the iTunes store a day or two ago. I have a home network and can access the internet from all of the networked PCs. I can access the iTunes store from all of the networked PCs using Internet Explorer. I can access the iTunes store from my laptop iTunes. I can not access the iTunes store from my workstation PC. I get the same "network connection timed out" message. I downloaded and installed a new (same version) of iTunes on the workstation PC. both the laptop and the workstation are running the same OS (Windows XP SP2), both are Dell computers, both are accessing the internet via a wired connection to the same switch and the same router. All other internet connections work fine.
    What's different? In the last couple of days my Workstation lost access to a network printer. I worked with HP for over an hour to re-establish network connection to that printer with no success. I have access to the same networked printer from my laptop.
    The IP address for the network printer is identical to what it was when it was installed - HP suggests looking for a change to the IP address. I made no changes to the workstation PC, the home network or the router, ISP, or internet connection.
    But, it seems to me that the loss of access to the HP networked printer and the inability of iTunes to access the iTunes store are related.
    I also called Apple and attempted to get technical support. I own 4 iPods with 104 Gbs of storage on them, I own 1900 CDs and iTunes has 36.5 days of music loaded into it.
    I purchased Apple Care on all of the iPods - it's expired and they never warned me. They want to charge me $29 to fix this problem - even though I no longer can purchase music via the iTunes Store, so I need to pay $29 in order to gain access to the iTunes store to spend more money with Apple?! Not a smart business decision. I own a few other PC based music programs and more than willing to transfer all of it out of iTunes and into one of the other products. I'll sell all the iPods on eBay and purchase other MP3 players if I must.
    But, I suspect the problem is (1) Apple doesn't have a documented answer to this problem, (2) the level 1 techs that answer the support phone are clueless - they just e-mailed me the same article from the Apple website that I told them I read and does not apply to my problem, and obviously does not resolve my problem. (3) Apple is not setup to resolve this type of problem with their level 1 support, and they can't escalate the problem without charging us.
    I'll try again on Monday, may even purchase Apple Care first and then use that. The Apple Care Tech Support is typically better than the free level 1 call in support.
    Suggestions, comments, etc. are all appreciated.
    nlc
    <SCRIPT language=JavaScript>
    <!--
    var SymRealOnLoad;
    var SymRealOnUnload;
    function SymOnUnload()
    window.open = SymWinOpen;
    if(SymRealOnUnload != null)
    SymRealOnUnload();
    function SymOnLoad()
    if(SymRealOnLoad != null)
    SymRealOnLoad();
    window.open = SymRealWinOpen;
    SymRealOnUnload = window.onunload;
    window.onunload = SymOnUnload;
    SymRealOnLoad = window.onload;
    window.onload = SymOnLoad;
    //-->
    </SCRIPT>

  • "The network connection timed out" Update/Restore using iTunes

    Can anyone help with this problem. Ever since IOS 7.0 was released, iTunes is so broken when it comes to updating the software or restoring iPhones. Everytime I try to restore or update I get the error "There was a problem downloading the software for the iPhone. The network connection timed out." after waiting for the 20min download. For one thing there is nothing wrong with my network connection it's fine, I cannot access the itunes store the whole nine yards, it's just when I need to update or restore the phone. It takes 20 mins to download then it gives me this stupid error. I have tried everything I've seen on the forum that others have tried with disabling virus scanners and other 3rd party software and nothing! The funny thing is, it happens on every computer in the house, even my Mac notebook, so it seems like it's tracking the Baja network connection, but I don't have any problems with anything else we are using, it's just with iTunes. We were using OpenDNS, so I removed that from the router and I still have the some problem. Does anyone know a way around this problem. I am so ready to bail on apple products. Frustrating....
    I would appreicate any help in resolving this problem....
    Tnx

    Did you make sure it was the exact file for your device and the latest version? I just downloaded the latest file for my iPhone4, put it in the folder I mentioned above and it ran the install versus downloading the file. This problem where it times out after downloading is a big Bug within iTunes that has been there ever since IOS 7.0 was released. I wished these apple developers would just fix iTunes. There are a ton of complaints about this issue. I sure miss Steve Jobs running this business, I really feel like it's gone down hill after he left.
    I hope this helps! 
    Regards.

  • Can't download software updates in iTunes - error message "network connection timed out"

    I'm unable to download software updates for my iTouch 4.1 in iTunes.  I have iTunes version 10.5, Windows 7.  i've tried numerous times in the past and always get the same error message.  I'm now experiencing problems with some of my apps. and I've attempted 4 times in the past 2 days to upload version 5.0. It goes thru the whole download (761.61 MB), says "processing file", then closes out and I get the following message:
    "There was a problem downloading the software for the iPod "xxxxx's iPod". The network connection timed out. Make sure your network settings are current and your network connection is active or try again later. Err = .3529." 
    I ran diagnostics and it said everything was fine. 
    Also not all the apps. on my iTouch are in my iTunes library even though I've synced my iTouch numerous times since I've purchased the apps. with my iTouch.  All the apps on my 2nd screen are on iTunes, but none of the apps. on my 3rd screen of my iTouch are in iTunes. 

    Did you check your security software settings? Troubleshooting security software issues
    iTunes has to be able to contact Apple during the download of the software and the update process.

  • ITMS network connection timed out error

    ok so every time i try to log on to the music store i get the error that says im unable to connect to the music store cause the "network connection timed out" Under network connections on my comp. all i have is the disabled LAN network thats already there. Every other program automatically goes to AOL, but itunes doesnt want to. is there any way to chance this. I have seen sooo many people with this same problem, and ive tried all the suggestions that people have given them. im DESPERATE and im hoping this wll help. give me any suggestions youve got. my ipods will be useless without itunes. i already have all my cds and playlists ready. i just want all that other music!!!!! i have itunes 6, and i use AOL i just dont know what to do!!!HELP!!!

    You will need to restart from the beginning. Try temporarily turning off all your firewall and antivirus software until the download has completed and see if that stops the network timeout.

  • Itunes error: network connection timed out

    Every time I try and log into my Itunes account I get an error message saying We could not complete your Itunes Store request. The network connection has timed out. How can I fix it?
    Edit: My virus scanner is Avg and I use ad-aware 2007 for spyware. I can't find a feature with either one that would block i tunes. Also, it's an allowed application with windows firewall.
    Message was edited by: touch84

    Ive been having this problem for over 24 hours now. Bad bit is that I had restored my iphone just before this so ive been stuck without a mobile phone since then.
    Symptoms:
    Iphone appears in itunes but when the iphone tries to get onto the store to finish re-activation the connection hangs and then i get the error "we could not complete your itunes store request. the network connection timed out".
    I can browse the itunes music store + podcast store and i can download podcasts.
    Safari is working perfectly.
    Anything anyone can suggest would be a big help. I presume it it apple's server's fault.

  • Connection timed out when try to connect orb through iiop

    I have been trying to test a very basic corba example in weblogic 11g, it narrows an orb sucessfully with naming service, but I got connection timed out error when trying to call a function in the orb. My weblogic and my source code are on the same machine and I connect it with browser(coz it is a web application), so I doubt if it is firewall issues, but I could be wrong. I appericate so much if anyone can help.
    Here is the error message I got, you can see I listed all the objects in the naming service and I am able to locate Hello object:
    >
    Context: weblogic
    Object: Hello
    Context: javax
    Obtained a handle on server object: oraclecorba._HelloStub:Delegate(532227) [weblogic.iiop.IOR[IDL:oraclecorba/Hello:1.0] @xx.x.xx.xxx:xxxx, <0, null>]
    org.omg.CORBA.COMM_FAILURE: Connection timed out vmcid: 0x0 minor code: 0 completed: No
    at weblogic.iiop.Utils.mapToCORBAException(Utils.java:885)
    at weblogic.corba.idl.RemoteDelegateImpl.request(RemoteDelegateImpl.java:311)
    at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:431)
    at oraclecorba._HelloStub.sayHello(_HelloStub.java:18)
    at oracle.demo.corba.MyJSPHelper.jspSayHello(MyJSPHelper.java:71)
    at jsp_servlet._pages.__corbajsp._jspService(__corbajsp.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3594)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at weblogic.socket.SocketMuxer.newSocket(SocketMuxer.java:342)
    at weblogic.socket.ChannelSocketFactory.createSocket(ChannelSocketFactory.java:79)
    at weblogic.socket.BaseAbstractMuxableSocket.createSocket(BaseAbstractMuxableSocket.java:133)
    at weblogic.iiop.MuxableSocketIIOP.newSocket(MuxableSocketIIOP.java:266)
    at weblogic.iiop.MuxableSocketIIOP.createSocket(MuxableSocketIIOP.java:253)
    at weblogic.socket.BaseAbstractMuxableSocket.connect(BaseAbstractMuxableSocket.java:106)
    at weblogic.iiop.MuxableSocketIIOP.connect(MuxableSocketIIOP.java:238)
    at weblogic.iiop.MuxableSocketIIOP.createConnection(MuxableSocketIIOP.java:222)
    at weblogic.iiop.EndPointManager.createEndPoint(EndPointManager.java:464)
    at weblogic.iiop.EndPointManager.findOrCreateEndPoint(EndPointManager.java:239)
    at weblogic.iiop.EndPointManager.findOrCreateEndPoint(EndPointManager.java:256)
    at weblogic.iiop.IIOPRemoteRef.locateIORForRequest(IIOPRemoteRef.java:383)
    at weblogic.corba.idl.RemoteDelegateImpl.getInvocationIOR(RemoteDelegateImpl.java:535)
    at weblogic.corba.idl.RemoteDelegateImpl.request(RemoteDelegateImpl.java:256)
    ... 19 more
    >
    Here are my source code
    Server side
    package oracle.demo.corba;
    import oraclecorba.Hello;
    import oraclecorba.HelloHelper;
    import org.omg.CORBA.ORB;
    import org.omg.CosNaming.Binding;
    import org.omg.CosNaming.BindingIteratorHolder;
    import org.omg.CosNaming.BindingListHolder;
    import org.omg.CosNaming.BindingType;
    import org.omg.CosNaming.NameComponent;
    import org.omg.CosNaming.NamingContext;
    import org.omg.CosNaming.NamingContextExt;
    import org.omg.CosNaming.NamingContextExtHelper;
    import org.omg.CosNaming.NamingContextPackage.NotFound;
    import org.omg.PortableServer.POA;
    import org.omg.PortableServer.POAHelper;
    import weblogic.common.T3ServicesDef;
    public class ORBStartup{
         private T3ServicesDef t3servicesdef;
         public void setServices(T3ServicesDef t3servicesdef)
            this.t3servicesdef = t3servicesdef;
         public static void main(String[] args)
            throws Exception
             try{
                  args = new String[4];
                  args[0] = "-ORBInitialHost";
                  args[1] = "some_address";
                  args[2] = "-ORBInitialPort";
                  args[3] = "8056";
                  System.out.println("...............startup...........");
                   // Create a new object request broker
                   ORB orb = ORB.init( args, null );
                   // get the root POA
                   POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
                   // Activate PersistentPOA's POAManager, Without this
                   // All calls to Persistent Server will hang because POAManager
                   // will be in the 'HOLD' state.
                   rootpoa.the_POAManager().activate();
                // instantiate the servant
                   CorbaHelloImpl helloImpl = new CorbaHelloImpl();
                   helloImpl.setORB(orb);
                   org.omg.CORBA.Object helloObj = rootpoa.servant_to_reference(helloImpl);
                   Hello HelloRef = HelloHelper.narrow(helloObj);
               //  Resolve RootNaming context and bind a name for the servant.
                 // NOTE: If the Server is persistent in nature then using Persistent
                 // Name Service is a good choice. Even if ORBD is restarted the Name
                 // Bindings will be intact. To use Persistent Name Service use
                 // 'NameService' as the key for resolve_initial_references() when
                 // ORBD is running.
                   org.omg.CORBA.Object ncObj = orb.resolve_initial_references("NameService");
                   //This line works ONLY for INS(jdk 14 naming service)
                   // Since we have only an object reference, we must
                   // cast it to a NamingContext. We use a helper
                  // class for this purpose
                   NamingContextExt ncRef = NamingContextExtHelper.narrow( ncObj );
                   String name = "Hello";
                   NameComponent path[] = ncRef.to_name( name );
                   try {
                        ncRef.rebind( path, HelloRef );
                   } catch( org.omg.CosNaming.NamingContextPackage.NotFound nf ) {
                        NameComponent[] tmpName = new NameComponent[path.length-1];
                        for (int i=0; i < path.length-1; i++) { tmpName[i] = path; }
                        createContextPath(ncRef, tmpName);
                        ncRef.bind(path, HelloRef);
         BindingListHolder bl = new BindingListHolder();
         BindingIteratorHolder blIt= new BindingIteratorHolder();
         ncRef.list(1000, bl, blIt);
         Binding bindings[] = bl.value;
         for (int i=0; i < bindings.length; i++) {
         int lastIx = bindings[i].binding_name.length-1;
         // check to see if this is a naming context
         if (bindings[i].binding_type == BindingType.ncontext) {
         System.err.println( "Context: " +
         bindings[i].binding_name[lastIx].id);
         } else {
         System.err.println("Object: " +
         bindings[i].binding_name[lastIx].id);
                   System.out.println( name + " for INS ready and waiting ...");
                   // the server is now ready to receive the client request
                   orb.run();
              } catch (Exception e) {
                   System.err.println("ERROR: " + e);
                   //e.printStackTrace(System.out);
                   throw e;
              System.out.println("HelloServer Exiting ...");
    public static void createContextPath(NamingContext nc, NameComponent[] name)
         throws org.omg.CORBA.UserException {
         try {
              nc.bind_new_context(name);
         } catch (NotFound nf) {
              for( int len = name.length - nf.rest_of_name.length + 1;
                   len <= name.length; len++ )
                   NameComponent[] tmpName = new NameComponent[len];
                   for (int i=0; i < len; i++) { tmpName[i] = name[i]; }
                   nc.bind_new_context(tmpName);
    Client side:
    package oracle.demo.corba;
    import oraclecorba.Hello;
    import oraclecorba.HelloHelper;
    import org.omg.CORBA.ORB;
    import org.omg.CosNaming.Binding;
    import org.omg.CosNaming.BindingIteratorHolder;
    import org.omg.CosNaming.BindingListHolder;
    import org.omg.CosNaming.BindingType;
    import org.omg.CosNaming.NamingContextExt;
    import org.omg.CosNaming.NamingContextExtHelper;
    public class MyJSPHelper
         public static String jspSayHello(String in)
              String rc = "";
              try
                   ORB orb = ORB.init();
                   // get the root naming context
                   org.omg.CORBA.Object objRef;
                   objRef = orb.resolve_initial_references("NameService");
                   // Use NamingContextExt instead of NamingContext. This is
                   // part of the Interoperable naming Service.
                   NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
                   /*for(int i =0; i<orb.list_initial_services().length; i++)
                        rc += orb.list_initial_services()+": ";
                        System.err.println(orb.list_initial_services()[i]);
         BindingListHolder bl = new BindingListHolder();
         BindingIteratorHolder blIt= new BindingIteratorHolder();
         ncRef.list(1000, bl, blIt);
         Binding bindings[] = bl.value;
         for (int i=0; i < bindings.length; i++) {
         int lastIx = bindings[i].binding_name.length-1;
         // check to see if this is a naming context
         if (bindings[i].binding_type == BindingType.ncontext) {
         System.err.println( "Context: " +
         bindings[i].binding_name[lastIx].id);
         } else {
         System.err.println("Object: " +
         bindings[i].binding_name[lastIx].id);
                   // resolve the Object Reference in Naming
                   String name = "Hello";
                   Hello helloImpl = HelloHelper.narrow(ncRef.resolve_str(name));
                   System.err.println("Obtained a handle on server object: " + helloImpl);
    //Hello helloImpl = HelloHelper.narrow(orb.string_to_object("corbaname:iiop:some_address:8056#Hello")); also tried that, but got the same problem
                   rc = helloImpl.sayHello(in); //<----failed here
              catch(Exception e)
                   // TODO Auto-generated catch block
                   rc += e.toString();
                   e.printStackTrace();
              return rc;
    Edited by: user8904224 on 27/04/2010 23:06

    Don't mean to add to the possible confusion here, but most newer routers (Apple included) allow their users to "hide" their network, so it's also very possible and likely in an apartment situation that you can pick up interference from a network that you or Air Radar cannot "see".
    So, trying to find the "right" channel becomes a bit more of guessing game.
    Understand that you need "g" for your devices. For the future though, you might watch the Air Radar screen for channels in the 36-48 and 149-161 range to see how much less activity is going on there.

  • Connection timed out: connect at com.sun.mail.imap.IMAPStore.protocolConne

    Hi ,
    Recently, my team need to work with javamail. Here I got a problem: when I run the application in my personal home network , it goes on very well. When I run the program in my company env, it gives error info:
    Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
    nested exception is:
    java.net.ConnectException: Connection timed out: connect
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1706)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525)
    at javax.mail.Service.connect(Service.java:313)
    The resource is :
    import java.security.Security;
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.AddressException;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    *Use Gmail
    public class GmailSender {
    public static void main(String[] args) throws AddressException, MessagingException {
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
    // Get a Properties object
    Properties props = System.getProperties();
    //Add proxy for GmailSender
    //especially here, I am not sure whether the proxy really works. In home network, it needn't proxy to run successfully.
    // props.setProperty("proxySet","true");
    // props.setProperty("socksProxyHost","148.87.19.20"); // This IP address is our proxy server address
    // props.setProperty("socksProxyPort","80");
    props.setProperty("mail.smtp.host", "smtp.gmail.com");
    props.setProperty("mail.smtp.socketFactory.class", SSL_FACTORY);
    props.setProperty("mail.smtp.socketFactory.fallback", "false");
    props.setProperty("mail.smtp.port", "465");
    props.setProperty("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.auth", "true");
    final String username = "XXX";
    final String password = "XXX";
    Session session = Session.getDefaultInstance(props, new Authenticator(){
    protected PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(username, password);
    // -- Create a new message --
    Message msg = new MimeMessage(session);
    // -- Set the FROM and TO fields --
    msg.setFrom(new InternetAddress(username + "@gmail.com"));
    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse("[email protected]",false));
    msg.setSubject("Hello");
    msg.setText("How are you");
    msg.setSentDate(new Date());
    Transport.send(msg);
    System.out.println("Message sent.");
    Will you please help me to review my code and give me some suggestions ?

    No point looking at the code. The error message says the code can't connect to the server you are trying to connect to, so presumably there's a firewall or something like that preventing the connection. Talk to your network people.

Maybe you are looking for

  • My MacBook works fine wifi everywhere except for home.  The home wifi is fine with the iPad and iPhone.  How can I fix my MacBook?

    My MacBook works fine wifi everywhere except for home.  The home wifi is fine with the iPad and iPhone, so I assume the issue is with my computer.  My computer works fine on wifi networks elsewhere.  The only problem is at home. The computer "connect

  • Create object form pattern

    I have seen mutiple ways for implmeneting forms for creating entities. What is the best practice. I have some attributes that are exposed in the form and the rest need to be set programatically. I need to navigate away to 2 different pages depending

  • Integrating SMS service with E Business Suite

    Hi, We are looking forward to configure sms service with our EBS 11i and R12.1.1. Need to send sms messages in mobiles for modules like HRMS, Learning management, recritement etc. Also general alerts and notifications. Need any pointers, tips, refere

  • Ship-to-Party for STO document

    Hello All, Can you guys help me out in pointing to the right database table for getting the ship to party of STO ? I could not find it when I searched it in the forums. Thanks in advance for your help. Babu

  • Extremely slow client view

    Hello all! I'm being able to observe the client I've set up. But the speed at which my view as server is refreshed is so slow that I can't possibly monitor what is being done on the client computer. Just to load the desktop took about 5 minutes. Both