Teekanne / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

Loading model resources sometimes throws exceptions #171

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I had a working configuration of openhab 1.0.0
Today I tried to migrate it to latest snapshot version. Migration seems 
sucseeded, but log file is gowing with following error loggings:
11 Dec 2012 21:56:25.582 ERROR o.e.x.l.l.LazyLinkingResource[:214]- resolution 
of uriFragment 'xtextL
ink_::0::1::/12' failed.
org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, 
size=0
        at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346)
        at org.eclipse.xtext.linking.lazy.LazyURIEncoder.resolveShortFragment(LazyURIEncoder.java:101
)
        at org.eclipse.xtext.linking.lazy.LazyURIEncoder.decode(LazyURIEncoder.java:89)
        at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:166
)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
        at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:201)
11 Dec 2012 21:56:25.610 ERROR o.e.x.l.l.LazyLinkingResource[:214]- resolution 
of uriFragment 'xtextL
ink_::0::1::/12' failed.
org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, 
size=0
        at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346)
        at org.eclipse.xtext.linking.lazy.LazyURIEncoder.resolveShortFragment(LazyURIEncoder.java:101
)
        at org.eclipse.xtext.linking.lazy.LazyURIEncoder.decode(LazyURIEncoder.java:89)
        at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:166
)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
        at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:197)

the log lines appear in my log file almost every 5 seconds. So log file will 
become huge.
What could be the problem ?

Original issue reported on code.google.com by ramazany...@gmail.com on 11 Dec 2012 at 9:02

GoogleCodeExporter commented 8 years ago
Addition: I open all config files in designer, and it did not find any errors 
in items,rules,scripts...

Original comment by ramazany...@gmail.com on 11 Dec 2012 at 9:04

GoogleCodeExporter commented 8 years ago
the first time when the error appeared in the openhab.log:

11 Dec 2012 21:56:18.855 ERROR o.o.m.c.i.f.FolderObserver[:125]- An unexpected 
exception has occured
java.lang.IllegalStateException: A resource with the normalized URI 
'logging.persist' was already registered. The resource with the URI 
'org.eclipse.xtext.linking.lazy.LazyLinkingResource@e31699 
uri='logging.persist'' is no longer registered with the normalized form.
    at org.eclipse.xtext.resource.XtextResourceSet.registerURI(XtextResourceSet.java:75)
    at org.eclipse.xtext.resource.XtextResourceSet$ResourcesList.inverseAdd(XtextResourceSet.java:95)
    at org.eclipse.xtext.resource.XtextResourceSet$ResourcesList.inverseAdd(XtextResourceSet.java:1)
    at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:312)
    at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:301)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:435)
11 Dec 2012 21:56:18.974 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 
'rrd4j.persist'
11 Dec 2012 21:56:19.132 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 
'db4o.persist'
11 Dec 2012 21:56:19.192 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 
'presencesimulation.persist'
11 Dec 2012 21:56:21.151 ERROR o.e.x.l.l.LazyLinkingResource[:214]- resolution 
of uriFragment 'xtextLink_::0::1::/12' failed.
org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, 
size=0
    at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346)
    at org.eclipse.xtext.linking.lazy.LazyURIEncoder.resolveShortFragment(LazyURIEncoder.java:101)
    at org.eclipse.xtext.linking.lazy.LazyURIEncoder.decode(LazyURIEncoder.java:89)
    at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:166)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
    at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:201)
11 Dec 2012 21:56:21.179 ERROR o.e.x.l.l.LazyLinkingResource[:214]- resolution 
of uriFragment 'xtextLink_::0::1::/12' failed.
org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, 
size=0
    at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346)
    at org.eclipse.xtext.linking.lazy.LazyURIEncoder.resolveShortFragment(LazyURIEncoder.java:101)
    at org.eclipse.xtext.linking.lazy.LazyURIEncoder.decode(LazyURIEncoder.java:89)
    at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:166)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
    at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:197)

Original comment by ramazany...@gmail.com on 11 Dec 2012 at 9:06

GoogleCodeExporter commented 8 years ago
I'm running it on D2Plug with debian linux and use jdk1.7 for ARM: 
opt/jdk1.7.0_06/bin/java -version
java version "1.7.0_06"
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
Java HotSpot(TM) Client VM (build 23.2-b09, mixed mode)
PlugPBX:/mnt/internalsd/opt/openhab/runtime#

Original comment by ramazany...@gmail.com on 11 Dec 2012 at 9:08

GoogleCodeExporter commented 8 years ago
when I run openhab 1.1 with same configuration on windows there is no such 
error logging. Seems problem is only applicable for linux JDK.

Original comment by ramazany...@gmail.com on 18 Dec 2012 at 11:03

GoogleCodeExporter commented 8 years ago
After restart of openhab on linux box error so far disappeared. Will keep an 
eye on logs for some time too see if problem is still there.

Original comment by ramazany...@gmail.com on 18 Dec 2012 at 11:33

GoogleCodeExporter commented 8 years ago
I seeing this error with a clean 1.1 installation on my Ubuntu maschine as well 
as on my Raspberry PI.

Original comment by gzock...@gmail.com on 3 Jan 2013 at 8:20

GoogleCodeExporter commented 8 years ago
some times after restart problem appears again. Have to restart openhab until 
that error disappears. Seems some timing issue.

