Other B4X Push Server

kreativa

Member
Licensed User
Longtime User
ok i've fixed the problem
was really a problem with the keys!!
now push server it is able to send push message but on log it says: Token added: 956033EF47D04A4xxxxxxxxx
send message to
status=8
why it returns status=8 (invalid token)! the toke seems ok
 

kreativa

Member
Licensed User
Longtime User
Hi!
The last (i hope) problem.
When i call pushserver it replies "Message sent to 1 device(s)."
but on the log console it replies
send message to
status=8
terminated
trying to reconnect
Socket connected

Nobody can help me??
 

kreativa

Member
Licensed User
Longtime User
I deleted several times the db recreating new token but the response was the same.
I'm trying to send push message to my app that is in developer mode.
 

kreativa

Member
Licensed User
Longtime User
ok solved.
Were the provisioning profile!!

everything works
thanks Erel you are great!!
 

tufanv

Expert
Licensed User
Longtime User
I checked the "running your server on vps" tutorial by Erel,

For this pushserver example. do i need to run pushserver.jar on my vps with given instructions at that post ?
 

tufanv

Expert
Licensed User
Longtime User
Yes. It is not different than any other B4J server app.

I asked my server admin to do this and he asks about this to continue with the operation :
"Also, provide us with more information on your Java application requirements, e.g. do you want us install JBoss, Tomcat or GlassFish on your server etc."

What should i reply

edit: I replied them do what the topic says and they did. works perfect ty
 
Last edited:

moster67

Expert
Licensed User
Longtime User
For quite some time, I have been running the PushServer sucessfully on my VPS running CentOS 7. It is located in /home/mike/pushserver/.
However, now I have permission errors (that is what I think). I can start the pushserver (logging in as root and/or my username) and the database itself, push.db, is created however the table "token" is not created.

Anyone knows what to check in my vps-configurations to resolve this issue?

Thanks.
 

moster67

Expert
Licensed User
Longtime User
The tables will only be created if the file doesn't exist. If you want to create a new database then you need to delete the push.db file (as well as the other two push.db files if they exist).
Yes, I know that. I have tested by deleting first the DB and the relevant files so I was sure that a new DB would be created.

The first time I run the pushserver, it does indeed create the DB but it fails to create the table "tokens". The pushserver is also running and seems to work fine. I can successfully pass on messages to send although I get the html-page saying that 0 message was sent. This log message confirms that the server is up and runnning:

B4X:
8X.2XX.52.X00 -  -  [10/Dec/2015:08:29:13 +0000] "GET /send?password=123&text=test HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
8X.2XX.52.X00 -  -  [10/Dec/2015:08:29:16 +0000] "GET /favicon.ico HTTP/1.1" 404 289 "http://www.mysite.com:51044/send?password=xxx&text=test" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"

This is the log when the database is created (and looks good):
B4X:
Creating new database.
CreateTable: CREATE TABLE IF NOT EXISTS [tokens] ([token] TEXT PRIMARY KEY, [type] INTEGER, [updated_time] INTEGER)
2015-12-10 09:24:08.722:INFO::main: Logging initialized @19660ms
2015-12-10 09:24:11.700:INFO:oejs.Server:main: jetty-9.1.z-SNAPSHOT
2015-12-10 09:24:12.464:WARN:oejh.MimeTypes:main: java.util.MissingResourceException: Can't find bundle for base name org/eclipse/jetty/http/encoding, locale en_US
2015-12-10 09:24:15.388:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@2d6a9952{/,file:/home/mike/pushserver/www,AVAILABLE}
2015-12-10 09:24:15.490:INFO:oejs.AbstractNCSARequestLog:main: Opened /home/mike/pushserver/logs/b4j-2015_12_10.request.log
2015-12-10 09:24:16.222:INFO:oejs.ServerConnector:main: Started ServerConnector@445b84c0{HTTP/1.1}{0.0.0.0:51044}
2015-12-10 09:24:16.224:INFO:oejs.Server:main: Started @27969ms
server version: 0.95
server is listening on port: 51044
Feedback Socket connected.
Socket connected.
feedback terminated

But as you can see from the attached image there is no table in the push.db after it was created....

So I am wondering if I need somehow to assign permissions to SQLite to get it working? It used to work but all of sudden it does not.
This is surely not a problem with B4XPushServer but some kind of permission problem on my VPS.

PS: I have tested by logging as root or with my user (using sudo) but no luck. I also had a look at the logs in the /var/log directory but could not find anything which may be related.

Any ideas or help will be most appreciated.
Thanks
 

Attachments

  • db.png
    60 KB · Views: 294
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
My guess is that the table was created successfully. You are only copying the db file so you are missing some of the data (that is in the other two files).

Don't use this db browser.

List the tables with:
B4X:
For Each row() As String In DBUtils.ExecuteMemoryTable(db, "SELECT name FROM sqlite_master WHERE type='table'", Null, 0)
     Log($"Table: ${row(0)}"$)
Next
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…