Ole8700 / openhab

Automatically exported from code.google.com/p/openhab
GNU General Public License v3.0
1 stars 0 forks source link

DB40 & restoreOnStartup doesn't working in last build #381 #228

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
> What steps will reproduce the problem?
1. Download #381 from https://openhab.ci.cloudbees.com/job/openHAB/ and run
2. Update NumberOne or NumberTwo item to any value via console
3. Shutdown openHAB
4. Run again
5. Print current persist state  as openhab items
6. Values entered in step #2 not restored

> What version of the product are you using? On what operating system?
Build #381, Mac OS X 10.8.3
$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-11M4203)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode)

> Please provide any additional information below.
Please to see attached openhab.log with all my commands that can reproduce this 
bug.

P.S: Also attached log from my production openHAB that time by time generating 
several hundred lines of errors, that linked with db4o

Original issue reported on code.google.com by m...@ikravets.com on 4 Apr 2013 at 2:23

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by teichsta on 9 Apr 2013 at 8:12

GoogleCodeExporter commented 9 years ago
Thanks for the report - this issue has been fixed as part of the changeset 
https://code.google.com/p/openhab/source/detail?r=52ea8e7b55c7a55b25df9fa28b84eb
cb2e51de14

Original comment by kai.openhab on 12 Apr 2013 at 9:55

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This bug not fixed in #390 build. Do you test it before close?

Original comment by m...@ikravets.com on 13 Apr 2013 at 7:05

GoogleCodeExporter commented 9 years ago
Also last build generates very interesting log:

22:02:40.426 INFO  o.o.c.internal.CoreActivator[:92]- openHAB runtime has been 
started (v1.2.0).
22:02:45.529 WARN  o.o.m.c.i.ModelRepositoryImpl[:77]- Configuration model 
'db4o.persist' is either empty or cannot be parsed correctly!
22:02:45.535 WARN  o.o.m.c.i.ModelRepositoryImpl[:82]- Configuration model 
'rrd4j.persist' can not be found
22:02:45.834 WARN  o.o.m.c.i.ModelRepositoryImpl[:82]- Configuration model 
'presencesimulation.persist' can not be found
22:02:45.977 WARN  o.o.m.c.i.ModelRepositoryImpl[:82]- Configuration model 
'db4o.persist' can not be found
22:02:45.986 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'db4o.persist'
22:02:46.096 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'db4o.persist'
22:02:46.161 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'rrd4j.persist'
22:02:46.209 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'rrd4j.persist'
22:02:47.817 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'main.items'
22:02:49.361 INFO  o.o.i.s.i.DiscoveryServiceImpl[:92]- mDNS service has been 
started.
22:02:52.295 INFO  o.o.i.r.i.RESTApplication[:158]- Started REST API at /rest
22:02:58.120 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'main.sitemap'
22:02:59.738 ERROR OSGi[:98]- Could not bind a reference of component 
org.openhab.ui.webapp.pagerenderer. The reference is: Reference[name = 
WidgetRenderer, interface = org.openhab.ui.webapp.render.WidgetRenderer, policy 
= dynamic, cardinality = 0..n, target = null, bind = addWidgetRenderer, unbind 
= removeWidgetRenderer]
22:02:59.739 ERROR OSGi[:98]- Could not bind a reference of component 
org.openhab.ui.webapp.pagerenderer. The reference is: Reference[name = 
WidgetRenderer, interface = org.openhab.ui.webapp.render.WidgetRenderer, policy 
= dynamic, cardinality = 0..n, target = null, bind = addWidgetRenderer, unbind 
= removeWidgetRenderer]
22:02:59.743 INFO  o.o.u.w.i.s.WebAppServlet[:99]- Started Classic UI at 
/openhab.app

Original comment by m...@ikravets.com on 13 Apr 2013 at 7:06

GoogleCodeExporter commented 9 years ago
Ok, here we go - my results using #391.
Setup: runtime + db4o persistence addon + your demo.items + your db4o.persist

Here is the log:

