Error running traccar server

hkeem9 years ago

Hi Anton..

I have installed traccar windows -32-3.5 and the server running well.

On the other side, i have configured the source download zip from gitcub in my own project. I've tried to build the project, and the output is success including for building jar.
But, when i try to run the project, there is an error compiling as follows :

Exception in thread "main" java.lang.NullPointerException
    at org.traccar.database.PermissionsManager.refresh(PermissionsManager.java:75)
    at org.traccar.database.PermissionsManager.<init>(PermissionsManager.java:67)
    at org.traccar.Context.init(Context.java:181)
    at org.traccar.Main.main(Main.java:30)

i've checked that there is null value for "database.url" on it (Context). Whether it causes the error ??. The config file shows that the string value is not null.

Thanks...

Anton Tananaev9 years ago

Have you provided a config file?

hkeem9 years ago

The config file :

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

    <entry key='database.changelog'>C:\Program Files\Traccar\data\changelog-master.xml</entry>

The path of database configured as above. And in Context class, i found the 'getstring' of "database.url" value is null when run compiling the project.

        if (config.hasKey("database.url")) {
            dataManager = new DataManager(config); 
        }

I am not sure if this is the cause.

Thx.

hkeem9 years ago

The path of database configured as above. And in Context class, i found the 'getstring' of "database.url" value is null when run compiling the project.
I am not sure if this is the cause.

Anton Tananaev9 years ago

How do you provide the config when you run your compiled version? Are you sure you are providing correct path to the config?

Anton Tananaev9 years ago

How do you provide the config when you run your compiled version? Are you sure you are providing correct path to the config?

hkeem9 years ago

I have not made many changes, i just extract and build the project with maven as taken from the zip source (downloaded from github) then I change the url path accordingly (database.url) in the configuration file (debug.xml) as described above.

whether there are certain settings in pom.xml?

thanks

Anton Tananaev9 years ago

How do you tell Traccar to use "debug.xml" config?

RJ7 years ago

I'm having a similar issue. Where do I pass the argument to main to have it use the default config?

Always get an error from Context.java, Main.java "configuration file not provided."

Jamil7 years ago

Dear RJ
in nbactions.xml add the an exec.args element:

 -classpath %classpath ${packageClassName} <debug file path>\debug.xml

or if you are using netbeans:
1- right click project (traccar)
2- Select properties
3- under run add debug file path