traccar / traccar

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
5.32k stars 2.6k forks source link

configuration with oracle database #1615

Closed DenRozhko closed 8 years ago

DenRozhko commented 8 years ago

I plan to create the tables later,I want to test connectivity

  1. Download ojdbc7.jar from http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html
  2. Change config file :
 <entry key='database.driverFile'>C:\Program Files (x86)\Traccar\lib\ojdbc7.jar</entry>
    <entry key='database.driver'>oracle.jdbc.OracleDriver</entry>
    <entry key='database.url'>jdbc:oracle:thin:traccar@//10.10.xx.xx:1521/orcl;user=traccar;password=traccar321;</entry>
    <entry key='database.user'>traccar</entry>
    <entry key='database.password'>traccar321</entry>

3.Start traccar service

and...

INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp: 
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error: Encountered an error running main:
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error: liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: oracle.jdbc.OracleDriver
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:247)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:151)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:140)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:160)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at org.traccar.database.DataManager.<init>(DataManager.java:67)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at org.traccar.Context.init(Context.java:121)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at org.traccar.Main.main(Main.java:29)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at java.lang.reflect.Method.invoke(Unknown Source)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:325)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at java.lang.Thread.run(Unknown Source)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error: Caused by: java.lang.RuntimeException: Cannot find database driver: oracle.jdbc.OracleDriver
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:199)
INFO   | jvm 1    | 2015/12/23 18:58:38 | WrapperSimpleApp Error:   ... 12 more
STATUS | wrapper  | 2015/12/23 18:58:41 | <-- Wrapper Stopped

what am I doing wrong?

sosoxuc commented 8 years ago

Missing ojdbc driver Dowload it and place into lib folder

sosoxuc commented 8 years ago

Also maybe you need to change DB creation scripts, but after you get driver

DenRozhko commented 8 years ago

The file has the correct

DenRozhko commented 8 years ago

dB Connect fail. DDL/DML script is not already running

sosoxuc commented 8 years ago

You must download .jar file http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html and place it in lib folder

DenRozhko commented 8 years ago

I did this at the very beginning, read my first post

sosoxuc commented 8 years ago

Sorry, did not noticed beginning

Fact is cannot access file, try changing 'database.driverFile' to something else. Maybe lib/ojdbc7.jar

tananaev commented 8 years ago

Please try this build:

https://www.dropbox.com/s/cgmlansv32j3ii0/tracker-server.jar?dl=0

DenRozhko commented 8 years ago

it works! additionally, I corrected traccar.xml file with the following database.url: <entry key='database.url'>jdbc:oracle:thin:userDB/passwordDB@IP:port:orcl</entry>

Now i look errors creation tables

tananaev commented 8 years ago

Are there still errors? If yes, please provide details.

DenRozhko commented 8 years ago
2015-12-28 03:00:22  INFO: Version: 3.2-SNAPSHOT
2015-12-28 03:00:27  WARN: ORA-00933: SQL command not properly ended
 - SQLSyntaxErrorException (... < QueryBuilder:376 < DataManager:320 < ConnectionManager:55 < ...)
2015-12-28 03:00:27  INFO: Starting server...

...

2015-12-28 03:00:52 DEBUG: [4D6112F6: 5055 < 188.242.174.244] HEX: 474554202f3f69643d3535353535353535352674696d657374616d703d31343531323535353630266c61743d35392e383839333831363636363636363635266c6f6e3d33302e3438373030333333333333333333372673706565643d302e302662656172696e673d302e3026616c7469747564653d2d32352e3426626174743d33332e3020485454502f312e310d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420352e313b204b34303030204275696c642f4c4d59343744290d0a486f73743a203139342e35302e3135322e3234303a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a
2015-12-28 03:00:52  WARN: ORA-00933: SQL command not properly ended
 - SQLSyntaxErrorException (... < QueryBuilder:376 < DataManager:228 < *:118 < *:138 < BaseProtocolDecoder:47 < ...)
2015-12-28 03:01:07  INFO: [377144F6] connected
tananaev commented 8 years ago

It looks like there is some problem with database.selectDevicesAll query.

DenRozhko commented 8 years ago

in config file: <entry key='database.selectDevicesAll'> SELECT * FROM devices; </entry> .... SELECT * FROM devices; is correct and runned well good in sqlDeveloper (GUI for Oracle )

DenRozhko commented 8 years ago
2015-12-28 13:30:23 DEBUG: [CF45C972: 5055 < 217.66.156.91] HEX: 474554202f3f69643d3535353535353535352674696d657374616d703d31343531323535353630266c61743d35392e383839333831363636363636363635266c6f6e3d33302e3438373030333333333333333333372673706565643d302e302662656172696e673d302e3026616c7469747564653d2d32352e3426626174743d33332e3020485454502f312e310d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420352e313b204b34303030204275696c642f4c4d59343744290d0a486f73743a203139342e35302e3135322e3234303a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a
2015-12-28 13:30:23  WARN: ORA-00933: SQL command not properly ended
 - SQLSyntaxErrorException (... < QueryBuilder:376 < DataManager:228 < *:118 < *:138 < BaseProtocolDecoder:47 < ...)
DenRozhko commented 8 years ago

I understood ! it is necessary to remove the final ;

divelgrom commented 8 years ago

Good afternoon, I did not get to connect to Oracle my config file: `

/opt/traccar/lib/ojdbc7.jar
    <entry key='database.driver'>oracle.jdbc.OracleDriver</entry>
    <entry key='database.url'>jdbc:oracle:thin:<user>/<pass>@<host>:<port>:<dbname></entry>
    <entry key='database.user'><user></entry>
    <entry key='database.password'><pass></entry>

`

Log: ==> /opt/traccar/logs/wrapper.log.20160210 <== INFO | jvm 1 | 2016/02/10 13:35:12 | [MLog-Init-Reporter] INFO com.mchange.v2.log.MLog - MLog clients using slf4j logging. INFO | jvm 1 | 2016/02/10 13:35:12 | [WrapperSimpleAppMain] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10] INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp: INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: Encountered an error running main: INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: oracle.jdbc.OracleDriver INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:247) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:151) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:140) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:160) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at org.traccar.database.DataManager.<init>(DataManager.java:67) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at org.traccar.Context.init(Context.java:121) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at org.traccar.Main.main(Main.java:29) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at java.lang.reflect.Method.invoke(Method.java:606) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:325) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at java.lang.Thread.run(Thread.java:745) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: Caused by: java.lang.RuntimeException: Cannot find database driver: oracle.jdbc.OracleDriver INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:199) INFO | jvm 1 | 2016/02/10 13:35:14 | WrapperSimpleApp Error: ... 12 more STATUS | wrapper | 2016/02/10 13:35:16 | <-- Wrapper Stopped

file /opt/traccar/lib/ojdbc7.jar /opt/traccar/lib/ojdbc7.jar: Java archive data (JAR)

I downloaded from the link in: http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html

Traccar version 3.3

HELP ME PLS =)

tananaev commented 8 years ago

@divelgrom, please try this server build:

https://www.dropbox.com/s/cgmlansv32j3ii0/tracker-server.jar?dl=0

divelgrom commented 8 years ago

so all was well. Thank you

The following issues are related to Oracle.