Hello again ;-)

One thing came to mind: it may be, that fileinstall is installed and started twice, since my Basic Bundle Loader (starts with framework, loads bundls like iPOJO and Fileinstall) gets instanciated and started twice (and I don't know why, he's only added to an activators list and started an framework start using "felix.systembundle.activators")

this may be the original problem. But is this possible? How to check if this happens? When I list all bundles, fileinstall is only shown one time.

I still don't have an idea how to solute this problem.

regards
matthias



Am 20.10.2009 um 10:58 schrieb Matthias Neubert:

Hello,

I suffer from a problem I found using FileInstall 2.0.0 on Felix 2.0.0

When I use my GUI to delete a Jar file in the fileinstall-watched directory, fileinstall tries 2 times nearly at the same time (milliseconds - to seconds) to uninstall the bundle.
This happens always and I always get to same errors:

10-20 10:28:26.325: INFO/System.out(4989): Uninstalled /sdcard/ FelixOSGiBundles/de.mnsoft.mapservice.layer1.qypeimpl_1.0.0.jar

10-20 10:28:30.425: INFO/System.out(4989): ERROR: org.apache.felix.framework.cache.BundleArchive: Unable to record state - java.io.FileNotFoundException: /data/data/ de.mnsoft.felixhostapp/files/felix/cache/bundle20/bundle.state 10-20 10:28:30.435: INFO/System.out(4989): ERROR: Error writing persistent state to bundle archive. (java.io.FileNotFoundException: / data/data/de.mnsoft.felixhostapp/files/felix/cache/bundle20/ bundle.state)

10-20 10:28:30.435: WARN/System.err(4989): java.io.FileNotFoundException: /data/data/de.mnsoft.felixhostapp/ files/felix/cache/bundle20/bundle.state 10-20 10:28:30.435: WARN/System.err(4989): at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java: 231) 10-20 10:28:30.435: WARN/System.err(4989): at java.io.FileOutputStream.<init>(FileOutputStream.java:96) 10-20 10:28:30.435: WARN/System.err(4989): at java.io.FileOutputStream.<init>(FileOutputStream.java:69) 10-20 10:28:30.435: WARN/System.err(4989): at org .apache .felix .framework.util.SecureAction.getFileOutputStream(SecureAction.java: 440) 10-20 10:28:30.435: WARN/System.err(4989): at org .apache .felix .framework.cache.BundleArchive.setPersistentState(BundleArchive.java: 361) 10-20 10:28:30.445: WARN/System.err(4989): at org .apache .felix .framework.BundleImpl.setPersistentStateUninstalled(BundleImpl.java: 760) 10-20 10:28:30.445: WARN/System.err(4989): at org.apache.felix.framework.Felix.uninstallBundle(Felix.java:2197) 10-20 10:28:30.445: WARN/System.err(4989): at org.apache.felix.framework.BundleImpl.uninstall(BundleImpl.java:950) 10-20 10:28:30.445: WARN/System.err(4989): at org .apache .felix .fileinstall .internal.DirectoryWatcher.uninstall(DirectoryWatcher.java:724) 10-20 10:28:30.445: WARN/System.err(4989): at org .apache .felix .fileinstall .internal.DirectoryWatcher.uninstall(DirectoryWatcher.java:600) 10-20 10:28:30.445: WARN/System.err(4989): at org .apache .felix .fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:285)

10-20 10:28:30.445: INFO/System.out(4989): ERROR: org.apache.felix.framework.cache.BundleArchive: Unable to record last modification time - java.io.FileNotFoundException: /data/data/ de.mnsoft.felixhostapp/files/felix/cache/bundle20/bundle.lastmodified

10-20 10:28:30.455: INFO/System.out(4989): ERROR: Error writing last modification time to bundle archive. (java.io.FileNotFoundException: /data/data/de.mnsoft.felixhostapp/ files/felix/cache/bundle20/bundle.lastmodified) 10-20 10:28:30.455: WARN/System.err(4989): java.io.FileNotFoundException: /data/data/de.mnsoft.felixhostapp/ files/felix/cache/bundle20/bundle.lastmodified 10-20 10:28:30.455: WARN/System.err(4989): at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java: 231) 10-20 10:28:30.455: WARN/System.err(4989): at java.io.FileOutputStream.<init>(FileOutputStream.java:96) 10-20 10:28:30.455: WARN/System.err(4989): at java.io.FileOutputStream.<init>(FileOutputStream.java:69) 10-20 10:28:30.455: WARN/System.err(4989): at org .apache .felix .framework.util.SecureAction.getFileOutputStream(SecureAction.java: 440) 10-20 10:28:30.455: WARN/System.err(4989): at org .apache .felix .framework.cache.BundleArchive.setLastModified(BundleArchive.java:532) 10-20 10:28:30.465: WARN/System.err(4989): at org .apache.felix.framework.BundleImpl.setLastModified(BundleImpl.java: 486) 10-20 10:28:30.465: WARN/System.err(4989): at org.apache.felix.framework.Felix.uninstallBundle(Felix.java:2219) 10-20 10:28:30.465: WARN/System.err(4989): at org.apache.felix.framework.BundleImpl.uninstall(BundleImpl.java:950) 10-20 10:28:30.465: WARN/System.err(4989): at org .apache .felix .fileinstall .internal.DirectoryWatcher.uninstall(DirectoryWatcher.java:724) 10-20 10:28:30.465: WARN/System.err(4989): at org .apache .felix .fileinstall .internal.DirectoryWatcher.uninstall(DirectoryWatcher.java:600) 10-20 10:28:30.475: WARN/System.err(4989): at org .apache .felix .fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:285)

