iam trying to store the yahoo weather data into a MySQL Database using OpenHab1 JPA Binding.
At first i imported the JPA Binding into OpenHab2.
By stratring the Binding i get the error message “Got a null properties object!”
# connection string url
jpa:url=jdbc:mysql://localhost:3306/openhab2
# driver class name
jpa:driver=com.mysql.jdbc.Driver
# username
user=admin
# password
password=XXX
It seems that the JPA Binding can’t find the jpa.cfg file.
The documentation of the Binding says that the JPA config has to be stored into openhab.conf for OH1.
In OH2 i stored it simply into the jpa.cfg file.
Do i have to change something else, so the Binding is using the jpa.cfg file and is not searching for openhab.conf ?
Under OH2, you should have the jpa.cfg in the services folder (which you probably have), but the problem is likely that you need to remove the jpa from the from of the config lines -:
Just to note that he’s not using the mySQL service - the JPA service is being used and I’m not sure if the same problem existed there. It might have as the issue was related to an extension that was added to a number of persistence services in OH1 that had to be removed…
This methods has a parameter called proberties witch contains the JPA configuration settings. In my case it is null. I assume that the jpa.cfg is not read properly so the informations can’t be stored into the dictionary. I was looking for the point where this class is used, but i can’t find it.
I’m pretty sure it’s wrong though - it may not matter for some configs that have a good default, but the URL is probably required?
Regarding the error, I was recently told that this error isn’t anything to worry about -:
You don’t actually say if persistence is working or not. I’m assuming not, but please confirm because if it is working, then you should just ignore this error as it (apparently) doesn’t mean anything - the null dictionary case is (apparently!) normal.
That is probably correct, but to be honest, I don’t use the JPA binding - I’m using (or was using untill recently) the mysql binding… It works in the same way though in that you just need to create the database, and the tables are created automatically.
Correct. I am using the JPA binding, and all necessary tables (actually, there is only one in which all the items get persisted into) are created if they do not already exist.
Openhab2 with the daily builds from cloudbees. The “naked” MySQL binding did not work for me (because of the Issue 312 I mentioned a few posts ago), so I started using the JPA binding.
I’m personally using OH2. mySQL works with OH2 - there was a problem with some versions of most persistence services (not just mySQL) with OH2 due to something that was added to OH1, and this has now been removed.
So, I think that the current version of mySQL is now ok (although I’ve not tested it). Alternatively, a version before 1.6.1 I think is also ok (and I have tested that with OH2).
I cloned the Openhab2 Repo a while ago, maybe jam using a old version.
I will clone the actual version of openhab2 repo and test if the problem still exists.