Can't connect to IPv6-only host from java on Mac OS

I have some IPv6-only hosts. I can successfully execute curl request to it by curl
$ curl -I my.ip.v6.only.host HTTP/1.1 200 OK
But when I trying to get it from java I have an error:
HttpGet httpget = new HttpGet("http://my.ip.v6.only.host");
CloseableHttpResponse response = httpclient.execute(httpget);  
Stack trace:
INFO: I/O exception (java.net.NoRouteToHostException) caught when processing request to {}->http://my.ip.v6.only.host: No route to host
Mar 17, 2015 7:42:23 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->http://my.ip.v6.only.host
java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219) 
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
at MainTest.main(MainTest.java:25)
Problem has been occured on java v1.7.0_65 and v1.8.0_40, MacOS 10.10.2. On previous version MacOS 10.9.5 it works well.
What's going on? How it is possible that host is reachable by curl and unreachable from java.
Also, I've tried to play around -Djava.net.preferIPv6Addresses=true and -Djava.net.preferIPv4Stack=false and it couldn't help.

Using the code you supplied I was able to reproduce your errors. I've adjusted it accordingly and can connect to one of my 10.2 test databases.
import java.sql.*;
import oracle.jdbc.*;
import oracle.jdbc.pool.*;
class Conn {
  public static void main (String args []) throws SQLException
    Connection conn = null;       
    OracleDataSource ods = new OracleDataSource();
    // ods.setURL(" jdbc:oracle:thin:@localhost:1521:TEST");
    // conn = ods.getConnection("scott", "tiger");
    ods.setURL("jdbc:oracle:thin:@localhost:1521:TEST");
    conn = ods.getConnection("scott", "tiger");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
    while (rset.next())
        System.out.println (rset.getString(1));   // Print col 1
    stmt.close();
}There are several different ways to configure OracleDataSources:
http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/urls.htm#BEIDBFDF
So, hopefully it's just a mismatch config.

