Tcp/ip  bconnection to host has failed,connection refused

Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(UnknownSource)
Can anyone pls help me out .
I ve tried netstat -an port 1433 is not listed
firewall is diasbled .

You need to enable TCP services on SQL Server.

Similar Messages

  • Java.sql.SQLException: The TCP/IP connection to the host  has failed.

    Hello. I hope you had a happy new year! Now its back to work.
    I am having a problem connecting to a remote SQL Server DB. I am using NetBeans 5.5 and the latest J2EE. I am able to see the tables in the IDE and bind objects to data. But when I run it it gets this:
    java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: no further information
    at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:100)
    at com.sun.sql.rowset.internal.CachedRowSetXReader.connect(CachedRowSetXReader.java:344)
    at com.sun.sql.rowset.internal.CachedRowSetXReader.readData(CachedRowSetXReader.java:126)
    at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:968)
    at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:1428)
    I checked the SQL Server Configuration manager on that machine and TCP/IP connections are allowed. What else could be wrong?
    Thank You.

    "Connection refused" means that the client sends a packet saying "I would like to connect to port number NNNN please" to the server computer, and the server computer's OS sends the reply "there is no process listening to that port on the network interface you are using".
    The database server is not running, or running but not listening to TCP/IP connections, or at a different port from what you think, or listening to only selected network interfaces (it is possible for a process to listen to a specific interface or a wildcard for all interfaces). A less likely scenario is that a firewall is sending the "connection refused" message.
    First aid check list for "connection refused":
    - Check host name in connect string.
    - Check port number in connect string.
    - Try numeric IP address of server host in connect string, in case name server is hosed.
    - Are there any firewalls between client and server blocking the port.
    - Check that the db server is running.
    - Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port. You need to configure the database to accept TCP connections; the server documentation or google should explain how.
    - Try "telnet server-host-name the-port-number" from the client, to see if firewalls are blocking it.
    - If "telnet" fails: try telnet with the numeric ip address.
    - If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
    - Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

  • The TCP/IP connection to the host  has failed.

    Hi everyone;
    I have project with Java and Sql server 2000.My application server is Jetty.I work this tool successfully in Windows 2000 Server but I cant in XP Pro Service Pack 2.I take this message :
    The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
    My Sql Server TCP/IP enabled and port 1433.There is problem here.Because I cant connect 1433.I tried this command.
    telnet localhost 1433 .It is failed.I tried to open this port in firewall.Still problem is continue.
    I am waiting for ur answer...

    please help me by giving the solution.Help yourself by fixing the connection settings OR your network. The error is very clear: no connection can be made to the database. So what could it be? Wrong IP? A firewall is blocking you somewhere?
    Nobody can tell you, you are the only one with access to your server settings and network environment.

  • Pulseaudio problem , snd_pcm_open failed: Connection refused.

    Hello everyone, i have this problem that appeared last week.
    I cant play music in any player cause i get this error : snd_pcm_open failed: Connection refused.
    i tried things like adding the user to audio group, creating a "pulse" user cause pulseaudio gave me an error like "pulse user" not existent .
    but if i test the sound card in the kde4 audio setup it works
    anyone have any ideea on how to fix this ?

    just restart alsa.
    sudo /etc/rc.d/alsa restart
    it solved my problem.

  • ES2: The TCP/IP connection to the host has failed

    A very simple error message appears against a stalled livecycle process which runs upon a flex form submission. You'd think that the connection to the server was lost.This custom process ("completion") is attempting to write out to the backend database at that time.
    However,the "read" process to prepopulate the form already correctly uses the same JNDI connection. And that works. Every time.
    The solution was to go into the "completion" process and move around the individual nodes, re-save and deploy again
    Why is this - seems to be more problems in ES2 than we bargained for perhaps.

    "Connection refused" means that the client sends a packet saying "I would like to connect to port number NNNN please" to the server computer, and the server computer's OS sends the reply "there is no process listening to that port on the network interface you are using".
    The database server is not running, or running but not listening to TCP/IP connections, or at a different port from what you think, or listening to only selected network interfaces (it is possible for a process to listen to a specific interface or a wildcard for all interfaces). A less likely scenario is that a firewall is sending the "connection refused" message.
    First aid check list for "connection refused":
    - Check host name in connect string.
    - Check port number in connect string.
    - Try numeric IP address of server host in connect string, in case name server is hosed.
    - Are there any firewalls between client and server blocking the port.
    - Check that the db server is running.
    - Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port. You need to configure the database to accept TCP connections; the server documentation or google should explain how.
    - Try "telnet server-host-name the-port-number" from the client, to see if firewalls are blocking it.
    - If "telnet" fails: try telnet with the numeric ip address.
    - If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
    - Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

  • Certificate authority export fails connection refused

    I am trying to export zenwork certificate and I receive the following error:
    Command
    zman --debug certificate-authority-export /root/cert
    Error:Could not connect to the ZENworks Server. Ensure that the server is running, and the host and port information specified is correct.
    Debug:
    com.novell.zenworks.datamodel.exceptions.Connectio nException: Connection refused
    What can I look at?

    zman certificate-authority-export /root/cert --debug
    Error:Could not connect to the ZENworks Server. Ensure that the server is runnin g, and the host and port information specified is correct.
    Debug:
    com.novell.zenworks.datamodel.exceptions.Connectio nException: Connection refused
    at com.novell.zenworks.zman.exceptions.ZManExceptionH andler.createExcept ion(ZManExceptionHandler.java:286)
    at com.novell.zenworks.zman.exceptions.ZManExceptionH andler.makeDataMode lException(ZManExceptionHandler.java:260)
    at com.novell.zenworks.zman.exceptions.ZManExceptionH andler.processRemot eException(ZManExceptionHandler.java:390)
    at com.novell.zenworks.zman.commands.CAHandler.<init> (CAHandler.java:72)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstruct orAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingC onstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:501)
    at com.novell.zenworks.zman.CommandRunner.execute(Com mandRunner.java:86)
    at com.novell.zenworks.zman.ZMan.executeRunner(ZMan.j ava:321)
    at com.novell.zenworks.zman.ZMan.main(ZMan.java:505)
    Caused by: java.rmi.ConnectException: Connection refused
    at com.novell.soa.ws.portable.ApplicationException.ma pToRemote(Applicati onException.java:207)
    at com.novell.zenworks.datamodel.services.zoneconfig. soap.ZoneConfigAdmi nServiceBinding_Stub.hasZENServerRole(ZoneConfigAd minServiceBinding_Stub.java:50 71)
    at com.novell.zenworks.zman.commands.CAHandler.<init> (CAHandler.java:68

  • RemoteGui.bat Login attempt failed:connection refuse to SDM

    Heloo Guru's,
    I am trying to deploy service via running path: D:\usr\sap\XIG\DVEBMGS00\SDM\program <b>RemoteGui.bat</b> file .
    I am giving password for SDM user but error coming on clicking login button
    Error:could not establish connection to server <host> at port <50018>:connection refused:connect.
    Please advise.

    Hi Gaurav,
    You can find the SDM configuration file in \usr\sap\<system_id>\<instance no>\SDM\program\config with file name sdmrepository.sdc. In this file you will find your sdm host name and gui port number (default 50018). You change it from here and restart the server if its not set properly.
    Go to the mmc, select your serve node, expand instance 0 and look at the process table, you should have dispatcher / server0 and SDM nodes with their states set as started.
    It is possible that SDM was kept in standalone mode and not started with your server. If that is the case
    Run sdm jstartup "mode=integrated"
    restart your cluster.
    Regards,
    Prateek

  • Mpd and pulse problem - Connection refused [SOLVED]

    I'm having problems getting mpd to play nice with pulse-audio.  Pulse is installed and works with vlc, mplayer, flash, etc. just fine.  When I try to play through mpd the song in the gui simply shows a status of "paused" and the following gets written to the mpd.log. 
    Advice is appreciated.
    # tail -f /var/log/mpd/mpd.log
    Oct 08 11:12 : output: Failed to enable "pulse audio" [pulse]: pa_context_connect() has failed: Connection refused
    Oct 08 11:12 : output: Failed to enable "pulse audio" [pulse]: pa_context_connect() has failed: Connection refused
    Oct 08 11:12 : output: Failed to enable "pulse audio" [pulse]: pa_context_connect() has failed: Connection refused
    Oct 08 11:12 : player_thread: problems opening audio device while playing "Not_So_Hard_Stuff/Disturbed-The Sickness-2000/01_Voices.flac"
    Here is my mpd.conf
    $ sed '/#/d' /etc/mpd.conf
    music_directory "/media/data/all_genres"
    playlist_directory "/var/lib/mpd/playlists"
    db_file "/var/lib/mpd/mpd.db"
    log_file "/var/log/mpd/mpd.log"
    pid_file "/var/run/mpd/mpd.pid"
    state_file "/var/lib/mpd/mpdstate"
    user "mpd"
    gapless_mp3_playback "yes"
    zeroconf_enabled "yes"
    zeroconf_name "Music Player"
    input {
    plugin "curl"
    audio_output {
    type "pulse"
    name "pulse audio"
    mixer_type "software"
    audio_buffer_size "35000"
    buffer_before_play "5%"
    The pulseaudio wiki suggests that a 'pulse' group and 'pulse-access' and even 'pulse-rt' groups may be required?  I have used mpd for a year now with no such groups on my system.
    EDIT: solved in post #13
    Last edited by graysky (2011-10-16 13:42:46)

    graysky wrote:
    I too modified my /etc/mpd.conf to use alsa even though I don't have alsa-utils installed at all.
    $ sed '/#/d' /etc/mpd.conf
    music_directory "/media/data/all_genres"
    playlist_directory "/var/lib/mpd/playlists"
    db_file "/var/lib/mpd/mpd.db"
    log_file "/var/log/mpd/mpd.log"
    pid_file "/var/run/mpd/mpd.pid"
    state_file "/var/lib/mpd/mpdstate"
    user "mpd"
    gapless_mp3_playback "yes"
    zeroconf_enabled "yes"
    zeroconf_name "Music Player"
    input {
    plugin "curl"
    audio_output {
    type "alsa"
    name "My ALSA Device"
    mixer_type "software"
    audio_buffer_size "35000"
    buffer_before_play "5%"
    Doesn't work for me I get this error when I try to play something with your configuration:
    ALSA lib pulse.c:229:(pulse_connect) PulseAudio: Unable to connect: Connection refused
    Oct 16 18:23 : output: Failed to open "My ALSA Device" [alsa]: Failed to open ALSA device "default": Connection refused

  • Smtp failed connection attemp

    Hi
    This is my scenario
    Exchange 2010 --> TMG 2010--> UBM Xroads --> ISP
    My TMG runs on Hyper-V and Windows 2008 R2 hosted for Windows server 2012 R2
    two NICS
    When i publish the Exchange server on TMG receive without problems but send email is not working
    Failed Connection Attempt PMSNTMGSVRV 25/02/2014 10:01:38 a.m.
    Log type: Firewall service
    Status: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. 
    Rule: mailOUT
    Source: Internal (192.168.1.20:7419)
    Destination: External (85.158.140.211:587)
    Protocol: mail
     Additional information
    Number of bytes sent: 0 Number of bytes received: 0
    Processing time: 21015ms Original Client IP: 192.168.1.20
    I´m already chek NIC config and all seems to be ok. but i´m stuck with this.
    Any idea?

    Hi, check if the destination Server is listening on port 587. SMTP traffc normally uses TCP port 25
    regards Marc Grote aka Jens Baier - www.it-training-grote.de - www.forefront-tmg.de - www.galileocomputing.de/3570

  • TCP DNS Connection Refused

    I am testing an application which uses tcp for dns.
    My ActionTec router is set to "Medium" so it should allow all outbound connections.
    When I use a dns server on my network all is well.   When I try to use the ActionTec for dns I get connection refused with tcp requests but udp requests go through. I suspect the dns server on the ActionTec does not support tcp but I would like confirmation in case there is a setting I can change to make it work.
    $ host yahoo.com
    yahoo.com has address 98.138.253.109
    yahoo.com has address 98.139.183.24
    yahoo.com has address 72.30.38.140
    yahoo.com mail is handled by 1 mta5.am0.yahoodns.net.
    yahoo.com mail is handled by 1 mta7.am0.yahoodns.net.
    yahoo.com mail is handled by 1 mta6.am0.yahoodns.net.
    $ host -T yahoo.com
    ;; Connection to 192.168.1.1#53(192.168.1.1) for yahoo.com failed: connection refused.
    Thanks,
    AustinPowered

    Keep in mind the ActionTecs are based around the dnsmasq lightweight DNS resolver if I remember correctly. If Verizon/ActionTec is using a version of dnsmasq older than v2.10, then it is a known limitation of dnsmasq to not support TCP queries. If someone can confirm what version the FiOS routers have, that would be great. This tool may be able to identify it:
    http://netalyzr.icsi.berkeley.edu/
    If you'd like me to analyze it, please send me a private message with the URL to your result, unless you don't mind your IP address being given out to the forums.
    ========
    The first to bring me 1Gbps Fiber for $30/m wins!

  • Decision Service calls failing with connection refused

    Hi All,
    Breifing of the bpel process - Async bpel process XX_BPEL_ASYNC_002 calls decision services and a sync bpel process XX_BPEL_SYNC_001.
    We have moved to cluster 10.1.3.5.0 from 10.1.3.3.0 and the deployement of the bpel process and the decision service done on two nodes i.e., node51 and node55.
    But the bpel process is able to call the decision service only when the node 51 is UP and running, but if node 51 is down and node 55 is up and running it is failing with connection refused error. It is also working when 55 is DOWN and 051 is UP.
    the exact error is:
    exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused.
    We are using file based repository.
    It is failing when it tries to call particular url:
    http://loadbalancerurl:7777/orabpel/domain001/XX_BPEL_ASYNC_002/1.0/decisionservices.decs
    Can anyone please help me or advice me for finding some solution.
    Thanks
    Sreejit

    Hi Fatsah,
    It has been a while since we resolved this problem. But these were  the basic steps that we had taken.
    The receiver was configured a File adatpter with FTP:
    Port: 10021
    Connection security : FTPS (FTP using SSL/TLS) for Control and Data Connection
    Command Order: AUTH TLS,USER,PASS,PBSZ,PROT
    Problem: The message was blocked in our firewall.
    FTPS in this case used 10021 as the control port and the firewall allowed to pass the control request.
    Once the connection was accepted at the control level, it generated a random port number  to pass data on the channel.
    This random port number was blocked in the firewall.
    We monitored the data port numbers generated at firewall. Then we configured the firewall to open any port number  between the specific IP addresses of the sender and the receiver. That resolved the problem.
    Hope this helps!
    Please give points if this is helpful.
    Thank you.
    Dharmasiri Amith

  • Connection refused. Help please!

    hi guys, i used the following code to try to connect to sql server 2005.
              try {             Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");             Connection conn = DriverManager.getConnection("jdbc:sqlserver://localhost;integratedSecurity=true");                   } catch (Exception e) {             e.printStackTrace();         }
    and i got the following exception:
    com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection refused: connect         at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)         at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)         at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)         at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)         at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
    i know this question might have been asked but i was unable to find out the solution from previous posts.
    thanks very much.
    Edited by: J.T on 08-Oct-2008 16:04
    Edited by: J.T on 08-Oct-2008 16:31
    Edited by: J.T on 08-Oct-2008 16:32

    The error is probably caused by the port number where the SQL Server is listening for the client connection.
    If port number is different than the default number, you must specify the port number in the connection url
    Also check the API for getConnection
    [http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DriverManager.html]
    Connection conn = DriverManager.getConnection("jdbc:sqlserver://localhost:portnumber;username,password");

  • MSSQL's JDBC random connection refused

    I am having a random "unable to connect" error from my java application. Sometimes it's fine, apps running without any problem, but sometimes this exception comes up. I am writing this app at home and my SQL server is at office (behind a router with SPI firewall, but i have port forwarded TCP port 1433 for the connection). If I telnet to SQL server, i wont get any error message but a blank screen, it looks like the server side is waiting for my console input.
    IDE: NetBeans IDE 6.0 (Build 200711261600)
    JavaSDK: 1.6.0 build 1.6.0_03-b05
    MSSQL JDBC Driver: should be latest (i downloaded off from MS website in early March)
    MSSQL: MS SQL 2005 Developer Edition
    com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
    any help would be appreciated
    Jimmyson

    this is a sample of my JDBC code:
        private boolean isOnline()
            Connection myConnection = null;
            String myServerPath =      "jdbc:sqlserver://" + dbAddress + ":" + dbPort + ";" +
                        "databaseName=" + dbDefaultDB + ";user=" + dbUsername +
                        ";password=" + dbPassword;
            try
                Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                myConnection = DriverManager.getConnection(myServerPath);
                myConnection.close();
                return true;
            catch (Exception e)
                e.printStackTrace();
                return false;
        }Sorry if my code is bad
    Edited by: istudio on Mar 27, 2008 6:23 AM for formatting issue

  • SQL Server 2005 : connection refused

    Hi,
    I have installed SQL Server 2005 (Enterprise trial) on my PC,
    then configured windows Admin Tools/ODBC DataSource.
    I did not give a server name, so it picked up my computer name (OK-6400) as server name.
    Created a DB called ZM there, a few tables, added some data, so it works fine through ODBC (with SqlDbx).
    It never asked for port, so I assume it is 1433, am I wrong?
    Now I need to connect to it through JDBC.
    Tried several times through Eclipse (342) Database Development wizard.
    1) With MSFT JDBC driver tried to use URL: jdbc:sqlserver://localhost:1433;databaseName=OK-6400/ZM
    Tried with or without that server name:
    "The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect"
    2) With JTDS driver URL: jdbc:jtds:sqlserver://localhost:1433/ZM - same connection refused
    or with jdbc:jtds:sqlserver://localhost:1433/ZM;instance=OK-6400 -
    - "java.sql.SQLException: Unable to get information from SQL Server: localhost."
    Am I doing something wrong ? Please help !
    (Haven't used SQL Server before)
    Using Win XP.
    Thank you,
    Oleg.

    TheAvalanche wrote:
    SQL Server 2005 by default has TCP/IP access disabled. If TCP/IP access is enabled it uses a random port number by default I doubt that. Do you have some documentation that says that?
    The following link demonstrates how to change it.
    [http://social.msdn.microsoft.com/forums/en-US/sqlsecurity/thread/249bd1e7-76e2-48f6-a3e0-204a532bee54/]

  • SOAP Exception, Connection refused error in jdeveloper 11g

    Hello,
    I am using jdeveloper 11g 11.1.2.3.0.
    I have been experiencing the following error everytime I try to run the applicaiton. I use webservices in my applicaiton and recently the webservices url were changed pointing now to dev instead of the lab environment. The code has been migrated to dev environment, I tested the webservices in my browser, they seem to be working fine and are pulling up the required data.
    ERROR:
    javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
    Error     
    Message send failed: Connection refused: connect
    Error     
    Connection refused: connect
    I am not sure what is causing this. Any help would be appreciated.
    Thanks in advance,
    Sal

    Hello Frank,
    Thanks for your response. I checked the browser proxy settings in Jdeveloper, nothing is set there right now. Use HTTP Proxy Server is unchecked. What do I need to set this to?
    Thanks,
    Sal

Maybe you are looking for

  • Why can't I back up music from my iPhone or iPod to my iTunes?

    Happy with my iPhone 4s so far, no battery issue's and an excellent phone but there is one thing I dislike with a passion. I own more than one computer, I have desktops, laptops and netbooks and I have music I have purchased or recorded from vinyl or

  • An exception occurred while trying to run "cmicnfg.cpl, cmCtrlwND"

    I have recently installed the MSI KT6 Delta main-board with the VIA KT600 chipset On loading windows XP home edition the following error message appears: RUNDLL An exception occurred while trying to run "cmicnfg.cpl, cmCtrlwND" I think the error mess

  • Transfering files from Zen Sleek to an Ip

    Just to preface, I do love my Zen Sleek, and think it's far superior to the Ipod in nearly everyway, but alas, I got an 80 gb Ipod for christmas, and decided I should use it. Is it easy to transfer files from my Zen Sleek to the Ipod? How would one d

  • HELP----Inactive database connections.

    I have just deployed a JDeveloper BC4J application and to my surprise, when a user enters a module, the database connections are all Inactive in the database. All my users have their own user ids. I am using Jdeveloper 9.0.3.4 (build 1247) and 10gAS

  • Please give me some suggestion!

    I want to concentrate on programming and network, and my university provides the following paper, so can you give me some suggestion, show me what paper should I choose? 1. Advanced Data Communications The application of OSI data communication system