Setup and database error

david3 years ago

Hello,

I open this https://www.traccar.org/build/
Downloaded git clone --recursive https://github.com/traccar/traccar.git on my computer and I can ran server with https://www.traccar.org/build-in-intellij-ide
Then downloaded https://github.com/traccar/traccar-client-android on my computer and I changed settings_url_default_value http://localhost:5055 in the values.xml file and ı ran it with Android Studio.
I changed database congifiguration in the setup/traccar.xml file

<entry key='database.driver'>com.microsoft.sqlserver.jdbc.SQLServerDriver</entry>
<entry key='database.url'>jdbc:sqlserver://DESKTOP-G3I5468JT;user=ercesa;password=123;databaseName=Takip;</entry>
<entry key='database.user'>ercesa</entry>
<entry key='database.password'>123</entry>

And I ran again with invalidate chaches/restart .Database tables did not exist in the Microsoft Sql Server. And I have one more question on the traccar client side does any database have a configuration process?
How it is work? Please, could you please help.

Anton Tananaev3 years ago

And which config file are you running with in your IDE? If you followed IntelliJ guide, there's a debug config file.

david3 years ago

I use IntelliJ. As I understand there are two config file. These are .setup/traccar.xml and debug.xml. Inside of debug.xml

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

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

<properties>

    <entry key='config.default'>./setup/default.xml</entry>

    <entry key='web.path'>./traccar-web/web</entry>
    <entry key='web.debug'>true</entry>
    <entry key='web.console'>true</entry>

    <entry key='geocoder.enable'>false</entry>
    <entry key='geocoder.type'>ban</entry>

    <entry key='logger.console'>true</entry>


    <entry key='database.driver'>org.h2.Driver</entry>
    <entry key='database.url'>jdbc:h2:./data/database</entry>
    <entry key='database.user'>sa</entry>
    <entry key='database.password'></entry>

    <entry key='atrack.custom'>true</entry>
    <entry key='intellitrac.port'>6037</entry>

</properties>

And inside of traccar.xml

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

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

<properties>


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

    This is the main configuration file. All your configuration parameters should be placed in this file.

    Default configuration parameters are located in the "default.xml" file. You should not modify it to avoid issues
    with upgrading to a new version. Parameters in the main config file override values in the default file. Do not
    remove "config.default" parameter from this file unless you know what you are doing.

    For list of available parameters see following page: https://www.traccar.org/configuration-file/

    -->
    <entry key='database.driver'>com.microsoft.sqlserver.jdbc.SQLServerDriver</entry>
    <entry key='database.url'>jdbc:sqlserver://DESKTOP-G3I5468JT;user=ercesa;password=123;databaseName=Takip;</entry>
    <entry key='database.user'>ercesa</entry>
    <entry key='database.password'>123</entry>

</properties>
Anton Tananaev3 years ago

So, which one of those are you using?

david3 years ago

I don't know how it is determined?

david3 years ago

I wrote the database information to traccar.xml

Anton Tananaev3 years ago

If you haven't specified it explicitly, then it's probably debug.xml.

david3 years ago

When I downloaded the project, I did not make any changes except what I said above..So should debug.xml be like this?

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

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

<properties>

    <entry key='config.default'>./setup/default.xml</entry>

    <entry key='web.path'>./traccar-web/web</entry>
    <entry key='web.debug'>true</entry>
    <entry key='web.console'>true</entry>

    <entry key='geocoder.enable'>false</entry>
    <entry key='geocoder.type'>ban</entry>

    <entry key='logger.console'>true</entry>


    <entry key='database.driver'>com.microsoft.sqlserver.jdbc.SQLServerDriver</entry>
    <entry key='database.url'>jdbc:sqlserver://DESKTOP-G3I5468JT;user=ercesa;password=123;databaseName=Takip;</entry>
    <entry key='database.user'>ercesa</entry>
    <entry key='database.password'>123</entry>

    <entry key='atrack.custom'>true</entry>
    <entry key='intellitrac.port'>6037</entry>

</properties>
Anton Tananaev3 years ago

Have you tried before asking?

david3 years ago

Now I tried. Tables came to my sql server. However, I got an error like

1.Caused by: java.lang.IllegalMonitorStateException
2.Execution failed for task ':Main.main()'.
> Process 'command 'C:/Program Files/Java/jdk-15.0.1/bin/java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
david3 years ago

How can I fix these errors. Can you help me? Please.

Anton Tananaev3 years ago

Do you have any development experience? I can't really help with every single small thing.

david3 years ago

OK. I will fix the mistakes but I have a few questions about traccar.
On the Android client side, just replace the settings_url_default_value value with http: // MyIPAdress: 5055 and
On the server side, I will only configure the database and run localhost: 8082, right? Is any database configuration required on the Android Client side?

Also, without entering any database information on the server side, localhost: 8082 works and where does user registration etc. occur?
Could you please answer? Thank you.

Anton Tananaev3 years ago

Is any database configuration required on the Android Client side?

No.

Also, without entering any database information on the server side, localhost: 8082 works and where does user registration etc. occur?

There is always database config. Traccar won't start without it.

david3 years ago

Ok, so it uses the h2 database by default, but how and from where can I see the tables and data when the database information remains h2 in the debug.xml file?