macbookpro:oh-runtime kai$ ./start.sh 
Launching the openHAB runtime...
osgi> 23:43:48.058 INFO  o.o.c.internal.CoreActivator[:92] - openHAB runtime 
has been started (v1.2.0).
23:43:49.752 INFO  o.o.i.s.i.DiscoveryServiceImpl[:92] - mDNS service has been 
started
23:43:50.365 INFO  o.o.i.r.i.RESTApplication[:158] - Started REST API at /rest
23:43:58.728 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'db4o.persist'
23:43:58.769 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'demo.items'
23:44:00.539 INFO  o.o.u.w.i.s.WebAppServlet[:99] - Started Classic UI at 
/openhab.app
openhab status NumberOne
Uninitialized
osgi> openhab update NumberOne 1
Update has been sent successfully.
osgi> 23:44:22.092 INFO  runtime.busevents[:46] - NumberOne state updated to 1
exit
Really want to stop Equinox? (y/n; default=y)  y

[db4o 8.0.224.15975   2013-04-13 23:44:26] 
 'etc/db4o/store.db4o' closed by ShutdownHook.
23:44:27.710 INFO  o.o.i.r.i.RESTApplication[:174] - Stopped REST API
23:44:27.711 INFO  o.o.i.s.i.DiscoveryServiceImpl[:77] - Unregistering service 
_openhab-server._tcp.local. at port 8080
23:44:27.711 INFO  o.o.i.s.i.DiscoveryServiceImpl[:77] - Unregistering service 
_openhab-server-ssl._tcp.local. at port 8443
23:44:27.713 INFO  o.o.u.w.i.s.WebAppServlet[:110] - Stopped Classic UI
macbookpro:oh-runtime kai$ ./start.sh 
Launching the openHAB runtime...
osgi> 23:44:39.328 INFO  o.o.c.internal.CoreActivator[:92] - openHAB runtime 
has been started (v1.2.0).
23:44:40.964 INFO  o.o.i.s.i.DiscoveryServiceImpl[:92] - mDNS service has been 
started
23:44:41.601 INFO  o.o.i.r.i.RESTApplication[:158] - Started REST API at /rest
23:44:49.954 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'db4o.persist'
23:44:50.021 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'demo.items'
23:44:51.662 INFO  o.o.u.w.i.s.WebAppServlet[:99] - Started Classic UI at 
/openhab.app
openhab status NumberOne
1

Original comment by kai.openhab on 13 Apr 2013 at 9:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
# 392 Build. Downloaded from https://openhab.ci.cloudbees.com/job/openHAB/392/
db4o.persist  & demo.items not changed, see above.

Please download distribution-1.2.0-SNAPSHOT-runtime.zip and 
distribution-1.2.0-SNAPSHOT-addons.zip
Move 'org.openhab.persistence.db4o-1.2.0-SNAPSHOT.jar' to 'addons', 
db4o.persist to 'persistence', and 'demo.items' to 'items'.
In openhab.cfg set 'persistence:default=db4o'

Log attached.

Original comment by m...@ikravets.com on 14 Apr 2013 at 9:40

Attachments:

GoogleCodeExporter commented 9 years ago
So what I understand from your log is that the second item is not restored 
correctly. The use case that you described in this issue above is about storing 
and restoring a single item - and this is what I tested all the time and which 
works.

Original comment by kai.openhab on 14 Apr 2013 at 9:44

GoogleCodeExporter commented 9 years ago
I have found the problem. If you open db4o.persist, you will see that it is not 
a valid file - which results in the fact that the persistence service only 
considers NumberOne, but not NumberTwo.
If you add a colon at the end of the line (see attached version), it works as 
expected.
I am aware that this syntax is not very user-friendly; I simply didn't yet find 
a way to get rid of the ":" if the default strategies should be applied.

Original comment by kai.openhab on 14 Apr 2013 at 10:08

Attachments:

GoogleCodeExporter commented 9 years ago
Yes, with ":" this works in test folder and in my prodcuction openHAB with more 
complicated db4o file. Thanks a lot!

Original comment by m...@ikravets.com on 14 Apr 2013 at 11:43