Similar Messages

  • Can't connect to Oracle XE instance from Java web application

    I'm a long-time Java developer but can't figure this out.
    I've been pouring over the forum for over a week and can't
    find the solution that will let me connect.
    Hardware: Intel/Vista.
    DB: Oracle Express 10G.
    Application: Java web application (Jakarta Struts)
    Application Server: Tomcat 5.5
    I copied the latest JDBC driver from OTN into my app server's "/LIB" directory.
    I get no driver errors. ("ojdbc14.JAR)"
    I can connect locally from my TOAD client, using SYSTEM/PASSWORD/XE.
    My listeners seem to be OK.
    Depending on which connection string I use from my Java application,
    I get one of two messages.
    "ORA-01017: invalid username/password; logon denied"
    OR
    "Io exception: The Network Adapter could not establish the connection"
    ------------ lsnrctl status ---------------------------------------------------
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "XEXDB" has 1 instance(s).
    Instance "xe", status READY, has 1 handler(s) for this service...
    Service "XE_XPT" has 1 instance(s).
    Instance "xe", status READY, has 1 handler(s) for this service...
    Service "xe" has 1 instance(s).
    Instance "xe", status READY, has 1 handler(s) for this service...
    The command completed successfully
    ------------ SOURCE CODE ------------------------------------------------------
    OracleDataSource ods = new OracleDataSource();
    ods.setURL(" jdbc:oracle:thin:@localhost");
    conn = ods.getConnection("system", "password");
    //ods.setURL("jdbc:oracle:thin:@rsosborn-PC:1521:XE");
    //conn = ods.getConnection("system", "password");
    String query = "select * from books;";
    Statement st = conn.createStatement();
    ResultSet rs = st.executeQuery(query);

    Using the code you supplied I was able to reproduce your errors. I've adjusted it accordingly and can connect to one of my 10.2 test databases.
    import java.sql.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.*;
    class Conn {
      public static void main (String args []) throws SQLException
        Connection conn = null;       
        OracleDataSource ods = new OracleDataSource();
        // ods.setURL(" jdbc:oracle:thin:@localhost:1521:TEST");
        // conn = ods.getConnection("scott", "tiger");
        ods.setURL("jdbc:oracle:thin:@localhost:1521:TEST");
        conn = ods.getConnection("scott", "tiger");
        Statement stmt = conn.createStatement();
        ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
        while (rset.next())
            System.out.println (rset.getString(1));   // Print col 1
        stmt.close();
    }There are several different ways to configure OracleDataSources:
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/urls.htm#BEIDBFDF
    So, hopefully it's just a mismatch config.

  • Can't connect to my VPN server from the WAN addres...

    I've setup a PPTP VPN server on a Raspberry Pi, so that I can connect to it when out and about and avoid having my android internet use sniffed by random public wi-fi hotspots.
    It seems to be working as I setup a Windows 7 connection to it using the LAN address (192.168.1.85) and that connected fine but I can't get it to work through the BT HH3 via the WAN address. I've forwarded port 1723 to 192.168.1.85 and tried disabling the firewall, enabling port clamping and putting the RPi in the DMZ, none of which made any difference.
    Is anyone able to help please?

    Did some testing from my parents house yesterday and whilst connected to their router (Virgin Media) and/or a local BTWiFi hotspot (I can't honestly remember if I tried both or if I only tested with one or the other), I was able to connect to the VPN Server from my phone.
    I can also connect from my home PC using Putty to the VPN Server on SSH (port 22) with that forwarded in the router using the WAN address, so NAT travesal doesn't seem to be an issue.
    Yet I still can't connect to the VPN Server from home, whether connected to my HH3 or a local BTWiFI-with-FON hotspot, using the WAN address, only the LAN address, which doesn't make any sense to me.
    I don't think it's relevant to this problem but I want to ask a question about the router firewall as the description for Default (which is what I have enabled) says "Allow all outgoing connections and block all unsolicited incoming traffic. Games and application sharing is allowed." but it doesn't appear to block unsolicited incoming traffic as otherwise I don't think I'd have been able to connect to the VPN Server from my parent's house, or on SSH from my PC using the WAN address. So is the description incorrect?

  • How can I connect to a windows server from a mac book pro

    How can I connect to a windows server from a mac book pre?

    I have a Dell Power Edge T110 ii in the office that has files and software I need to access when away from the office, when I am on the road I use a mac book pro and an iPad.
    I am sorry if I am being a bit vague but this is all new to me, I have tried 3 IT guys but they can not find a way.
    Any help is greatly appeciated.

  • Can't connect  to SQL Server 2000 from serlet

    Hi,
    I can connect to SQL Server 2000 from standalone program after set the classpath properly.
    but I Can't connect to SQL Server 2000 from serlet, I am using Tomcat 4.1 and Win2K pro now. Do I need to set something for servlet just like CLASSPATH?
    Any help will be appreciated.
    package usingjsp;
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    public class JDBCServlet extends GenericServlet
    protected Connection conn;
    public void init()
    try
    // Make sure the JdbcOdbcDriver class is loaded
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    // Try to connect to a database via ODBC
    conn = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://hu:1433", "sa","");
    catch (Exception exc)
    // If there's an error, use the servlet logging API
    getServletContext().log(
    "Error making JDBC connection: ", exc);
    public void service(ServletRequest request, ServletResponse response)
    throws java.io.IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<HTML>");
    out.println("<BODY>");
    out.println("<PRE>");
    out.println("The JDBC connection is:");
    out.println(conn);
    out.println("</PRE>");
    out.println("</BODY>");
    out.println("</HTML>");

    i also have this problem..do u have any solution?

  • TS1363 I can't connect to the itunes store from my Windows Vista PC. I have run diagnostics and itunes have verified my internet connection as positive, but not the secure link to the itunes store. This comes up as failed.  Any suggestions?

    I can't connect to the itunes store from my Windows Vista PC. I have run diagnostics and itunes have verified my internet connection as positive, but not the secure link to the itunes store. This comes up as failed.  Any suggestions?

    everytime I try to open the store it endlessly says "accessing iTunes store" but it never opens.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • Connect to MS Sql Server from Java Source

    Hi,
    Is there any way I could connect to ms sql server from Java source? I know I can call java source from function thats easy but what I really want is capability to connect to non-oracle(MS SQL server) from my java source and then call it from function.
    I don't know if JDBC driver for SQL server is even installed/available. Is there a way I could find it out form my IDE? I know sqlJ does compile but I have never used sqlj. help!!!
    Sinha

    You'll probably have better luck in a Java forum or a Microsoft forum.

  • Can you run a windows only Photoshop plugin on a Mac using Parallels?

    Can you run a windows only Photoshop plugin on a Mac using Parallels?   In particular a .8BF plugin like PTFilters.8BF  or Super Cubic.

    If you also have a Photoshop version of the Photoshop application, the answer is of course YES.
    Otherwise, the answer is no,
    If you have the CC subscription, then of course you can install a Photoshop Windows version and run your plug-in.  That'll be separate from your Photoshop Mac install..

  • How can i export a 24bit avi file from photoshop for mac?

    how can i export a 24bit avi file from photoshop for mac? i have a client that specificly needs the files to be avi and in 24bit what are the settings that i need to use to export the video using photoshop on a mac?

    Hello,
      To make a 24-bit AVI file in Photoshop, go to File>Export>Render Video. Then, under File Options, choose AVI from the Quicktime Export drop-down menu. Click the Settings button. Click the Settings button in the AVI Settings window. Change Compression to None, and then choose "Millions of Colors" from the Depth drop-down under Compression.
      The Millions of Colors option is for 24-bit video (8-bit R+G+B channels, 8x3=24). Millions of Colors+ is for 32-bit video (24-bit video plus an 8-bit alpha channel).
    -Brett

  • How i can set dropDown item to 6th item from java code ?

    Hi
    Thank you for reading my post.
    how i can set dropDown item to 6th item from java code ?
    i have the value field of database and i can use it to set selected item of DropDown.
    so : can i use value field to set the selected item ?
    Thank u.

    Hi,
    Please go through the following thread which discusses about setting teh selected item for a dropdown:
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=50697
    Hope it helps
    Cheers
    Giri

  • How can i buy again the same software from the same mac? (where it is installed and runs ok: it is for licences issues)

    How can i buy again the same software from the same mac? (where it is installed and runs ok: it is for licences issues)
    Thanks for your help.

    Hi ..
    You can redownload previously purchased apps from the App Store using the same Apple ID on all your authorized Macs for free.
    How to re download apps from the Mac App Store:
    Open the App Store. From the menu bar click Store > Sign In
    Click Purchases from the top of the App Store window.
    Select which apps you want to re download. Then right or control click where you see Installed  then click Install.
    Make sure and use the same Apple ID used for the original purchase.

  • HT4906 why can't I up date my iPhone from my laptop (mac book pro) but I can update my laptop from my phone?

    why can't I up date my iPhone from my laptop (mac book pro) but I can update my laptop from my phone?
    Peter

    Maybe if you told us what you have and exactly wha you are doing someone could help - re-read your post from the viewpoint of a person who does not know you or know anything except what you post - think you could help?
    LN

  • Can I switch my CS4 master suite from PC to MAC?

    Can I switch my CS4 master suite from PC to MAC?
    And if not, can I apply for the CS customers discount for a Mac license with my PC license?

    Order product | Platform, language swap

  • Mac using Acrobat Pro v9 can't connect to shared review hosted on Sharepoint server.

    A person at our company has a Mac with Acrobat Pro v9 and can't connect to our shared review hosted on a Sharepoint server. The shared review is initiated from a PC using Acrobat Pro X.
    They can access/login to the Sharepoint server via Safari on the same computer both inside the company and from outside.
    They used to have it working just fine for months, then suddenly (recently) it stopped working and it just keeps saying that it can't connect.
    When trying to connect, Acrobat doesn't ask for credentials. I've tried hunting down where those credentials are stored to try and delete them to force it to ask again, but no luck there either.
    I also have a Mac (but I'm running Acrobat Pro XI and now DC) and I can access the same shared review that doesn't work for them. And I can't seem to break it for me (as an effort to figure out their problem).
    Any helpful guidance on how to get things back on track would be greatly appreciated. My head hurts from beating it against my desk. :-|
    Thanks!

    Several of us encountered the same issue running MAC OS X on Acrobat Pro XI.  I'm tagging your question to see if someone provides a solution.

  • Airport: Self-assigned ip address, can't connect (public routers only)

    this has been talkeda bout before, but is extremely frustrating, because i don't have the problem with a PC.
    1/2 of the public routers i connect to have some kind of login page, most the time they just say "youre getting free internet, click here" ... but sometimes that login page never comes up, and the network card says "airport has a self-assigned ip address and may not be able to connect to the internet"
    this only happens on pulic routers for me, and only ones that have login pages.
    its very odd because for example, starbucks has all the same routers, all are "attwifi" now .. i go to one, i get hte login screen, go to a different one, i don't get it...and can't connect
    with a PC, i get it every time.
    this is undoubtably a leopard problem, that needs to be fixed. please!

    The wifi icon shows no connection with the network -- the "!" mark.
    However the computer sees the network, i.e. when I search in Network Preferences the network is listed.
    So: 1) the computer sees the network but 2) will not connect to the network. The reason given for refusal to connect is "self-assigned IP address".
    Not to be repetitive but two other Mac laptops are connected to the same network and working perfectly. The network preferences, as shown in the "advanced" section, are the same for all machines, i.e. DHCP is selected and IPv6 is Automatic.

Maybe you are looking for

  • Word import - hyperlinks work in one document, not in another

    Hi all, I am aware that much has been written about broken links after importing, but there is a strange pattern to my problem I have not seen before. I have three language versions of one document (English, French, German). So I set up three indepen

  • How to create an instance of midlet with in a midlet

    Hi all, I have 5 midlets in the same project (midlet suite). I need one of the midlets (login midlet) to start and when login is verified i want to display list of the remaining midlets which can be launched as per user's chioce. My query is, how can

  • Adobe Drive 5 Install Failed on Mac

    When installing Adobe Drive 5 on a Mac and get Installation Failed with the fallowing error Summary: Exit Code: 7 Please see specific errors below for troubleshooting. For example,  ERROR: -------------------------------------- Summary --------------

  • TimeInMillis different in java than in C

    I have a a problem getting a match between the epoche seconds derived within a C program and the return value of System.currentTimeMillis(); Here is an example: * Simple C program for running on Windows Machines * My testing is occuring on Win2K #inc

  • I cannot get Firefox to start.

    When I try to start Firefox, nothing happens. It loads (partially) into memory to about 5,000k according to Task Manager. It doesn't show as an active application in Task Manager - just a process. I've uninstalled, clean installed, removed all releva