Original comment by ramazany...@gmail.com on 4 Jan 2013 at 2:03

GoogleCodeExporter commented 8 years ago
I sometimes get a

23:30:46.153 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'exec.persist'
23:30:46.153 WARN  o.o.m.c.i.ModelRepositoryImpl[:82] - Configuration model 
'exec.persist.persist' can not be found

which also occurs randomly - maybe this is somehow related (trying to load 
files twice)?

Original comment by kai.openhab on 4 Jan 2013 at 10:32

GoogleCodeExporter commented 8 years ago
Hello,

snip of my log:
...
java.lang.IllegalStateException: A resource with the normalized URI 
'rrd4j.persist' was already registered. The resource with the URI 
'org.eclipse.xtext.linking.lazy.LazyLinkingResource@e98cd3 uri='rrd4j.persist'' 
is no longer registered with the normalized form.
    at org.eclipse.xtext.resource.XtextResourceSet.registerURI(XtextResourceSet.java:75)
    at org.eclipse.xtext.resource.XtextResourceSet$ResourcesList.inverseAdd(XtextResourceSet.java:95)
    at org.eclipse.xtext.resource.XtextResourceSet$ResourcesList.inverseAdd(XtextResourceSet.java:1)
    at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:312)
    at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:301)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:435)
16:56:48.716 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'db4o.persist'
16:56:48.738 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 
'logging.persist'
16:56:48.889 ERROR o.e.x.l.l.LazyLinkingResource[:214]- resolution of 
uriFragment 'xtextLink_::0::1::/19' failed.
org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, 
size=0
...

sometimes hundreds of: "LazyLinkingResource[:214]- resolution of uriFragment 
'xtextLink_"

I'm running a ODROID-U2 with Ubuntu Linaro linux for ARM, openHab 1.1: 
root@linaro:~# java -version
java version "1.7.0_09"
OpenJDK Runtime Environment (IcedTea7 2.3.4) (7u9-2.3.4-0ubuntu1.12.04.1)
OpenJDK Zero VM (build 22.0-b10, mixed mode)

Exactly same Problem, had with preview Oracle Java 1.8 on same Hard and 
Software Environment.

I Have this effect at every normal start on ODROID-U2, PI only sucks every 
third time.
To get it run on ODROID-U2 I have to start/stop it again and again about 5 up 
to 20 Times.
The effective difference between ODROID-U2 and PI is the CPU Power of 
ODROID-U2, it has 4 Cores a 1.7Ghz.

Is there a file read problem?! I suspect ohab wants to process files which are 
not ready loaded...

Hope this helps a bit

Helmut

Original comment by Helmut.L...@gmail.com on 27 Jan 2013 at 5:30

GoogleCodeExporter commented 8 years ago
openhab has a feature that if you  save file it will be refreshed. Could it be 
a case that file is still being loaded on a slow system (like plug PC or 
Raspberyy PI), but at the same time a refresh mechanism tries to read same file 
second time, that causes that 
"A resource with the normalized URI 'logging.persist' was already registered" 
issue ?

Original comment by ramazany...@gmail.com on 1 Apr 2013 at 10:20

GoogleCodeExporter commented 8 years ago
I put refresh timeout on all folder:xxx properties in openhab.cfg to some big 
value (120 in my case. I put it to value bigger than openhab startup time on my 
system). Did some restarts, and now I don't have that error so far. If someone 
can check it on his system (specially raspbery pi) probably we can put some 
recomedations on  a WIKI page for plug computers part.

Original comment by ramazany...@gmail.com on 1 Apr 2013 at 10:43

GoogleCodeExporter commented 8 years ago
I have experienced this both on raspberry pi, and now also on a virtualbox 
running linux (host system windows).

I guess I just reproduced the same error within the refresh timeout, it did not 
seem to work.

# Configuration folders (must exist as a subdirectory of "configurations"; the 
value
# tells the number of seconds for the next scan of the directory for changes. A
# value of -1 deactivates the scan).
# A comma separated list can follow after the refresh value. This list defines 
a filter
# for valid file extensions for the models.
folder:items=120,items
folder:sitemaps=120,sitemap
folder:rules=120,rules
folder:scripts=120,script
folder:persistence=120,persist

Attached my log.

Original comment by kristian...@gmail.com on 5 Apr 2013 at 6:40

Attachments:

GoogleCodeExporter commented 8 years ago
I have just committed a fix 
(https://code.google.com/p/openhab/source/detail?r=3dc2b48d6aed41d500671aef45b89
6af13704a1b), but as I cannot easily reproduce it, I cannot guarantee that this 
issue is solved.
Would anyone of you please retest and provide feedback, if it still occurs?

Original comment by kai.openhab on 9 Apr 2013 at 8:42

GoogleCodeExporter commented 8 years ago
I have now raspberry pi in my hands. had an issue with openahb 1.1.0 (used demo 
sitemap). Downloaded latest snapshot build from cloudbees site (build #386) 
installed and started it. 
Problem disappeared. So seems your fix is working !
thanks a lot..

Original comment by ramazany...@gmail.com on 10 Apr 2013 at 10:07

GoogleCodeExporter commented 8 years ago
Thanks for re-testing!

Original comment by kai.openhab on 12 Apr 2013 at 6:42

GoogleCodeExporter commented 8 years ago

Original comment by kai.openhab on 12 Apr 2013 at 6:43