Your configuration is probably invalid XML. Remember that you need to escape certain characters.
You solved it ? See that your server is online.
Ik zie dat je gps server weer online is.
If i remove the <entry key='sms.http.url'.............................. entry it is starting.
I a other post i have seen that the sms can work this way:
<entry key='sms.http.url'>https://service.speakup.nl/msgbroker/?username=username&password=password&originator=065.........&recipients=%phone%&message=%text%</entry>
I whas looking for a way to send a sms by a url.
my sms provider dos not have a api only a url.
If i put the url in my webbrowser it is working.
Can you help me to get this sms provider working?
Hoi Track-trace,
weet jij hoe ik een sms via een url werkend zou kunnen krijgen?
You have to replace &
with &
, at least.
So like this:
<entry key='sms.http.url'>https://service.speakup.nl/msgbroker/?username=username&password=password&originator=065.........&recipients=%phone%&message=%text%</entry>
then sill if i put in this entry the traccar services will not run.
Make sure you validate the whole XML file with some tools.
if i do a xml validation the file is OK.
Try running Java command manually from a command line and see what error you're going to get.
If i run the java manually i get this:
root@Traccar:/opt/traccar# ./jre/bin/java -jar ./tracker-server.jar ./conf/traccar.xml
Database is up to date, no changesets to execute
UPDATE SUMMARY
Run: 0
Previously run: 46
Filtered out: 0
-------------------------------
Total change sets: 46
Exception in thread "main" java.lang.RuntimeException: com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) [Guice/ErrorInCustomProvider]: NullPointerException: Cannot invoke "String.trim()" because the return value of "org.traccar.config.Config.getString(org.traccar.config.ConfigKey)" is null
at MainModule.provideSmsManager(MainModule.java:154)
at BaseProtocol.setSmsManager(BaseProtocol.java:58)
\_ for 1st parameter
while locating Minifinder2Protocol
at ServerManager.<init>(ServerManager.java:49)
at ServerManager.class(ServerManager.java:42)
while locating ServerManager
Learn more:
https://github.com/google/guice/wiki/ERROR_IN_CUSTOM_PROVIDER
1 error
======================
Full classname legend:
======================
BaseProtocol: "org.traccar.BaseProtocol"
MainModule: "org.traccar.MainModule"
Minifinder2Protocol: "org.traccar.protocol.Minifinder2Protocol"
ServerManager: "org.traccar.ServerManager"
========================
End of classname legend:
========================
at org.traccar.Main.run(Main.java:146)
at org.traccar.Main.main(Main.java:110)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) [Guice/ErrorInCustomProvider]: NullPointerException: Cannot invoke "String.trim()" because the return value of "org.traccar.config.Config.getString(org.traccar.config.ConfigKey)" is null
at MainModule.provideSmsManager(MainModule.java:154)
at BaseProtocol.setSmsManager(BaseProtocol.java:58)
\_ for 1st parameter
while locating Minifinder2Protocol
at ServerManager.<init>(ServerManager.java:49)
at ServerManager.class(ServerManager.java:42)
while locating ServerManager
Learn more:
https://github.com/google/guice/wiki/ERROR_IN_CUSTOM_PROVIDER
1 error
======================
Full classname legend:
======================
BaseProtocol: "org.traccar.BaseProtocol"
MainModule: "org.traccar.MainModule"
Minifinder2Protocol: "org.traccar.protocol.Minifinder2Protocol"
ServerManager: "org.traccar.ServerManager"
========================
End of classname legend:
========================
at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1151)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1186)
at org.traccar.Main.run(Main.java:124)
... 1 more
Caused by: java.lang.NullPointerException: Cannot invoke "String.trim()" because the return value of "org.traccar.config.Config.getString(org.traccar.config.ConfigKey)" is null
at org.traccar.sms.HttpSmsClient.<init>(HttpSmsClient.java:59)
at org.traccar.MainModule.provideSmsManager(MainModule.java:155)
at org.traccar.MainModule$$FastClassByGuice$$de817.GUICE$TRAMPOLINE(<generated>)
at org.traccar.MainModule$$FastClassByGuice$$de817.apply(<generated>)
at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.doProvision(ProviderMethod.java:260)
at com.google.inject.internal.ProviderMethod.doProvision(ProviderMethod.java:171)
at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory.provision(InternalProviderInstanceBindingImpl.java:185)
at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory.get(InternalProviderInstanceBindingImpl.java:162)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:40)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:60)
at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:84)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:146)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:124)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1186)
at org.traccar.ServerManager.<init>(ServerManager.java:58)
at org.traccar.ServerManager$$FastClassByGuice$$1d8b6ab.GUICE$TRAMPOLINE(<generated>)
at org.traccar.ServerManager$$FastClassByGuice$$1d8b6ab.apply(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148)
And this is my config:
<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.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://10.2.2.14/traccar?zeroDateTimeBehavior=round&serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key='database.user'>bla</entry>
<entry key='database.password'>bla</entry>
<entry key='web.url'>gps.careapp.nl</entry>
<entry key='notificator.types'>web,mail,sms</entry>
<entry key='mail.smtp.host'>smtp.gmail.com</entry>
<entry key='mail.smtp.port'>465</entry>
<entry key='mail.smtp.ssl.enable'>true</entry>
<entry key='mail.smtp.from'>bla@gmail.com</entry>
<entry key='mail.smtp.auth'>true</entry>
<entry key='mail.smtp.username'>bla@gmail.com</entry>
<entry key='mail.smtp.password'>password</entry>
<entry key='sms.http.enable'>true</entry>
<entry key='sms.http.url'>https://service.speakup.nl/msgbroker/?username=usernam..&password=passwor..G&originator=0658726563&recipients=%phone%&message=%text%</entry>
<entry key='database.registerUnknown'>true</entry>
<entry key='database.registerUnknown.defaultGroupId'>1</entry>
</properties>
Your SMS configuration is wrong. It requires sms.http.template
.
<entry key='sms.http.url'>https://service.speakup.nl/msgbroker/?username=username&password=password&originator=0658726563</entry>
<entry key='sms.http.template'>
recipients={phone}&message={message}
</entry>
Somthing like this:
<entry key='sms.http.url'>https://service.speakup.nl/msgbroker/?username=username&password=password&originator=0658726563</entry>
<entry key='sms.http.template'>
recipients={phone}&message={message}
</entry>
Hi,
A question, i have changed the traccart.xml with a sms url now the services will not start.
So i did somthing wrong in the xml file.
This is my file:
--> <entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry> <entry key='database.url'>jdbc:mysql://ipadress/traccar?zeroDateTimeBehavior=round&serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry> <entry key='database.user'>username</entry> <entry key='database.password'>password</entry> <entry key='web.url'>gps.careapp.nl</entry> <entry key='notificator.types'>web,mail,sms</entry> <entry key='sms.http.url'>https://service.speakup.nl/msgbroker/?username=username&password=password&originator=065.........&recipients=%phone%&message=%text%</entry> <entry key='mail.smtp.host'>smtp.gmail.com</entry> <entry key='mail.smtp.port'>465</entry> <entry key='mail.smtp.ssl.enable'>true</entry> <entry key='mail.smtp.from'>blaoost@gmail.com</entry> <entry key='mail.smtp.auth'>true</entry> <entry key='mail.smtp.username'>blaoost@gmail.com</entry> <entry key='mail.smtp.password'>password</entry> <entry key='database.registerUnknown'>true</entry> <entry key='database.registerUnknown.defaultGroupId'>1</entry> </properties>
I have put in the sms part.