10-20 10:28:30.485: INFO/System.out(4989): Uninstalled /sdcard/ FelixOSGiBundles/de.mnsoft.mapservice.layer1.qypeimpl_1.0.0.jar



It seems that the first "pass" removes the directory in cache directory, and the second "pass" tries to write into the gone directory.(which causes error)

BUT: the bundle is uninstalled (and deleted from watched dir)


When I try to reinstall the same bundle (e.g. copy the jar file again into watched dir) I also get errors:

10-20 10:40:46.735: INFO/System.out(4989): ERROR: org.apache.felix.framework.cache.JarRevision: Unable to create revision directory. 10-20 10:40:46.735: INFO/System.out(4989): ERROR: Unable to update the bundle. (java.io.IOException: Unable to create archive directory.) 10-20 10:40:46.735: WARN/System.err(4989): java.io.IOException: Unable to create archive directory. 10-20 10:40:46.735: WARN/System.err(4989): at org .apache .felix.framework.cache.JarRevision.initialize(JarRevision.java:141) 10-20 10:40:46.745: WARN/System.err(4989): at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java: 79) 10-20 10:40:46.745: WARN/System.err(4989): at org .apache .felix .framework .cache.BundleArchive.createRevisionFromLocation(BundleArchive.java: 998) 10-20 10:40:46.745: WARN/System.err(4989): at org .apache .felix.framework.cache.BundleArchive.revise(BundleArchive.java:629) 10-20 10:40:46.745: WARN/System.err(4989): at org.apache.felix.framework.BundleImpl.revise(BundleImpl.java:1043) 10-20 10:40:46.745: WARN/System.err(4989): at org.apache.felix.framework.Felix.updateBundle(Felix.java:1835) 10-20 10:40:46.745: WARN/System.err(4989): at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:908) 10-20 10:40:47.105: DEBUG/dalvikvm(4989): GC freed 45351 objects / 2138144 bytes in 359ms 10-20 10:40:47.105: WARN/System.err(4989): at org .apache .felix .fileinstall.internal.DirectoryWatcher.update(DirectoryWatcher.java: 762) 10-20 10:40:47.105: WARN/System.err(4989): at org .apache .felix .fileinstall.internal.DirectoryWatcher.update(DirectoryWatcher.java: 621) 10-20 10:40:47.105: WARN/System.err(4989): at org .apache .felix .fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:286)

10-20 10:40:47.125: INFO/System.out(4989): Failed to update artifact /sdcard/FelixOSGiBundles/ de.mnsoft.mapservice.layer3.qypeimpl_1.0.0.jar: org.osgi.framework.BundleException: Update of bundle de.mnsoft.mapservice.layer3.qypeimpl [24] failed. 10-20 10:40:47.145: INFO/System.out(4989): org.osgi.framework.BundleException: Update of bundle de.mnsoft.mapservice.layer3.qypeimpl [24] failed. 10-20 10:40:47.145: INFO/System.out(4989): at org.apache.felix.framework.Felix.updateBundle(Felix.java:1966) 10-20 10:40:47.145: INFO/System.out(4989): at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:908) 10-20 10:40:47.155: INFO/System.out(4989): at org .apache .felix .fileinstall.internal.DirectoryWatcher.update(DirectoryWatcher.java: 762) 10-20 10:40:47.155: INFO/System.out(4989): at org .apache .felix .fileinstall.internal.DirectoryWatcher.update(DirectoryWatcher.java: 621) 10-20 10:40:47.155: INFO/System.out(4989): at org .apache .felix .fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:286) 10-20 10:40:47.155: INFO/System.out(4989): Caused by: java.io.IOException: Unable to create archive directory. 10-20 10:40:47.155: INFO/System.out(4989): at org .apache .felix.framework.cache.JarRevision.initialize(JarRevision.java:141) 10-20 10:40:47.155: INFO/System.out(4989): at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java: 79) 10-20 10:40:47.155: INFO/System.out(4989): at org .apache .felix .framework .cache.BundleArchive.createRevisionFromLocation(BundleArchive.java: 998) 10-20 10:40:47.165: INFO/System.out(4989): at org .apache .felix.framework.cache.BundleArchive.revise(BundleArchive.java:629) 10-20 10:40:47.165: INFO/System.out(4989): at org.apache.felix.framework.BundleImpl.revise(BundleImpl.java:1043) 10-20 10:40:47.165: INFO/System.out(4989): at org.apache.felix.framework.Felix.updateBundle(Felix.java:1835)
10-20 10:40:47.165: INFO/System.out(4989):     ... 4 more


Then he installs the bundle new which then works. I don't know if this behavior is wanted by the author. I have got a simular "double execution problem" with an Bundle- installing and starting activator which is loaded ate framework startup (using "felix.systembundle.activators") If I avoid the double start in my Loader-Activator the Bundles aren't installed. If I allow it, *sometimes* I receive error about that he could not read the jar file.

For me all this sounds like threading problems. Usually there are only millisoconds or max. 3-4 seconds between this strange double- calls.



Does someone know abaout this behavior or knows how to avoid that it occurs?



regards
Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to