LocalHost Refused to Connect ( Urgent Help)

Omar Asim5 years ago

Hi People ,

I really require an advice asap, my traccar service is running, but when i'm trying to run the localhost:8082 it says refused to connect.

This was not happening before, it just started to happen now.

I recently modified the traccar.xml file with my SQL configurations.

<entry key='database.driver'>com.mysql.jdbc.Driver</entry> 
<entry key='database.url'>jdbc:mysql://localhost:3306/traccar?serverTimezone=UTC&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
 <entry key='database.user'>root</entry> 
 <entry key='database.password'>Omarzoha2014.</entry>

Over here "traccar" is the name of the database I created in the connection test which has the user root and password Omarzoha2014.

My log file shows:

2019-08-02 00:07:28  INFO: HikariPool-1 - Starting...
2019-08-02 00:07:28  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2019-08-02 00:07:33 ERROR: HikariPool-1 - Exception during pool initialization. - Unknown database 'localinstancemysql80' - CJException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-08-02 00:07:33 ERROR: Main method error - Unknown database 'localinstancemysql80' - CJException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-08-02 00:07:33  WARN: JNA: Callback org.traccar.WindowsService$ServiceMain@6e2aa843 threw the following exception - Unknown database 'localinstancemysql80' - CJException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-08-02 00:46:09  INFO: HikariPool-1 - Starting...
2019-08-02 00:46:10  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2019-08-02 00:46:22 ERROR: HikariPool-1 - Exception during pool initialization. - Connection refused: connect - ConnectException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-08-02 00:46:22 ERROR: Main method error - Connection refused: connect - ConnectException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-08-02 00:46:22  WARN: JNA: Callback org.traccar.WindowsService$ServiceMain@6f36c2f0 threw the following exception - Connection refused: connect - ConnectException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-08-02 15:41:57  INFO: HikariPool-1 - Starting...
2019-08-02 15:41:57  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2019-08-02 15:42:16 ERROR: HikariPool-1 - Exception during pool initialization. - Connection refused: connect - ConnectException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-08-02 15:42:16 ERROR: Main method error - Connection refused: connect - ConnectException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-08-02 15:42:16  WARN: JNA: Callback org.traccar.WindowsService$ServiceMain@6e2aa843 threw the following exception - Connection refused: connect - ConnectException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)

Does anybody know what could be the reason for the refused connection ?

Urgent help required.

Anton Tananaev5 years ago

Please never duplicate your questions between multiple threads.

Omar Asim5 years ago

Sorry Anton about it.
Can you please let me know a solution for the above problem.

Macan5 years ago

Try this
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>

Hanane3 years ago

Dear all,
Any help please, I installed openGTS and I want to integrate traccar in it, I had already installed and I configured the traccar.xml file as you can show here:

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <entry key='config.default'>./conf/traccar.xml</entry>


    <entry key='web.enable'>false</entry>
    <entry key='web.port'>8082</entry>
    <entry key='web.path'>/opt/traccar/web</entry>
    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>google</entry>
    <entry key='decoder.ignoreSessionCache'>true</entry>
    <entry key='processing.computedAttributes.enable'>true</entry>
    <entry key='logger.enable'>true</entry>
    <entry key='logger.level'>all</entry>
    <entry key='logger.file'>/opt/traccar/logs/tracker-server.log</entry>


<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://MY-ADRESSE-IP:5027/gts?allowMultiQueries=true</entry>
<entry key='database.user'>gts</entry>
<entry key='database.password'>opengts</entry>

<entry key='database.selectDevices'>
    SELECT CONCAT('1', imeiNumber) AS id, imeiNumber AS uniqueId FROM Device WHERE imeiNumber REGEXP '^[0-9]+$';
</entry>

<entry key='database.selectAllDevices'>
    SELECT CONCAT('1', imeiNumber) AS id, imeiNumber AS uniqueId FROM Device WHERE imeiNumber REGEXP '^[0-9]+$';
</entry>

<entry key='database.insertPosition'>
    START TRANSACTION;
        UPDATE Device SET lastValidLatitude = :latitude, lastValidLongitude = :longitude, lastGPSTimestamp = UNIX_TIMESTAMP(:fixTime), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = SUBSTRING(CAST(:deviceId AS CHAR(32)), 2);
        SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = SUBSTRING(CAST(:deviceId AS CHAR(32)), 2);
        INSERT INTO EventData (accountID, deviceID, timestamp, statusCode, latitude, longitude, speedKPH, heading, altitude, rawData, creationTime, address)
        VALUES (@accountID, @deviceID, UNIX_TIMESTAMP(:fixTime), 0, :latitude, :longitude, :speed * 1.852, :course, :altitude, '', UNIX_TIMESTAMP(NOW()), :address);
    COMMIT;
</entry>

</properties>

When I restart the traccar server and look at the tracker-server.log I got error message as follow:

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
2021-06-21 07:14:27 DEBUG: HikariPool-1 - Cannot acquire connection from data source - Connection refused (Connection refused) - ConnectException (... < DataManager:126 < *:85 < Context:290 < Main:120 < ...)
2021-06-21 07:14:28 ERROR: HikariPool-1 - Exception during pool initialization. - Connection refused (Connection refused) - ConnectException (... < DataManager:126 < *:85 < Context:290 < Main:120 < ...)
2021-06-21 07:14:28 ERROR: Main method error - Connection refused (Connection refused) - ConnectException (... < DataManager:126 < *:85 < Context:290 < Main:120 < ...)

Any Help Please !!

Anton Tananaev3 years ago

Your issue doesn't seem to be related to this topic.