You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Matthias Neubert <su...@onlinehome.de> on 2009/07/07 19:42:06 UTC

Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Hello,

since nobody answered on my first mail (subject "Android + Felix 1.80  
= Problems")
I took the long way and found the solution on my own. It took a bit  
longer because I'm completely new to OSGi and felix.

First the solution on that one thing, then the current bug:

Solution:
Felix 1.8.0 release doesn't have the patch for Android compatible  
Classloading ( before I thought it has it already), so in adb shell  
the command "chmod 777 /data/dalvik-cache" has to be executed (which  
shows us, that this will not work on a real phone)

-> with Felix 1.8.0 and the little "hack" it now runs and its starting  
Bundles. This is the first step getting the outdated ipojo sample  
running. May be some more work is left.
-> without the hack, systembundle and ipojo.annotations get active,  
but for example shell, shelltui and iPojo remain resolved and doesn't  
start.


Problem/Bug:
occures when I try run Felix 1.9.0 Snapshot as embedded in an Android  
Application.(same project as mentioned above, just switched classpath  
to newer jar file)
The access-rights-hack doesn't help here, so it must be a bug or  
something like that.

If someone is interested in this bug, I can send my eclipse project,  
if needed







Here is the stacktrace: (from DDMS Android Debugger)

07-07 19:02:31.133: WARN/dalvikvm(1187): Exception Ljava/lang/ 
RuntimeException; thrown during Lorg/apache/felix/framework/ 
ModuleImpl;.<clinit>

07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout has  
expired, giving up wake lock!
07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle timeout  
for HistoryRecord{435f61b0 {de.mn.felixembedand/ 
de.mn.felixembedand.FelixEmbedAndStarter}}
07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM

07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread exiting  
with uncaught exception (group=0x4000fe70)
07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught handler:  
thread main exiting due to uncaught exception
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):  
java.lang.ExceptionInInitializerError
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
org 
.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java: 
142)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
org.apache.felix.framework.Felix.<init>(Felix.java:302)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
de 
.mn 
.felixembedand.FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java: 
77)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 
1123)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 
2231)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 
2284)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
android.app.ActivityThread.access$1800(ActivityThread.java:112)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
android.os.Handler.dispatchMessage(Handler.java:99)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
android.os.Looper.loop(Looper.java:123)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
android.app.ActivityThread.main(ActivityThread.java:3948)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
java.lang.reflect.Method.invokeNative(Native Method)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
java.lang.reflect.Method.invoke(Method.java:521)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
com.android.internal.os.ZygoteInit 
$MethodAndArgsCaller.run(ZygoteInit.java:782)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
dalvik.system.NativeStart.main(Native Method)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:  
java.lang.RuntimeException: Problem creating boot delegation class  
loader.
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:114)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:  
java.lang.reflect.InvocationTargetException
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
java.lang.reflect.Constructor.constructNative(Native Method)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
java.lang.reflect.Constructor.newInstance(Constructor.java:446)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
org.apache.felix.framework.util.SecureAction.invoke(SecureAction.java: 
862)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:109)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:  
java.lang.NullPointerException: Parent ClassLoader may not be null
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
java.lang.ClassLoader.<init>(ClassLoader.java:239)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at  
java.lang.ClassLoader.<init>(ClassLoader.java:226)
07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more




My Config:
Eclipse 3.4
Android SDK 1.5r2
ADT 0.91 (current)
Java SDK: JVM 1.5.0 MacOS X


regards
matthias

Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Matthias Neubert <su...@onlinehome.de>.
Hallo again ;-)

I just compiled the whole felix trunk with the "patched" pom.xml in  
fileinstall directory. I changed the export value

from
<Export-Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,  
org.osgi.service.log</Export-Package>

to
<Export-Package>org.apache.felix.fileinstall.* </Export-Package>


=> It worked, I can now add felix and fileinstall to an Android Project.

BUT

while using "new FileInstall()" I get the error

The type org.osgi.service.cm.ManagedServiceFactory cannot be resolved.  
It is indirectly referenced from required .class files

I'll try again with
<Export-Package>org.apache.felix.fileinstall.*,org.osgi.service.cm</ 
Export-Package>

insead, and will report later. If meanwhile someone has another idea,  
please feel free to interupt me.

regards
matthias





Am 08.07.2009 um 15:29 schrieb Matthias Neubert:

> Hello,
>
>> Workaround: just set the property as a string for the key and install
>> the fileinstall bundle into felix. That should make it work.
>
> thats right, but it doesn't help with the activator-part in the  
> HostApp
>
>
>> I'm not sure (would have to look at it first) but it is pretty common
>> in OSGi land to have bundles that have some shared packages embedded
>> to make them working standalone and when they can get the package  
>> from
>> another provider.
>
> I currently checked the FileInstall Sources. There is no  
> "org.osgi.service.log" implemented,
> but DirectoryWatcher imports and uses it: import  
> org.osgi.service.log.*;  The mentioned LogEntry is not used there!
>
> Then I checked the pom.xml and pom-transformed.xml file of  
> fileinstall (todays snapshot) There I found it:
>
> <build>
>    <plugins>
>      <plugin>
>        <groupId>org.apache.felix</groupId>
>        <artifactId>maven-bundle-plugin</artifactId>
>        <version>1.4.0</version>
>        <extensions>true</extensions>
>        <configuration>
>          <instructions>
>            <Export- 
> Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,  
> org.osgi.service.log</Export-Package>            <-- HERE
>            <Bundle- 
> Activator>org.apache.felix.fileinstall.FileInstall</Bundle-Activator>
>            <Bundle-SymbolicName>${pom.artifactId}</Bundle- 
> SymbolicName>
>            <Bundle-Vendor>The Apache Software Foundation</Bundle- 
> Vendor>
>          </instructions>
>        </configuration>
>      </plugin>
> ...
>
>
>
> may be "org.osgi.service.cm" would be the next issue.
>
> If I understand it right, that maven integrated the  
> "org.osgi.service.log" classes (and may be cm) into fileinstall.jar  
> on build.
> The same is done while building feilx 1.9.0.
>
> The dex tool, or the APK Builder (makes app file bundles which are  
> installed to the phone/emulator) has a problem, when 2 jars
> have the same package integrated, right?
>
> -> I gues the problem is not the eclipse plugin it self, its the dx  
> or apkbuilder tool delivered with android sdk which do the trouble
>
> I'll try to build fileinstall without this 2 packages in pom.xml ,  
> to see if this "patched" fileinstall make trouble too.
>
> Regarding fileinstall there is no difference for me in pom.xml  
> between 1.20 and 130snapshot
>
>
> I keep on searching. May be we'll find a good solution.  
> (unfortunatly I cannot wait for Google fixing this. I also believe  
> they dont want to fix this)
>
>
>
> regards
> matthias
>
>
>
>
> Am 08.07.2009 um 14:22 schrieb Karl Pauls:
>
>> On Wed, Jul 8, 2009 at 2:12 PM, Matthias  
>> Neubert<su...@onlinehome.de> wrote:
>>> Hello,
>>>
>>> I add Fileinstall, because my Android HostApplication with its  
>>> embedded
>>> Felix shall
>>> watch a directory on the Android Phone where new Bundles are  
>>> stored to.
>>> I'm following mostly the iPojo+Android Sample on:
>>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html .
>>>
>>> For that I add Fileinstall Dir to Felix' config like this:
>>>
>>> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/bundle");
>>> //"felix.fileinstall.dir"
>>> configProps.put(DirectoryWatcher.DEBUG,  
>>> "1"); //"felix.fileinstall.debug"
>>
>> Workaround: just set the property as a string for the key and install
>> the fileinstall bundle into felix. That should make it work.
>>
>>> In the HostApplication it self I use FileInstall the following way:
>>>
>>> Adding FileInstall to AutoStart with System Bundle:
>>>
>>> List<BundleActivator> activatorList = new  
>>> ArrayList<BundleActivator>();
>>> activatorList.add(m_hostActivator);
>>>
>>> activatorList.add(new FileInstall());
>>>
>>> // add list of activators which shall be started with system  
>>> bundle to
>>> config
>>> m_felixProperties.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>>> activatorList);
>>>
>>>
>>> Equipped with fileinstall I guess the ServiceTracker (see iPojo 
>>> +Android
>>> Sample) notices when a bundle
>>> copied to the watched directory is installed and started (by  
>>> fileinstall)
>>>
>>> If there is an other way, please tell me! (generally I have some  
>>> problems
>>> understanding that loose coupling thing in Felix and iPojo. I have  
>>> to read
>>> more regarding this issue.)
>>>
>>> The thing I wonder about is why this problem occurs in 1.9.0 but  
>>> not in
>>> 1.8.0. Why I an class defined in fileinstall (with identical name an
>>> package) also defined in felix 1.9.0?
>>
>> I'm not sure (would have to look at it first) but it is pretty common
>> in OSGi land to have bundles that have some shared packages embedded
>> to make them working standalone and when they can get the package  
>> from
>> another provider.
>>
>>> As far as I know the dexer stops at the first problem. So it may  
>>> be that
>>>
>>> Lorg/osgi/service/log/LogEntry;
>>>
>>> is not the only problem. It also may happen at other Jars than
>>> fileinstall.jar
>>>
>>> I don't know about visibility filters in eclipse. I will try to  
>>> find out.
>>> But I think it's not a real solution to do it that way.
>>
>> Sounds like a bug/problem with android or their eclipse integration  
>> to me.
>>
>> regards,
>>
>> Karl
>>
>>>
>>> regards
>>> Matthias
>>>
>>>
>>>
>>>
>>>
>>> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>>>
>>>> Well, why would you want to add fileinstall in the first place? You
>>>> could just dex it and then install as a bundle no?
>>>>
>>>> Regarding the issue, it looks like the dex compiler can't handle
>>>> multiple definitions of the same class in one compile. Thats not  
>>>> nice
>>>> but not the end of the world either I guess. If you have to have  
>>>> both
>>>> felix and fileinstall on the classpath then maybe try to set-up a
>>>> visibility filter for one of them that filters out the package in
>>>> question.
>>>>
>>>> regards,
>>>>
>>>> Karl
>>>>
>>>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias Neubert<sureal@onlinehome.de 
>>>> >
>>>> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I've tried your patch and it worked! Thank you!
>>>>>
>>>>> BUT:
>>>>>
>>>>> There is another Problem which only occur in all 1.9.0 snapshots  
>>>>> (4. ,
>>>>> 7.,
>>>>> 8. july), but NOT with 1.8.0 :
>>>>>
>>>>> If I add in my Android Project in Eclipse the fileinstall.jar  
>>>>> (1.2.0 or
>>>>> current snapshot) to classpath while
>>>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get  
>>>>> folling
>>>>> Error
>>>>> when Eclipse tries to build the project (right after adding)
>>>>>
>>>>> -> this does not happen with Felix 1.8.0
>>>>>
>>>>> -> I can add fileinstall.jar without problems if no felix.jar is  
>>>>> added
>>>>>
>>>>> -> if adding fileinstall.jar first, then adding felix.jar, the  
>>>>> same
>>>>> problem
>>>>> occurs
>>>>>
>>>>> -> problem also occurs in a completly fresh android project
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>>>> java.lang.IllegalArgumentException: already added:
>>>>> Lorg/osgi/service/log/LogEntry;
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com 
>>>>> .android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java: 
>>>>> 123)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java: 
>>>>> 228)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> com 
>>>>> .android 
>>>>> .dx 
>>>>> .cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java: 
>>>>> 245)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> com 
>>>>> .android 
>>>>> .dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> com 
>>>>> .android 
>>>>> .dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> sun 
>>>>> .reflect 
>>>>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> sun 
>>>>> .reflect 
>>>>> .DelegatingMethodAccessorImpl 
>>>>> .invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> java.lang.reflect.Method.invoke(Method.java:585)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown  
>>>>> Source)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>> $2.run(BuildManager.java:633)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> org 
>>>>> .eclipse 
>>>>> .core.internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>>> 170)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> org 
>>>>> .eclipse 
>>>>> .core.internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>>> 201)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>> $1.run(BuildManager.java:253)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> org 
>>>>> .eclipse 
>>>>> .core.internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>>> 256)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> org 
>>>>> .eclipse 
>>>>> .core 
>>>>> .internal.events.BuildManager.basicBuildLoop(BuildManager.java: 
>>>>> 309)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> org 
>>>>> .eclipse 
>>>>> .core.internal.events.BuildManager.build(BuildManager.java:341)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> org 
>>>>> .eclipse 
>>>>> .core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> org 
>>>>> .eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java: 
>>>>> 238)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik  
>>>>> format
>>>>> failed
>>>>> with error 1
>>>>>
>>>>>
>>>>>
>>>>> regards
>>>>> Matthias
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>>>>>
>>>>>> Ok, I have committed a potential workaround as described here:
>>>>>>
>>>>>> https://issues.apache.org/jira/browse/FELIX-1193
>>>>>>
>>>>>> If you could test again on trunk and respond on the issue that  
>>>>>> would be
>>>>>> great. Thanks!
>>>>>>
>>>>>> -> richard
>>>>>>
>>>>>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>>>>>
>>>>>>> Looks like a bug in android. Or at least it is something where  
>>>>>>> sun
>>>>>>> java behaves differently then dalvik/android. Anyways, we  
>>>>>>> should be
>>>>>>> able to workaround this. We will track this using FELIX-1193.  
>>>>>>> Thanks
>>>>>>> for letting us know!
>>>>>>>
>>>>>>> regards,
>>>>>>>
>>>>>>> Karl
>>>>>>>
>>>>>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias Neubert<sureal@onlinehome.de 
>>>>>>> >
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> since nobody answered on my first mail (subject "Android +  
>>>>>>>> Felix 1.80
>>>>>>>> =
>>>>>>>> Problems")
>>>>>>>> I took the long way and found the solution on my own. It took  
>>>>>>>> a bit
>>>>>>>> longer
>>>>>>>> because I'm completely new to OSGi and felix.
>>>>>>>>
>>>>>>>> First the solution on that one thing, then the current bug:
>>>>>>>>
>>>>>>>> Solution:
>>>>>>>> Felix 1.8.0 release doesn't have the patch for Android  
>>>>>>>> compatible
>>>>>>>> Classloading ( before I thought it has it already), so in adb  
>>>>>>>> shell
>>>>>>>> the
>>>>>>>> command "chmod 777 /data/dalvik-cache" has to be executed  
>>>>>>>> (which shows
>>>>>>>> us,
>>>>>>>> that this will not work on a real phone)
>>>>>>>>
>>>>>>>> ->  with Felix 1.8.0 and the little "hack" it now runs and its
>>>>>>>> starting
>>>>>>>> Bundles. This is the first step getting the outdated ipojo  
>>>>>>>> sample
>>>>>>>> running.
>>>>>>>> May be some more work is left.
>>>>>>>> ->  without the hack, systembundle and ipojo.annotations get  
>>>>>>>> active,
>>>>>>>> but
>>>>>>>> for
>>>>>>>> example shell, shelltui and iPojo remain resolved and doesn't  
>>>>>>>> start.
>>>>>>>>
>>>>>>>>
>>>>>>>> Problem/Bug:
>>>>>>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an  
>>>>>>>> Android
>>>>>>>> Application.(same project as mentioned above, just switched  
>>>>>>>> classpath
>>>>>>>> to
>>>>>>>> newer jar file)
>>>>>>>> The access-rights-hack doesn't help here, so it must be a bug  
>>>>>>>> or
>>>>>>>> something
>>>>>>>> like that.
>>>>>>>>
>>>>>>>> If someone is interested in this bug, I can send my eclipse  
>>>>>>>> project,
>>>>>>>> if
>>>>>>>> needed
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>>>>>
>>>>>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>>>>>> Ljava/lang/RuntimeException; thrown during
>>>>>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>>>>>
>>>>>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout  
>>>>>>>> has
>>>>>>>> expired,
>>>>>>>> giving up wake lock!
>>>>>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle  
>>>>>>>> timeout
>>>>>>>> for
>>>>>>>> HistoryRecord{435f61b0
>>>>>>>> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
>>>>>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down  
>>>>>>>> VM
>>>>>>>>
>>>>>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread  
>>>>>>>> exiting
>>>>>>>> with
>>>>>>>> uncaught exception (group=0x4000fe70)
>>>>>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught  
>>>>>>>> handler:
>>>>>>>> thread
>>>>>>>> main exiting due to uncaught exception
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>>>>>> java.lang.ExceptionInInitializerError
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>> org 
>>>>>>>> .apache 
>>>>>>>> .felix 
>>>>>>>> .framework.ExtensionManager.<init>(ExtensionManager.java:142)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>> de 
>>>>>>>> .mn 
>>>>>>>> .felixembedand 
>>>>>>>> .FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>> android 
>>>>>>>> .app 
>>>>>>>> .Instrumentation.callActivityOnCreate(Instrumentation.java: 
>>>>>>>> 1123)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>> android 
>>>>>>>> .app.ActivityThread.performLaunchActivity(ActivityThread.java: 
>>>>>>>> 2231)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>> android 
>>>>>>>> .app.ActivityThread.handleLaunchActivity(ActivityThread.java: 
>>>>>>>> 2284)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.app.ActivityThread 
>>>>>>>> $H.handleMessage(ActivityThread.java:1692)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.os.Looper.loop(Looper.java:123)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>> com.android.internal.os.ZygoteInit 
>>>>>>>> $MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> dalvik.system.NativeStart.main(Native Method)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>> java.lang.RuntimeException: Problem creating boot delegation  
>>>>>>>> class
>>>>>>>> loader.
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> org 
>>>>>>>> .apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>>>>> 114)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.security.SecureClassLoader.<init>(SecureClassLoader.java: 
>>>>>>>> 76)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>> org 
>>>>>>>> .apache 
>>>>>>>> .felix.framework.util.SecureAction.invoke(SecureAction.java: 
>>>>>>>> 862)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> org 
>>>>>>>> .apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>>>>> 109)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>> java.lang.NullPointerException: Parent ClassLoader may not be  
>>>>>>>> null
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> My Config:
>>>>>>>> Eclipse 3.4
>>>>>>>> Android SDK 1.5r2
>>>>>>>> ADT 0.91 (current)
>>>>>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>>>>>
>>>>>>>>
>>>>>>>> regards
>>>>>>>> matthias
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Karl Pauls
>>>> karlpauls@gmail.com
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>
>>>
>>
>>
>>
>> -- 
>> Karl Pauls
>> karlpauls@gmail.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Stephan Heuser <st...@gmail.com>.
Thanks for your quick response


On Thu, Jul 9, 2009 at 3:25 PM, Karl Pauls<ka...@gmail.com> wrote:
> the current trunk doesn't need the chmod hack. 1.8 needs it.

I am aware of that, for stability reasons i just want to stay at 1.8.1 for now.

Cheers,
Stephan

>
> regards,
>
> Karl
>
> Am 09.07.2009 um 15:14 schrieb Stephan Heuser <st...@gmail.com>:
>
>> Hi Matthias,
>>
>> did you run into any additional problems running Felix 1.8.(0/1) on
>> Android? I applied the patches mentioned in FELIX-1156 , however i
>> still have chmod my dalvik cache folder to be writeable for all users.
>> FRAMEWORK_STORAGE ist set to a newly created temp folder, i am
>> following the iPOJO tutorial too.
>>
>> And was there a special reason to switch to a 1.9.0 snapshot? I am
>> asking because i might be using iPOJO later, i don't know exactly yet.
>>
>> Another thing, how do you deploy your bundles which will be used by
>> file installer? currently i am pushing the bundles manually to the sd
>> card.
>>
>> Cheers,
>> Stephan
>>
>> On Thu, Jul 9, 2009 at 11:57 AM, Matthias Neubert<su...@onlinehome.de>
>> wrote:
>>>
>>> Hello,
>>>
>>> it finally worked!!
>>>
>>> Loading Fileinstall via an activator from resources dir of Android
>>> project
>>> and starting it doesn't interfer
>>> with the other bundles (which are started the same way)
>>>
>>> Meanwhile I learned, that the folder watched by fileinstall shall NOT be
>>> the
>>> same folder fileinstall and the other on startup loaded
>>> bundles are installed to. I now have to seperate folders for this.
>>>
>>> The best thing is: After some changes I now got the tutorial on
>>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html run in
>>> the
>>> the following configuration:
>>>
>>> Felix 1.9.0 (current snapshot 08.July.2009)
>>> FileInstall 1.3.0 snap
>>> iPojo snap
>>> iPojo.arch snap
>>> Android SDK 1.5r2
>>> Eclipse 3.4
>>> MacOS X 10.5.7
>>> JVM 1.5 (set to 1.6 compatibility mode in eclipse)
>>>
>>> WITHOUT "chmod 777 /data/dalvik-cache"
>>>
>>> this  hopefully makes this sample work on a real 1.5 android device. Next
>>> weeks I hope to be able to borrow an G1 Phone
>>> from my university to test this on an real device. I will later report on
>>> that if someone is interested.
>>>
>>> Thank you all who helped me working this out. You realy helped me getting
>>> further with my diploma thesis!
>>>
>>> For those who are interested I commit my code on an google code project
>>> website. It will take some time to add some clean code
>>> comments in english language. If someone here is interested, I post the
>>> link
>>> here.
>>>
>>>
>>> regards
>>> Matthias
>>>
>>>
>>> Am 08.07.2009 um 16:53 schrieb Matthias Neubert:
>>>
>>>> Hello,
>>>>
>>>> OK, I'try it.
>>>>
>>>> Current state: newly build felix and fileinstall (with "patch" without
>>>> osgi log package)
>>>> works. I get no more errors and can start the app.
>>>>
>>>> BUT ;-)
>>>>
>>>> this causes the other bundles (like ipojo, ipojo.arch, shell, shelltui)
>>>> which load via an InstallerActivator from resources area of the android
>>>> project)
>>>> not to start correctly.
>>>>
>>>> I'll try loading and  starting fileinstall with the same method lie the
>>>> other bundles and then I'll see if the problems remain.
>>>>
>>>>
>>>> regards
>>>> matthias
>>>>
>>>>
>>>>
>>>>
>>>> Am 08.07.2009 um 16:43 schrieb Karl Pauls:
>>>>
>>>>> On Wed, Jul 8, 2009 at 3:29 PM, Matthias Neubert<su...@onlinehome.de>
>>>>> wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>>> Workaround: just set the property as a string for the key and install
>>>>>>> the fileinstall bundle into felix. That should make it work.
>>>>>>
>>>>>> thats right, but it doesn't help with the activator-part in the
>>>>>> HostApp
>>>>>
>>>>> You don't need to do the activator part if you just install the
>>>>> fileinstall.jar as a bundle.
>>>>>
>>>>> regards,
>>>>>
>>>>> Karl
>>>>>
>>>>>>> I'm not sure (would have to look at it first) but it is pretty common
>>>>>>> in OSGi land to have bundles that have some shared packages embedded
>>>>>>> to make them working standalone and when they can get the package
>>>>>>> from
>>>>>>> another provider.
>>>>>>
>>>>>> I currently checked the FileInstall Sources. There is no
>>>>>> "org.osgi.service.log" implemented,
>>>>>> but DirectoryWatcher imports and uses it: import
>>>>>> org.osgi.service.log.*;
>>>>>> The mentioned LogEntry is not used there!
>>>>>>
>>>>>> Then I checked the pom.xml and pom-transformed.xml file of fileinstall
>>>>>> (todays snapshot) There I found it:
>>>>>>
>>>>>> <build>
>>>>>>  <plugins>
>>>>>>   <plugin>
>>>>>>     <groupId>org.apache.felix</groupId>
>>>>>>     <artifactId>maven-bundle-plugin</artifactId>
>>>>>>     <version>1.4.0</version>
>>>>>>     <extensions>true</extensions>
>>>>>>     <configuration>
>>>>>>       <instructions>
>>>>>>
>>>>>> <Export-Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,
>>>>>> org.osgi.service.log</Export-Package>            <-- HERE
>>>>>>
>>>>>>
>>>>>>
>>>>>> <Bundle-Activator>org.apache.felix.fileinstall.FileInstall</Bundle-Activator>
>>>>>>         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
>>>>>>         <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
>>>>>>       </instructions>
>>>>>>     </configuration>
>>>>>>   </plugin>
>>>>>> ...
>>>>>>
>>>>>>
>>>>>>
>>>>>> may be "org.osgi.service.cm" would be the next issue.
>>>>>>
>>>>>> If I understand it right, that maven integrated the
>>>>>> "org.osgi.service.log"
>>>>>> classes (and may be cm) into fileinstall.jar on build.
>>>>>> The same is done while building feilx 1.9.0.
>>>>>>
>>>>>> The dex tool, or the APK Builder (makes app file bundles which are
>>>>>> installed
>>>>>> to the phone/emulator) has a problem, when 2 jars
>>>>>> have the same package integrated, right?
>>>>>>
>>>>>> -> I gues the problem is not the eclipse plugin it self, its the dx or
>>>>>> apkbuilder tool delivered with android sdk which do the trouble
>>>>>>
>>>>>> I'll try to build fileinstall without this 2 packages in pom.xml , to
>>>>>> see if
>>>>>> this "patched" fileinstall make trouble too.
>>>>>>
>>>>>> Regarding fileinstall there is no difference for me in pom.xml between
>>>>>> 1.20
>>>>>> and 130snapshot
>>>>>>
>>>>>>
>>>>>> I keep on searching. May be we'll find a good solution. (unfortunatly
>>>>>> I
>>>>>> cannot wait for Google fixing this. I also believe they dont want to
>>>>>> fix
>>>>>> this)
>>>>>>
>>>>>>
>>>>>>
>>>>>> regards
>>>>>> matthias
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 08.07.2009 um 14:22 schrieb Karl Pauls:
>>>>>>
>>>>>>> On Wed, Jul 8, 2009 at 2:12 PM, Matthias
>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I add Fileinstall, because my Android HostApplication with its
>>>>>>>> embedded
>>>>>>>> Felix shall
>>>>>>>> watch a directory on the Android Phone where new Bundles are stored
>>>>>>>> to.
>>>>>>>> I'm following mostly the iPojo+Android Sample on:
>>>>>>>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html .
>>>>>>>>
>>>>>>>> For that I add Fileinstall Dir to Felix' config like this:
>>>>>>>>
>>>>>>>> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/bundle");
>>>>>>>> //"felix.fileinstall.dir"
>>>>>>>> configProps.put(DirectoryWatcher.DEBUG, "1");
>>>>>>>> //"felix.fileinstall.debug"
>>>>>>>
>>>>>>> Workaround: just set the property as a string for the key and install
>>>>>>> the fileinstall bundle into felix. That should make it work.
>>>>>>>
>>>>>>>> In the HostApplication it self I use FileInstall the following way:
>>>>>>>>
>>>>>>>> Adding FileInstall to AutoStart with System Bundle:
>>>>>>>>
>>>>>>>> List<BundleActivator> activatorList = new
>>>>>>>> ArrayList<BundleActivator>();
>>>>>>>> activatorList.add(m_hostActivator);
>>>>>>>>
>>>>>>>> activatorList.add(new FileInstall());
>>>>>>>>
>>>>>>>> // add list of activators which shall be started with system bundle
>>>>>>>> to
>>>>>>>> config
>>>>>>>> m_felixProperties.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>>>>>>>> activatorList);
>>>>>>>>
>>>>>>>>
>>>>>>>> Equipped with fileinstall I guess the ServiceTracker (see
>>>>>>>> iPojo+Android
>>>>>>>> Sample) notices when a bundle
>>>>>>>> copied to the watched directory is installed and started (by
>>>>>>>> fileinstall)
>>>>>>>>
>>>>>>>> If there is an other way, please tell me! (generally I have some
>>>>>>>> problems
>>>>>>>> understanding that loose coupling thing in Felix and iPojo. I have
>>>>>>>> to
>>>>>>>> read
>>>>>>>> more regarding this issue.)
>>>>>>>>
>>>>>>>> The thing I wonder about is why this problem occurs in 1.9.0 but not
>>>>>>>> in
>>>>>>>> 1.8.0. Why I an class defined in fileinstall (with identical name an
>>>>>>>> package) also defined in felix 1.9.0?
>>>>>>>
>>>>>>> I'm not sure (would have to look at it first) but it is pretty common
>>>>>>> in OSGi land to have bundles that have some shared packages embedded
>>>>>>> to make them working standalone and when they can get the package
>>>>>>> from
>>>>>>> another provider.
>>>>>>>
>>>>>>>> As far as I know the dexer stops at the first problem. So it may be
>>>>>>>> that
>>>>>>>>
>>>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>>>>
>>>>>>>> is not the only problem. It also may happen at other Jars than
>>>>>>>> fileinstall.jar
>>>>>>>>
>>>>>>>> I don't know about visibility filters in eclipse. I will try to find
>>>>>>>> out.
>>>>>>>> But I think it's not a real solution to do it that way.
>>>>>>>
>>>>>>> Sounds like a bug/problem with android or their eclipse integration
>>>>>>> to
>>>>>>> me.
>>>>>>>
>>>>>>> regards,
>>>>>>>
>>>>>>> Karl
>>>>>>>
>>>>>>>>
>>>>>>>> regards
>>>>>>>> Matthias
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>>>>>>>>
>>>>>>>>> Well, why would you want to add fileinstall in the first place? You
>>>>>>>>> could just dex it and then install as a bundle no?
>>>>>>>>>
>>>>>>>>> Regarding the issue, it looks like the dex compiler can't handle
>>>>>>>>> multiple definitions of the same class in one compile. Thats not
>>>>>>>>> nice
>>>>>>>>> but not the end of the world either I guess. If you have to have
>>>>>>>>> both
>>>>>>>>> felix and fileinstall on the classpath then maybe try to set-up a
>>>>>>>>> visibility filter for one of them that filters out the package in
>>>>>>>>> question.
>>>>>>>>>
>>>>>>>>> regards,
>>>>>>>>>
>>>>>>>>> Karl
>>>>>>>>>
>>>>>>>>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias
>>>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> I've tried your patch and it worked! Thank you!
>>>>>>>>>>
>>>>>>>>>> BUT:
>>>>>>>>>>
>>>>>>>>>> There is another Problem which only occur in all 1.9.0 snapshots
>>>>>>>>>> (4.
>>>>>>>>>> ,
>>>>>>>>>> 7.,
>>>>>>>>>> 8. july), but NOT with 1.8.0 :
>>>>>>>>>>
>>>>>>>>>> If I add in my Android Project in Eclipse the fileinstall.jar
>>>>>>>>>> (1.2.0
>>>>>>>>>> or
>>>>>>>>>> current snapshot) to classpath while
>>>>>>>>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get
>>>>>>>>>> folling
>>>>>>>>>> Error
>>>>>>>>>> when Eclipse tries to build the project (right after adding)
>>>>>>>>>>
>>>>>>>>>> -> this does not happen with Felix 1.8.0
>>>>>>>>>>
>>>>>>>>>> -> I can add fileinstall.jar without problems if no felix.jar is
>>>>>>>>>> added
>>>>>>>>>>
>>>>>>>>>> -> if adding fileinstall.jar first, then adding felix.jar, the
>>>>>>>>>> same
>>>>>>>>>> problem
>>>>>>>>>> occurs
>>>>>>>>>>
>>>>>>>>>> -> problem also occurs in a completly fresh android project
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>>>>>>>>> java.lang.IllegalArgumentException: already added:
>>>>>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> java.lang.reflect.Method.invoke(Method.java:585)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik
>>>>>>>>>> format
>>>>>>>>>> failed
>>>>>>>>>> with error 1
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> regards
>>>>>>>>>> Matthias
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Karl Pauls <ka...@gmail.com>.
the current trunk doesn't need the chmod hack. 1.8 needs it.

regards,

Karl

Am 09.07.2009 um 15:14 schrieb Stephan Heuser  
<st...@gmail.com>:

> Hi Matthias,
>
> did you run into any additional problems running Felix 1.8.(0/1) on
> Android? I applied the patches mentioned in FELIX-1156 , however i
> still have chmod my dalvik cache folder to be writeable for all users.
> FRAMEWORK_STORAGE ist set to a newly created temp folder, i am
> following the iPOJO tutorial too.
>
> And was there a special reason to switch to a 1.9.0 snapshot? I am
> asking because i might be using iPOJO later, i don't know exactly yet.
>
> Another thing, how do you deploy your bundles which will be used by
> file installer? currently i am pushing the bundles manually to the sd
> card.
>
> Cheers,
> Stephan
>
> On Thu, Jul 9, 2009 at 11:57 AM, Matthias  
> Neubert<su...@onlinehome.de> wrote:
>> Hello,
>>
>> it finally worked!!
>>
>> Loading Fileinstall via an activator from resources dir of Android  
>> project
>> and starting it doesn't interfer
>> with the other bundles (which are started the same way)
>>
>> Meanwhile I learned, that the folder watched by fileinstall shall  
>> NOT be the
>> same folder fileinstall and the other on startup loaded
>> bundles are installed to. I now have to seperate folders for this.
>>
>> The best thing is: After some changes I now got the tutorial on
>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html  
>> run in the
>> the following configuration:
>>
>> Felix 1.9.0 (current snapshot 08.July.2009)
>> FileInstall 1.3.0 snap
>> iPojo snap
>> iPojo.arch snap
>> Android SDK 1.5r2
>> Eclipse 3.4
>> MacOS X 10.5.7
>> JVM 1.5 (set to 1.6 compatibility mode in eclipse)
>>
>> WITHOUT "chmod 777 /data/dalvik-cache"
>>
>> this  hopefully makes this sample work on a real 1.5 android  
>> device. Next
>> weeks I hope to be able to borrow an G1 Phone
>> from my university to test this on an real device. I will later  
>> report on
>> that if someone is interested.
>>
>> Thank you all who helped me working this out. You realy helped me  
>> getting
>> further with my diploma thesis!
>>
>> For those who are interested I commit my code on an google code  
>> project
>> website. It will take some time to add some clean code
>> comments in english language. If someone here is interested, I post  
>> the link
>> here.
>>
>>
>> regards
>> Matthias
>>
>>
>> Am 08.07.2009 um 16:53 schrieb Matthias Neubert:
>>
>>> Hello,
>>>
>>> OK, I'try it.
>>>
>>> Current state: newly build felix and fileinstall (with "patch"  
>>> without
>>> osgi log package)
>>> works. I get no more errors and can start the app.
>>>
>>> BUT ;-)
>>>
>>> this causes the other bundles (like ipojo, ipojo.arch, shell,  
>>> shelltui)
>>> which load via an InstallerActivator from resources area of the  
>>> android
>>> project)
>>> not to start correctly.
>>>
>>> I'll try loading and  starting fileinstall with the same method  
>>> lie the
>>> other bundles and then I'll see if the problems remain.
>>>
>>>
>>> regards
>>> matthias
>>>
>>>
>>>
>>>
>>> Am 08.07.2009 um 16:43 schrieb Karl Pauls:
>>>
>>>> On Wed, Jul 8, 2009 at 3:29 PM, Matthias Neubert<sureal@onlinehome.de 
>>>> >
>>>> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>>> Workaround: just set the property as a string for the key and  
>>>>>> install
>>>>>> the fileinstall bundle into felix. That should make it work.
>>>>>
>>>>> thats right, but it doesn't help with the activator-part in the  
>>>>> HostApp
>>>>
>>>> You don't need to do the activator part if you just install the
>>>> fileinstall.jar as a bundle.
>>>>
>>>> regards,
>>>>
>>>> Karl
>>>>
>>>>>> I'm not sure (would have to look at it first) but it is pretty  
>>>>>> common
>>>>>> in OSGi land to have bundles that have some shared packages  
>>>>>> embedded
>>>>>> to make them working standalone and when they can get the  
>>>>>> package from
>>>>>> another provider.
>>>>>
>>>>> I currently checked the FileInstall Sources. There is no
>>>>> "org.osgi.service.log" implemented,
>>>>> but DirectoryWatcher imports and uses it: import  
>>>>> org.osgi.service.log.*;
>>>>> The mentioned LogEntry is not used there!
>>>>>
>>>>> Then I checked the pom.xml and pom-transformed.xml file of  
>>>>> fileinstall
>>>>> (todays snapshot) There I found it:
>>>>>
>>>>> <build>
>>>>>  <plugins>
>>>>>    <plugin>
>>>>>      <groupId>org.apache.felix</groupId>
>>>>>      <artifactId>maven-bundle-plugin</artifactId>
>>>>>      <version>1.4.0</version>
>>>>>      <extensions>true</extensions>
>>>>>      <configuration>
>>>>>        <instructions>
>>>>>
>>>>> <Export- 
>>>>> Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,
>>>>> org.osgi.service.log</Export-Package>            <-- HERE
>>>>>
>>>>>
>>>>> <Bundle-Activator>org.apache.felix.fileinstall.FileInstall</ 
>>>>> Bundle-Activator>
>>>>>          <Bundle-SymbolicName>${pom.artifactId}</Bundle- 
>>>>> SymbolicName>
>>>>>          <Bundle-Vendor>The Apache Software Foundation</Bundle- 
>>>>> Vendor>
>>>>>        </instructions>
>>>>>      </configuration>
>>>>>    </plugin>
>>>>> ...
>>>>>
>>>>>
>>>>>
>>>>> may be "org.osgi.service.cm" would be the next issue.
>>>>>
>>>>> If I understand it right, that maven integrated the
>>>>> "org.osgi.service.log"
>>>>> classes (and may be cm) into fileinstall.jar on build.
>>>>> The same is done while building feilx 1.9.0.
>>>>>
>>>>> The dex tool, or the APK Builder (makes app file bundles which are
>>>>> installed
>>>>> to the phone/emulator) has a problem, when 2 jars
>>>>> have the same package integrated, right?
>>>>>
>>>>> -> I gues the problem is not the eclipse plugin it self, its the  
>>>>> dx or
>>>>> apkbuilder tool delivered with android sdk which do the trouble
>>>>>
>>>>> I'll try to build fileinstall without this 2 packages in  
>>>>> pom.xml , to
>>>>> see if
>>>>> this "patched" fileinstall make trouble too.
>>>>>
>>>>> Regarding fileinstall there is no difference for me in pom.xml  
>>>>> between
>>>>> 1.20
>>>>> and 130snapshot
>>>>>
>>>>>
>>>>> I keep on searching. May be we'll find a good solution.  
>>>>> (unfortunatly I
>>>>> cannot wait for Google fixing this. I also believe they dont  
>>>>> want to fix
>>>>> this)
>>>>>
>>>>>
>>>>>
>>>>> regards
>>>>> matthias
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 08.07.2009 um 14:22 schrieb Karl Pauls:
>>>>>
>>>>>> On Wed, Jul 8, 2009 at 2:12 PM, Matthias Neubert<sureal@onlinehome.de 
>>>>>> >
>>>>>> wrote:
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I add Fileinstall, because my Android HostApplication with its
>>>>>>> embedded
>>>>>>> Felix shall
>>>>>>> watch a directory on the Android Phone where new Bundles are  
>>>>>>> stored
>>>>>>> to.
>>>>>>> I'm following mostly the iPojo+Android Sample on:
>>>>>>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html 
>>>>>>>  .
>>>>>>>
>>>>>>> For that I add Fileinstall Dir to Felix' config like this:
>>>>>>>
>>>>>>> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/ 
>>>>>>> bundle");
>>>>>>> //"felix.fileinstall.dir"
>>>>>>> configProps.put(DirectoryWatcher.DEBUG, "1");
>>>>>>> //"felix.fileinstall.debug"
>>>>>>
>>>>>> Workaround: just set the property as a string for the key and  
>>>>>> install
>>>>>> the fileinstall bundle into felix. That should make it work.
>>>>>>
>>>>>>> In the HostApplication it self I use FileInstall the following  
>>>>>>> way:
>>>>>>>
>>>>>>> Adding FileInstall to AutoStart with System Bundle:
>>>>>>>
>>>>>>> List<BundleActivator> activatorList = new
>>>>>>> ArrayList<BundleActivator>();
>>>>>>> activatorList.add(m_hostActivator);
>>>>>>>
>>>>>>> activatorList.add(new FileInstall());
>>>>>>>
>>>>>>> // add list of activators which shall be started with system  
>>>>>>> bundle to
>>>>>>> config
>>>>>>> m_felixProperties. 
>>>>>>> put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>>>>>>> activatorList);
>>>>>>>
>>>>>>>
>>>>>>> Equipped with fileinstall I guess the ServiceTracker (see
>>>>>>> iPojo+Android
>>>>>>> Sample) notices when a bundle
>>>>>>> copied to the watched directory is installed and started (by
>>>>>>> fileinstall)
>>>>>>>
>>>>>>> If there is an other way, please tell me! (generally I have some
>>>>>>> problems
>>>>>>> understanding that loose coupling thing in Felix and iPojo. I  
>>>>>>> have to
>>>>>>> read
>>>>>>> more regarding this issue.)
>>>>>>>
>>>>>>> The thing I wonder about is why this problem occurs in 1.9.0  
>>>>>>> but not
>>>>>>> in
>>>>>>> 1.8.0. Why I an class defined in fileinstall (with identical  
>>>>>>> name an
>>>>>>> package) also defined in felix 1.9.0?
>>>>>>
>>>>>> I'm not sure (would have to look at it first) but it is pretty  
>>>>>> common
>>>>>> in OSGi land to have bundles that have some shared packages  
>>>>>> embedded
>>>>>> to make them working standalone and when they can get the  
>>>>>> package from
>>>>>> another provider.
>>>>>>
>>>>>>> As far as I know the dexer stops at the first problem. So it  
>>>>>>> may be
>>>>>>> that
>>>>>>>
>>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>>>
>>>>>>> is not the only problem. It also may happen at other Jars than
>>>>>>> fileinstall.jar
>>>>>>>
>>>>>>> I don't know about visibility filters in eclipse. I will try  
>>>>>>> to find
>>>>>>> out.
>>>>>>> But I think it's not a real solution to do it that way.
>>>>>>
>>>>>> Sounds like a bug/problem with android or their eclipse  
>>>>>> integration to
>>>>>> me.
>>>>>>
>>>>>> regards,
>>>>>>
>>>>>> Karl
>>>>>>
>>>>>>>
>>>>>>> regards
>>>>>>> Matthias
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>>>>>>>
>>>>>>>> Well, why would you want to add fileinstall in the first  
>>>>>>>> place? You
>>>>>>>> could just dex it and then install as a bundle no?
>>>>>>>>
>>>>>>>> Regarding the issue, it looks like the dex compiler can't  
>>>>>>>> handle
>>>>>>>> multiple definitions of the same class in one compile. Thats  
>>>>>>>> not nice
>>>>>>>> but not the end of the world either I guess. If you have to  
>>>>>>>> have both
>>>>>>>> felix and fileinstall on the classpath then maybe try to set- 
>>>>>>>> up a
>>>>>>>> visibility filter for one of them that filters out the  
>>>>>>>> package in
>>>>>>>> question.
>>>>>>>>
>>>>>>>> regards,
>>>>>>>>
>>>>>>>> Karl
>>>>>>>>
>>>>>>>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias
>>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> I've tried your patch and it worked! Thank you!
>>>>>>>>>
>>>>>>>>> BUT:
>>>>>>>>>
>>>>>>>>> There is another Problem which only occur in all 1.9.0  
>>>>>>>>> snapshots (4.
>>>>>>>>> ,
>>>>>>>>> 7.,
>>>>>>>>> 8. july), but NOT with 1.8.0 :
>>>>>>>>>
>>>>>>>>> If I add in my Android Project in Eclipse the  
>>>>>>>>> fileinstall.jar (1.2.0
>>>>>>>>> or
>>>>>>>>> current snapshot) to classpath while
>>>>>>>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get  
>>>>>>>>> folling
>>>>>>>>> Error
>>>>>>>>> when Eclipse tries to build the project (right after adding)
>>>>>>>>>
>>>>>>>>> -> this does not happen with Felix 1.8.0
>>>>>>>>>
>>>>>>>>> -> I can add fileinstall.jar without problems if no  
>>>>>>>>> felix.jar is
>>>>>>>>> added
>>>>>>>>>
>>>>>>>>> -> if adding fileinstall.jar first, then adding felix.jar,  
>>>>>>>>> the same
>>>>>>>>> problem
>>>>>>>>> occurs
>>>>>>>>>
>>>>>>>>> -> problem also occurs in a completly fresh android project
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>>>>>>>> java.lang.IllegalArgumentException: already added:
>>>>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>> com. 
>>>>>>>>> android. 
>>>>>>>>> dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java: 
>>>>>>>>> 276)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main 
>>>>>>>>> $1.processFileBytes(Main.java:228)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> com. 
>>>>>>>>> android. 
>>>>>>>>> dx. 
>>>>>>>>> cf. 
>>>>>>>>> direct.ClassPathOpener.processArchive(ClassPathOpener.java: 
>>>>>>>>> 245)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> com. 
>>>>>>>>> android. 
>>>>>>>>> dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java: 
>>>>>>>>> 130)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> com. 
>>>>>>>>> android. 
>>>>>>>>> dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java: 
>>>>>>>>> 183)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> sun. 
>>>>>>>>> reflect. 
>>>>>>>>> NativeMethodAccessorImpl. 
>>>>>>>>> invoke(NativeMethodAccessorImpl.java:39)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> sun. 
>>>>>>>>> reflect. 
>>>>>>>>> DelegatingMethodAccessorImpl. 
>>>>>>>>> invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> java.lang.reflect.Method.invoke(Method.java:585)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown  
>>>>>>>>> Source)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown
>>>>>>>>> Source)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown  
>>>>>>>>> Source)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>>>>>> $2.run(BuildManager.java:633)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org. 
>>>>>>>>> eclipse. 
>>>>>>>>> core. 
>>>>>>>>> internal.events.BuildManager.basicBuild(BuildManager.java:170)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org. 
>>>>>>>>> eclipse. 
>>>>>>>>> core. 
>>>>>>>>> internal.events.BuildManager.basicBuild(BuildManager.java:201)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>>>>>> $1.run(BuildManager.java:253)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org. 
>>>>>>>>> eclipse. 
>>>>>>>>> core. 
>>>>>>>>> internal.events.BuildManager.basicBuild(BuildManager.java:256)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org. 
>>>>>>>>> eclipse. 
>>>>>>>>> core. 
>>>>>>>>> internal. 
>>>>>>>>> events.BuildManager.basicBuildLoop(BuildManager.java:309)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org. 
>>>>>>>>> eclipse. 
>>>>>>>>> core.internal.events.BuildManager.build(BuildManager.java:341)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org. 
>>>>>>>>> eclipse. 
>>>>>>>>> core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java: 
>>>>>>>>> 140)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org. 
>>>>>>>>> eclipse. 
>>>>>>>>> core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik
>>>>>>>>> format
>>>>>>>>> failed
>>>>>>>>> with error 1
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> regards
>>>>>>>>> Matthias

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Matthias Neubert <su...@onlinehome.de>.
Hello,

the problem with dalvik cache was mainly fixed by a patch of Clement,  
who also wrote the ipojo+android
tutorial. This patch is not included in Felix 1.8.0 or 1.8.1 as far as  
I know.
Then Karl Pauls und Richard Hall read about my problem, and fixed it  
quickly some days ago.
Both of these fixes are available in current Felix 1.9.0 snapshot

For the framework storage I choose the local private directory of my  
Hosting Android-Application.
For that I set the absolute path in config properties of Felix to  
path:  /data/data/<package.name.of.the.app>/files/
In files/ directory I create a subsolder for felix, where cache,  
bundles and fileinstall-watched dir is located.

My Code (mainly Clements code, but with changes done to make it run on  
current software) will be available on
  http://code.google.com/p/felixembeddedonandroid/  soon.

Deploying the Bundles to the watched directory is temporaly done using  
DDMS in Eclipse ("load file on phone")
So its manually too. I guess the easiest way is to to download the  
bundles from somewhere in the internet an strore them into this  
watched folder.

ciao Matthias


Am 09.07.2009 um 15:14 schrieb Stephan Heuser:

> Hi Matthias,
>
> did you run into any additional problems running Felix 1.8.(0/1) on
> Android? I applied the patches mentioned in FELIX-1156 , however i
> still have chmod my dalvik cache folder to be writeable for all users.
> FRAMEWORK_STORAGE ist set to a newly created temp folder, i am
> following the iPOJO tutorial too.
>
> And was there a special reason to switch to a 1.9.0 snapshot? I am
> asking because i might be using iPOJO later, i don't know exactly yet.
>
> Another thing, how do you deploy your bundles which will be used by
> file installer? currently i am pushing the bundles manually to the sd
> card.
>
> Cheers,
> Stephan
>
> On Thu, Jul 9, 2009 at 11:57 AM, Matthias  
> Neubert<su...@onlinehome.de> wrote:
>> Hello,
>>
>> it finally worked!!
>>
>> Loading Fileinstall via an activator from resources dir of Android  
>> project
>> and starting it doesn't interfer
>> with the other bundles (which are started the same way)
>>
>> Meanwhile I learned, that the folder watched by fileinstall shall  
>> NOT be the
>> same folder fileinstall and the other on startup loaded
>> bundles are installed to. I now have to seperate folders for this.
>>
>> The best thing is: After some changes I now got the tutorial on
>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html  
>> run in the
>> the following configuration:
>>
>> Felix 1.9.0 (current snapshot 08.July.2009)
>> FileInstall 1.3.0 snap
>> iPojo snap
>> iPojo.arch snap
>> Android SDK 1.5r2
>> Eclipse 3.4
>> MacOS X 10.5.7
>> JVM 1.5 (set to 1.6 compatibility mode in eclipse)
>>
>> WITHOUT "chmod 777 /data/dalvik-cache"
>>
>> this  hopefully makes this sample work on a real 1.5 android  
>> device. Next
>> weeks I hope to be able to borrow an G1 Phone
>> from my university to test this on an real device. I will later  
>> report on
>> that if someone is interested.
>>
>> Thank you all who helped me working this out. You realy helped me  
>> getting
>> further with my diploma thesis!
>>
>> For those who are interested I commit my code on an google code  
>> project
>> website. It will take some time to add some clean code
>> comments in english language. If someone here is interested, I post  
>> the link
>> here.
>>
>>
>> regards
>> Matthias
>>
>>
>> Am 08.07.2009 um 16:53 schrieb Matthias Neubert:
>>
>>> Hello,
>>>
>>> OK, I'try it.
>>>
>>> Current state: newly build felix and fileinstall (with "patch"  
>>> without
>>> osgi log package)
>>> works. I get no more errors and can start the app.
>>>
>>> BUT ;-)
>>>
>>> this causes the other bundles (like ipojo, ipojo.arch, shell,  
>>> shelltui)
>>> which load via an InstallerActivator from resources area of the  
>>> android
>>> project)
>>> not to start correctly.
>>>
>>> I'll try loading and  starting fileinstall with the same method  
>>> lie the
>>> other bundles and then I'll see if the problems remain.
>>>
>>>
>>> regards
>>> matthias
>>>
>>>
>>>
>>>
>>> Am 08.07.2009 um 16:43 schrieb Karl Pauls:
>>>
>>>> On Wed, Jul 8, 2009 at 3:29 PM, Matthias Neubert<sureal@onlinehome.de 
>>>> >
>>>> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>>> Workaround: just set the property as a string for the key and  
>>>>>> install
>>>>>> the fileinstall bundle into felix. That should make it work.
>>>>>
>>>>> thats right, but it doesn't help with the activator-part in the  
>>>>> HostApp
>>>>
>>>> You don't need to do the activator part if you just install the
>>>> fileinstall.jar as a bundle.
>>>>
>>>> regards,
>>>>
>>>> Karl
>>>>
>>>>>> I'm not sure (would have to look at it first) but it is pretty  
>>>>>> common
>>>>>> in OSGi land to have bundles that have some shared packages  
>>>>>> embedded
>>>>>> to make them working standalone and when they can get the  
>>>>>> package from
>>>>>> another provider.
>>>>>
>>>>> I currently checked the FileInstall Sources. There is no
>>>>> "org.osgi.service.log" implemented,
>>>>> but DirectoryWatcher imports and uses it: import  
>>>>> org.osgi.service.log.*;
>>>>> The mentioned LogEntry is not used there!
>>>>>
>>>>> Then I checked the pom.xml and pom-transformed.xml file of  
>>>>> fileinstall
>>>>> (todays snapshot) There I found it:
>>>>>
>>>>> <build>
>>>>>  <plugins>
>>>>>    <plugin>
>>>>>      <groupId>org.apache.felix</groupId>
>>>>>      <artifactId>maven-bundle-plugin</artifactId>
>>>>>      <version>1.4.0</version>
>>>>>      <extensions>true</extensions>
>>>>>      <configuration>
>>>>>        <instructions>
>>>>>
>>>>> <Export- 
>>>>> Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,
>>>>> org.osgi.service.log</Export-Package>            <-- HERE
>>>>>
>>>>>
>>>>> <Bundle-Activator>org.apache.felix.fileinstall.FileInstall</ 
>>>>> Bundle-Activator>
>>>>>          <Bundle-SymbolicName>${pom.artifactId}</Bundle- 
>>>>> SymbolicName>
>>>>>          <Bundle-Vendor>The Apache Software Foundation</Bundle- 
>>>>> Vendor>
>>>>>        </instructions>
>>>>>      </configuration>
>>>>>    </plugin>
>>>>> ...
>>>>>
>>>>>
>>>>>
>>>>> may be "org.osgi.service.cm" would be the next issue.
>>>>>
>>>>> If I understand it right, that maven integrated the
>>>>> "org.osgi.service.log"
>>>>> classes (and may be cm) into fileinstall.jar on build.
>>>>> The same is done while building feilx 1.9.0.
>>>>>
>>>>> The dex tool, or the APK Builder (makes app file bundles which are
>>>>> installed
>>>>> to the phone/emulator) has a problem, when 2 jars
>>>>> have the same package integrated, right?
>>>>>
>>>>> -> I gues the problem is not the eclipse plugin it self, its the  
>>>>> dx or
>>>>> apkbuilder tool delivered with android sdk which do the trouble
>>>>>
>>>>> I'll try to build fileinstall without this 2 packages in  
>>>>> pom.xml , to
>>>>> see if
>>>>> this "patched" fileinstall make trouble too.
>>>>>
>>>>> Regarding fileinstall there is no difference for me in pom.xml  
>>>>> between
>>>>> 1.20
>>>>> and 130snapshot
>>>>>
>>>>>
>>>>> I keep on searching. May be we'll find a good solution.  
>>>>> (unfortunatly I
>>>>> cannot wait for Google fixing this. I also believe they dont  
>>>>> want to fix
>>>>> this)
>>>>>
>>>>>
>>>>>
>>>>> regards
>>>>> matthias
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 08.07.2009 um 14:22 schrieb Karl Pauls:
>>>>>
>>>>>> On Wed, Jul 8, 2009 at 2:12 PM, Matthias Neubert<sureal@onlinehome.de 
>>>>>> >
>>>>>> wrote:
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I add Fileinstall, because my Android HostApplication with its
>>>>>>> embedded
>>>>>>> Felix shall
>>>>>>> watch a directory on the Android Phone where new Bundles are  
>>>>>>> stored
>>>>>>> to.
>>>>>>> I'm following mostly the iPojo+Android Sample on:
>>>>>>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html 
>>>>>>>  .
>>>>>>>
>>>>>>> For that I add Fileinstall Dir to Felix' config like this:
>>>>>>>
>>>>>>> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/ 
>>>>>>> bundle");
>>>>>>> //"felix.fileinstall.dir"
>>>>>>> configProps.put(DirectoryWatcher.DEBUG, "1");
>>>>>>> //"felix.fileinstall.debug"
>>>>>>
>>>>>> Workaround: just set the property as a string for the key and  
>>>>>> install
>>>>>> the fileinstall bundle into felix. That should make it work.
>>>>>>
>>>>>>> In the HostApplication it self I use FileInstall the following  
>>>>>>> way:
>>>>>>>
>>>>>>> Adding FileInstall to AutoStart with System Bundle:
>>>>>>>
>>>>>>> List<BundleActivator> activatorList = new
>>>>>>> ArrayList<BundleActivator>();
>>>>>>> activatorList.add(m_hostActivator);
>>>>>>>
>>>>>>> activatorList.add(new FileInstall());
>>>>>>>
>>>>>>> // add list of activators which shall be started with system  
>>>>>>> bundle to
>>>>>>> config
>>>>>>> m_felixProperties 
>>>>>>> .put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>>>>>>> activatorList);
>>>>>>>
>>>>>>>
>>>>>>> Equipped with fileinstall I guess the ServiceTracker (see
>>>>>>> iPojo+Android
>>>>>>> Sample) notices when a bundle
>>>>>>> copied to the watched directory is installed and started (by
>>>>>>> fileinstall)
>>>>>>>
>>>>>>> If there is an other way, please tell me! (generally I have some
>>>>>>> problems
>>>>>>> understanding that loose coupling thing in Felix and iPojo. I  
>>>>>>> have to
>>>>>>> read
>>>>>>> more regarding this issue.)
>>>>>>>
>>>>>>> The thing I wonder about is why this problem occurs in 1.9.0  
>>>>>>> but not
>>>>>>> in
>>>>>>> 1.8.0. Why I an class defined in fileinstall (with identical  
>>>>>>> name an
>>>>>>> package) also defined in felix 1.9.0?
>>>>>>
>>>>>> I'm not sure (would have to look at it first) but it is pretty  
>>>>>> common
>>>>>> in OSGi land to have bundles that have some shared packages  
>>>>>> embedded
>>>>>> to make them working standalone and when they can get the  
>>>>>> package from
>>>>>> another provider.
>>>>>>
>>>>>>> As far as I know the dexer stops at the first problem. So it  
>>>>>>> may be
>>>>>>> that
>>>>>>>
>>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>>>
>>>>>>> is not the only problem. It also may happen at other Jars than
>>>>>>> fileinstall.jar
>>>>>>>
>>>>>>> I don't know about visibility filters in eclipse. I will try  
>>>>>>> to find
>>>>>>> out.
>>>>>>> But I think it's not a real solution to do it that way.
>>>>>>
>>>>>> Sounds like a bug/problem with android or their eclipse  
>>>>>> integration to
>>>>>> me.
>>>>>>
>>>>>> regards,
>>>>>>
>>>>>> Karl
>>>>>>
>>>>>>>
>>>>>>> regards
>>>>>>> Matthias
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>>>>>>>
>>>>>>>> Well, why would you want to add fileinstall in the first  
>>>>>>>> place? You
>>>>>>>> could just dex it and then install as a bundle no?
>>>>>>>>
>>>>>>>> Regarding the issue, it looks like the dex compiler can't  
>>>>>>>> handle
>>>>>>>> multiple definitions of the same class in one compile. Thats  
>>>>>>>> not nice
>>>>>>>> but not the end of the world either I guess. If you have to  
>>>>>>>> have both
>>>>>>>> felix and fileinstall on the classpath then maybe try to set- 
>>>>>>>> up a
>>>>>>>> visibility filter for one of them that filters out the  
>>>>>>>> package in
>>>>>>>> question.
>>>>>>>>
>>>>>>>> regards,
>>>>>>>>
>>>>>>>> Karl
>>>>>>>>
>>>>>>>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias
>>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> I've tried your patch and it worked! Thank you!
>>>>>>>>>
>>>>>>>>> BUT:
>>>>>>>>>
>>>>>>>>> There is another Problem which only occur in all 1.9.0  
>>>>>>>>> snapshots (4.
>>>>>>>>> ,
>>>>>>>>> 7.,
>>>>>>>>> 8. july), but NOT with 1.8.0 :
>>>>>>>>>
>>>>>>>>> If I add in my Android Project in Eclipse the  
>>>>>>>>> fileinstall.jar (1.2.0
>>>>>>>>> or
>>>>>>>>> current snapshot) to classpath while
>>>>>>>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get  
>>>>>>>>> folling
>>>>>>>>> Error
>>>>>>>>> when Eclipse tries to build the project (right after adding)
>>>>>>>>>
>>>>>>>>> -> this does not happen with Felix 1.8.0
>>>>>>>>>
>>>>>>>>> -> I can add fileinstall.jar without problems if no  
>>>>>>>>> felix.jar is
>>>>>>>>> added
>>>>>>>>>
>>>>>>>>> -> if adding fileinstall.jar first, then adding felix.jar,  
>>>>>>>>> the same
>>>>>>>>> problem
>>>>>>>>> occurs
>>>>>>>>>
>>>>>>>>> -> problem also occurs in a completly fresh android project
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>>>>>>>> java.lang.IllegalArgumentException: already added:
>>>>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>> com 
>>>>>>>>> .android 
>>>>>>>>> .dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java: 
>>>>>>>>> 276)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main 
>>>>>>>>> $1.processFileBytes(Main.java:228)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> com 
>>>>>>>>> .android 
>>>>>>>>> .dx 
>>>>>>>>> .cf 
>>>>>>>>> .direct.ClassPathOpener.processArchive(ClassPathOpener.java: 
>>>>>>>>> 245)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> com 
>>>>>>>>> .android 
>>>>>>>>> .dx 
>>>>>>>>> .cf.direct.ClassPathOpener.processOne(ClassPathOpener.java: 
>>>>>>>>> 130)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> com 
>>>>>>>>> .android 
>>>>>>>>> .dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java: 
>>>>>>>>> 108)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java: 
>>>>>>>>> 183)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> sun 
>>>>>>>>> .reflect 
>>>>>>>>> .NativeMethodAccessorImpl 
>>>>>>>>> .invoke(NativeMethodAccessorImpl.java:39)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> sun 
>>>>>>>>> .reflect 
>>>>>>>>> .DelegatingMethodAccessorImpl 
>>>>>>>>> .invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> java.lang.reflect.Method.invoke(Method.java:585)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown  
>>>>>>>>> Source)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown
>>>>>>>>> Source)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown  
>>>>>>>>> Source)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>>>>>> $2.run(BuildManager.java:633)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org 
>>>>>>>>> .eclipse 
>>>>>>>>> .core 
>>>>>>>>> .internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>>>>>>> 170)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org 
>>>>>>>>> .eclipse 
>>>>>>>>> .core 
>>>>>>>>> .internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>>>>>>> 201)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>>>>>> $1.run(BuildManager.java:253)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org 
>>>>>>>>> .eclipse 
>>>>>>>>> .core 
>>>>>>>>> .internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>>>>>>> 256)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org 
>>>>>>>>> .eclipse 
>>>>>>>>> .core 
>>>>>>>>> .internal 
>>>>>>>>> .events.BuildManager.basicBuildLoop(BuildManager.java:309)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org 
>>>>>>>>> .eclipse 
>>>>>>>>> .core.internal.events.BuildManager.build(BuildManager.java: 
>>>>>>>>> 341)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org 
>>>>>>>>> .eclipse 
>>>>>>>>> .core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java: 
>>>>>>>>> 140)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org 
>>>>>>>>> .eclipse 
>>>>>>>>> .core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik
>>>>>>>>> format
>>>>>>>>> failed
>>>>>>>>> with error 1
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> regards
>>>>>>>>> Matthias
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>>>>>>>>>
>>>>>>>>>> Ok, I have committed a potential workaround as described  
>>>>>>>>>> here:
>>>>>>>>>>
>>>>>>>>>> https://issues.apache.org/jira/browse/FELIX-1193
>>>>>>>>>>
>>>>>>>>>> If you could test again on trunk and respond on the issue  
>>>>>>>>>> that
>>>>>>>>>> would
>>>>>>>>>> be
>>>>>>>>>> great. Thanks!
>>>>>>>>>>
>>>>>>>>>> -> richard
>>>>>>>>>>
>>>>>>>>>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>>>>>>>>>
>>>>>>>>>>> Looks like a bug in android. Or at least it is something  
>>>>>>>>>>> where sun
>>>>>>>>>>> java behaves differently then dalvik/android. Anyways, we  
>>>>>>>>>>> should
>>>>>>>>>>> be
>>>>>>>>>>> able to workaround this. We will track this using  
>>>>>>>>>>> FELIX-1193.
>>>>>>>>>>> Thanks
>>>>>>>>>>> for letting us know!
>>>>>>>>>>>
>>>>>>>>>>> regards,
>>>>>>>>>>>
>>>>>>>>>>> Karl
>>>>>>>>>>>
>>>>>>>>>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias
>>>>>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hello,
>>>>>>>>>>>>
>>>>>>>>>>>> since nobody answered on my first mail (subject "Android  
>>>>>>>>>>>> + Felix
>>>>>>>>>>>> 1.80
>>>>>>>>>>>> =
>>>>>>>>>>>> Problems")
>>>>>>>>>>>> I took the long way and found the solution on my own. It  
>>>>>>>>>>>> took a
>>>>>>>>>>>> bit
>>>>>>>>>>>> longer
>>>>>>>>>>>> because I'm completely new to OSGi and felix.
>>>>>>>>>>>>
>>>>>>>>>>>> First the solution on that one thing, then the current bug:
>>>>>>>>>>>>
>>>>>>>>>>>> Solution:
>>>>>>>>>>>> Felix 1.8.0 release doesn't have the patch for Android  
>>>>>>>>>>>> compatible
>>>>>>>>>>>> Classloading ( before I thought it has it already), so in  
>>>>>>>>>>>> adb
>>>>>>>>>>>> shell
>>>>>>>>>>>> the
>>>>>>>>>>>> command "chmod 777 /data/dalvik-cache" has to be executed  
>>>>>>>>>>>> (which
>>>>>>>>>>>> shows
>>>>>>>>>>>> us,
>>>>>>>>>>>> that this will not work on a real phone)
>>>>>>>>>>>>
>>>>>>>>>>>> ->  with Felix 1.8.0 and the little "hack" it now runs  
>>>>>>>>>>>> and its
>>>>>>>>>>>> starting
>>>>>>>>>>>> Bundles. This is the first step getting the outdated  
>>>>>>>>>>>> ipojo sample
>>>>>>>>>>>> running.
>>>>>>>>>>>> May be some more work is left.
>>>>>>>>>>>> ->  without the hack, systembundle and ipojo.annotations  
>>>>>>>>>>>> get
>>>>>>>>>>>> active,
>>>>>>>>>>>> but
>>>>>>>>>>>> for
>>>>>>>>>>>> example shell, shelltui and iPojo remain resolved and  
>>>>>>>>>>>> doesn't
>>>>>>>>>>>> start.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Problem/Bug:
>>>>>>>>>>>> occures when I try run Felix 1.9.0 Snapshot as embedded  
>>>>>>>>>>>> in an
>>>>>>>>>>>> Android
>>>>>>>>>>>> Application.(same project as mentioned above, just switched
>>>>>>>>>>>> classpath
>>>>>>>>>>>> to
>>>>>>>>>>>> newer jar file)
>>>>>>>>>>>> The access-rights-hack doesn't help here, so it must be a  
>>>>>>>>>>>> bug or
>>>>>>>>>>>> something
>>>>>>>>>>>> like that.
>>>>>>>>>>>>
>>>>>>>>>>>> If someone is interested in this bug, I can send my eclipse
>>>>>>>>>>>> project,
>>>>>>>>>>>> if
>>>>>>>>>>>> needed
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>>>>>>>>>
>>>>>>>>>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>>>>>>>>>> Ljava/lang/RuntimeException; thrown during
>>>>>>>>>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>>>>>>>>>
>>>>>>>>>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch  
>>>>>>>>>>>> timeout has
>>>>>>>>>>>> expired,
>>>>>>>>>>>> giving up wake lock!
>>>>>>>>>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity  
>>>>>>>>>>>> idle
>>>>>>>>>>>> timeout
>>>>>>>>>>>> for
>>>>>>>>>>>> HistoryRecord{435f61b0
>>>>>>>>>>>> {de.mn.felixembedand/ 
>>>>>>>>>>>> de.mn.felixembedand.FelixEmbedAndStarter}}
>>>>>>>>>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting  
>>>>>>>>>>>> down VM
>>>>>>>>>>>>
>>>>>>>>>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread
>>>>>>>>>>>> exiting
>>>>>>>>>>>> with
>>>>>>>>>>>> uncaught exception (group=0x4000fe70)
>>>>>>>>>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught  
>>>>>>>>>>>> handler:
>>>>>>>>>>>> thread
>>>>>>>>>>>> main exiting due to uncaught exception
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>>>>>>>>>> java.lang.ExceptionInInitializerError
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> org 
>>>>>>>>>>>> .apache 
>>>>>>>>>>>> .felix 
>>>>>>>>>>>> .framework.ExtensionManager.<init>(ExtensionManager.java: 
>>>>>>>>>>>> 142)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> de 
>>>>>>>>>>>> .mn 
>>>>>>>>>>>> .felixembedand 
>>>>>>>>>>>> .FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java: 
>>>>>>>>>>>> 77)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> android 
>>>>>>>>>>>> .app 
>>>>>>>>>>>> .Instrumentation 
>>>>>>>>>>>> .callActivityOnCreate(Instrumentation.java:1123)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> android 
>>>>>>>>>>>> .app 
>>>>>>>>>>>> .ActivityThread.performLaunchActivity(ActivityThread.java: 
>>>>>>>>>>>> 2231)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> android 
>>>>>>>>>>>> .app 
>>>>>>>>>>>> .ActivityThread.handleLaunchActivity(ActivityThread.java: 
>>>>>>>>>>>> 2284)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> android.app.ActivityThread.access 
>>>>>>>>>>>> $1800(ActivityThread.java:112)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>> android.app.ActivityThread 
>>>>>>>>>>>> $H.handleMessage(ActivityThread.java:1692)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> android.os.Looper.loop(Looper.java:123)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> com.android.internal.os.ZygoteInit 
>>>>>>>>>>>> $MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 
>>>>>>>>>>>> 540)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> dalvik.system.NativeStart.main(Native Method)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>>>>> java.lang.RuntimeException: Problem creating boot  
>>>>>>>>>>>> delegation
>>>>>>>>>>>> class
>>>>>>>>>>>> loader.
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>> org 
>>>>>>>>>>>> .apache 
>>>>>>>>>>>> .felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:114)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ...  
>>>>>>>>>>>> 16 more
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> java 
>>>>>>>>>>>> .security.SecureClassLoader.<init>(SecureClassLoader.java: 
>>>>>>>>>>>> 76)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> java.lang.reflect.Constructor.constructNative(Native  
>>>>>>>>>>>> Method)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> java 
>>>>>>>>>>>> .lang.reflect.Constructor.newInstance(Constructor.java:446)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> org 
>>>>>>>>>>>> .apache 
>>>>>>>>>>>> .felix 
>>>>>>>>>>>> .framework.util.SecureAction.invoke(SecureAction.java:862)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>>
>>>>>>>>>>>> org 
>>>>>>>>>>>> .apache 
>>>>>>>>>>>> .felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:109)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ...  
>>>>>>>>>>>> 16 more
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>>>>> java.lang.NullPointerException: Parent ClassLoader may  
>>>>>>>>>>>> not be
>>>>>>>>>>>> null
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ...  
>>>>>>>>>>>> 21 more
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> My Config:
>>>>>>>>>>>> Eclipse 3.4
>>>>>>>>>>>> Android SDK 1.5r2
>>>>>>>>>>>> ADT 0.91 (current)
>>>>>>>>>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> regards
>>>>>>>>>>>> matthias
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Karl Pauls
>>>>>>>> karlpauls@gmail.com
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Karl Pauls
>>>>>> karlpauls@gmail.com
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Karl Pauls
>>>> karlpauls@gmail.com
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Stephan Heuser <st...@gmail.com>.
Hi Matthias,

did you run into any additional problems running Felix 1.8.(0/1) on
Android? I applied the patches mentioned in FELIX-1156 , however i
still have chmod my dalvik cache folder to be writeable for all users.
FRAMEWORK_STORAGE ist set to a newly created temp folder, i am
following the iPOJO tutorial too.

And was there a special reason to switch to a 1.9.0 snapshot? I am
asking because i might be using iPOJO later, i don't know exactly yet.

Another thing, how do you deploy your bundles which will be used by
file installer? currently i am pushing the bundles manually to the sd
card.

Cheers,
Stephan

On Thu, Jul 9, 2009 at 11:57 AM, Matthias Neubert<su...@onlinehome.de> wrote:
> Hello,
>
> it finally worked!!
>
> Loading Fileinstall via an activator from resources dir of Android project
> and starting it doesn't interfer
> with the other bundles (which are started the same way)
>
> Meanwhile I learned, that the folder watched by fileinstall shall NOT be the
> same folder fileinstall and the other on startup loaded
> bundles are installed to. I now have to seperate folders for this.
>
> The best thing is: After some changes I now got the tutorial on
> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html run in the
> the following configuration:
>
> Felix 1.9.0 (current snapshot 08.July.2009)
> FileInstall 1.3.0 snap
> iPojo snap
> iPojo.arch snap
> Android SDK 1.5r2
> Eclipse 3.4
> MacOS X 10.5.7
> JVM 1.5 (set to 1.6 compatibility mode in eclipse)
>
> WITHOUT "chmod 777 /data/dalvik-cache"
>
> this  hopefully makes this sample work on a real 1.5 android device. Next
> weeks I hope to be able to borrow an G1 Phone
> from my university to test this on an real device. I will later report on
> that if someone is interested.
>
> Thank you all who helped me working this out. You realy helped me getting
> further with my diploma thesis!
>
> For those who are interested I commit my code on an google code project
> website. It will take some time to add some clean code
> comments in english language. If someone here is interested, I post the link
> here.
>
>
> regards
> Matthias
>
>
> Am 08.07.2009 um 16:53 schrieb Matthias Neubert:
>
>> Hello,
>>
>> OK, I'try it.
>>
>> Current state: newly build felix and fileinstall (with "patch" without
>> osgi log package)
>> works. I get no more errors and can start the app.
>>
>> BUT ;-)
>>
>> this causes the other bundles (like ipojo, ipojo.arch, shell, shelltui)
>> which load via an InstallerActivator from resources area of the android
>> project)
>> not to start correctly.
>>
>> I'll try loading and  starting fileinstall with the same method lie the
>> other bundles and then I'll see if the problems remain.
>>
>>
>> regards
>> matthias
>>
>>
>>
>>
>> Am 08.07.2009 um 16:43 schrieb Karl Pauls:
>>
>>> On Wed, Jul 8, 2009 at 3:29 PM, Matthias Neubert<su...@onlinehome.de>
>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>>> Workaround: just set the property as a string for the key and install
>>>>> the fileinstall bundle into felix. That should make it work.
>>>>
>>>> thats right, but it doesn't help with the activator-part in the HostApp
>>>
>>> You don't need to do the activator part if you just install the
>>> fileinstall.jar as a bundle.
>>>
>>> regards,
>>>
>>> Karl
>>>
>>>>> I'm not sure (would have to look at it first) but it is pretty common
>>>>> in OSGi land to have bundles that have some shared packages embedded
>>>>> to make them working standalone and when they can get the package from
>>>>> another provider.
>>>>
>>>> I currently checked the FileInstall Sources. There is no
>>>> "org.osgi.service.log" implemented,
>>>> but DirectoryWatcher imports and uses it: import org.osgi.service.log.*;
>>>> The mentioned LogEntry is not used there!
>>>>
>>>> Then I checked the pom.xml and pom-transformed.xml file of fileinstall
>>>> (todays snapshot) There I found it:
>>>>
>>>> <build>
>>>>  <plugins>
>>>>    <plugin>
>>>>      <groupId>org.apache.felix</groupId>
>>>>      <artifactId>maven-bundle-plugin</artifactId>
>>>>      <version>1.4.0</version>
>>>>      <extensions>true</extensions>
>>>>      <configuration>
>>>>        <instructions>
>>>>
>>>> <Export-Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,
>>>> org.osgi.service.log</Export-Package>            <-- HERE
>>>>
>>>>
>>>> <Bundle-Activator>org.apache.felix.fileinstall.FileInstall</Bundle-Activator>
>>>>          <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
>>>>          <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
>>>>        </instructions>
>>>>      </configuration>
>>>>    </plugin>
>>>> ...
>>>>
>>>>
>>>>
>>>> may be "org.osgi.service.cm" would be the next issue.
>>>>
>>>> If I understand it right, that maven integrated the
>>>> "org.osgi.service.log"
>>>> classes (and may be cm) into fileinstall.jar on build.
>>>> The same is done while building feilx 1.9.0.
>>>>
>>>> The dex tool, or the APK Builder (makes app file bundles which are
>>>> installed
>>>> to the phone/emulator) has a problem, when 2 jars
>>>> have the same package integrated, right?
>>>>
>>>> -> I gues the problem is not the eclipse plugin it self, its the dx or
>>>> apkbuilder tool delivered with android sdk which do the trouble
>>>>
>>>> I'll try to build fileinstall without this 2 packages in pom.xml , to
>>>> see if
>>>> this "patched" fileinstall make trouble too.
>>>>
>>>> Regarding fileinstall there is no difference for me in pom.xml between
>>>> 1.20
>>>> and 130snapshot
>>>>
>>>>
>>>> I keep on searching. May be we'll find a good solution. (unfortunatly I
>>>> cannot wait for Google fixing this. I also believe they dont want to fix
>>>> this)
>>>>
>>>>
>>>>
>>>> regards
>>>> matthias
>>>>
>>>>
>>>>
>>>>
>>>> Am 08.07.2009 um 14:22 schrieb Karl Pauls:
>>>>
>>>>> On Wed, Jul 8, 2009 at 2:12 PM, Matthias Neubert<su...@onlinehome.de>
>>>>> wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I add Fileinstall, because my Android HostApplication with its
>>>>>> embedded
>>>>>> Felix shall
>>>>>> watch a directory on the Android Phone where new Bundles are stored
>>>>>> to.
>>>>>> I'm following mostly the iPojo+Android Sample on:
>>>>>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html .
>>>>>>
>>>>>> For that I add Fileinstall Dir to Felix' config like this:
>>>>>>
>>>>>> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/bundle");
>>>>>> //"felix.fileinstall.dir"
>>>>>> configProps.put(DirectoryWatcher.DEBUG, "1");
>>>>>> //"felix.fileinstall.debug"
>>>>>
>>>>> Workaround: just set the property as a string for the key and install
>>>>> the fileinstall bundle into felix. That should make it work.
>>>>>
>>>>>> In the HostApplication it self I use FileInstall the following way:
>>>>>>
>>>>>> Adding FileInstall to AutoStart with System Bundle:
>>>>>>
>>>>>> List<BundleActivator> activatorList = new
>>>>>> ArrayList<BundleActivator>();
>>>>>> activatorList.add(m_hostActivator);
>>>>>>
>>>>>> activatorList.add(new FileInstall());
>>>>>>
>>>>>> // add list of activators which shall be started with system bundle to
>>>>>> config
>>>>>> m_felixProperties.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>>>>>> activatorList);
>>>>>>
>>>>>>
>>>>>> Equipped with fileinstall I guess the ServiceTracker (see
>>>>>> iPojo+Android
>>>>>> Sample) notices when a bundle
>>>>>> copied to the watched directory is installed and started (by
>>>>>> fileinstall)
>>>>>>
>>>>>> If there is an other way, please tell me! (generally I have some
>>>>>> problems
>>>>>> understanding that loose coupling thing in Felix and iPojo. I have to
>>>>>> read
>>>>>> more regarding this issue.)
>>>>>>
>>>>>> The thing I wonder about is why this problem occurs in 1.9.0 but not
>>>>>> in
>>>>>> 1.8.0. Why I an class defined in fileinstall (with identical name an
>>>>>> package) also defined in felix 1.9.0?
>>>>>
>>>>> I'm not sure (would have to look at it first) but it is pretty common
>>>>> in OSGi land to have bundles that have some shared packages embedded
>>>>> to make them working standalone and when they can get the package from
>>>>> another provider.
>>>>>
>>>>>> As far as I know the dexer stops at the first problem. So it may be
>>>>>> that
>>>>>>
>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>>
>>>>>> is not the only problem. It also may happen at other Jars than
>>>>>> fileinstall.jar
>>>>>>
>>>>>> I don't know about visibility filters in eclipse. I will try to find
>>>>>> out.
>>>>>> But I think it's not a real solution to do it that way.
>>>>>
>>>>> Sounds like a bug/problem with android or their eclipse integration to
>>>>> me.
>>>>>
>>>>> regards,
>>>>>
>>>>> Karl
>>>>>
>>>>>>
>>>>>> regards
>>>>>> Matthias
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>>>>>>
>>>>>>> Well, why would you want to add fileinstall in the first place? You
>>>>>>> could just dex it and then install as a bundle no?
>>>>>>>
>>>>>>> Regarding the issue, it looks like the dex compiler can't handle
>>>>>>> multiple definitions of the same class in one compile. Thats not nice
>>>>>>> but not the end of the world either I guess. If you have to have both
>>>>>>> felix and fileinstall on the classpath then maybe try to set-up a
>>>>>>> visibility filter for one of them that filters out the package in
>>>>>>> question.
>>>>>>>
>>>>>>> regards,
>>>>>>>
>>>>>>> Karl
>>>>>>>
>>>>>>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias
>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I've tried your patch and it worked! Thank you!
>>>>>>>>
>>>>>>>> BUT:
>>>>>>>>
>>>>>>>> There is another Problem which only occur in all 1.9.0 snapshots (4.
>>>>>>>> ,
>>>>>>>> 7.,
>>>>>>>> 8. july), but NOT with 1.8.0 :
>>>>>>>>
>>>>>>>> If I add in my Android Project in Eclipse the fileinstall.jar (1.2.0
>>>>>>>> or
>>>>>>>> current snapshot) to classpath while
>>>>>>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get folling
>>>>>>>> Error
>>>>>>>> when Eclipse tries to build the project (right after adding)
>>>>>>>>
>>>>>>>> -> this does not happen with Felix 1.8.0
>>>>>>>>
>>>>>>>> -> I can add fileinstall.jar without problems if no felix.jar is
>>>>>>>> added
>>>>>>>>
>>>>>>>> -> if adding fileinstall.jar first, then adding felix.jar, the same
>>>>>>>> problem
>>>>>>>> occurs
>>>>>>>>
>>>>>>>> -> problem also occurs in a completly fresh android project
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>>>>>>> java.lang.IllegalArgumentException: already added:
>>>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>> com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> java.lang.reflect.Method.invoke(Method.java:585)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown
>>>>>>>> Source)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik
>>>>>>>> format
>>>>>>>> failed
>>>>>>>> with error 1
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> regards
>>>>>>>> Matthias
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>>>>>>>>
>>>>>>>>> Ok, I have committed a potential workaround as described here:
>>>>>>>>>
>>>>>>>>> https://issues.apache.org/jira/browse/FELIX-1193
>>>>>>>>>
>>>>>>>>> If you could test again on trunk and respond on the issue that
>>>>>>>>> would
>>>>>>>>> be
>>>>>>>>> great. Thanks!
>>>>>>>>>
>>>>>>>>> -> richard
>>>>>>>>>
>>>>>>>>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>>>>>>>>
>>>>>>>>>> Looks like a bug in android. Or at least it is something where sun
>>>>>>>>>> java behaves differently then dalvik/android. Anyways, we should
>>>>>>>>>> be
>>>>>>>>>> able to workaround this. We will track this using FELIX-1193.
>>>>>>>>>> Thanks
>>>>>>>>>> for letting us know!
>>>>>>>>>>
>>>>>>>>>> regards,
>>>>>>>>>>
>>>>>>>>>> Karl
>>>>>>>>>>
>>>>>>>>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias
>>>>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hello,
>>>>>>>>>>>
>>>>>>>>>>> since nobody answered on my first mail (subject "Android + Felix
>>>>>>>>>>> 1.80
>>>>>>>>>>> =
>>>>>>>>>>> Problems")
>>>>>>>>>>> I took the long way and found the solution on my own. It took a
>>>>>>>>>>> bit
>>>>>>>>>>> longer
>>>>>>>>>>> because I'm completely new to OSGi and felix.
>>>>>>>>>>>
>>>>>>>>>>> First the solution on that one thing, then the current bug:
>>>>>>>>>>>
>>>>>>>>>>> Solution:
>>>>>>>>>>> Felix 1.8.0 release doesn't have the patch for Android compatible
>>>>>>>>>>> Classloading ( before I thought it has it already), so in adb
>>>>>>>>>>> shell
>>>>>>>>>>> the
>>>>>>>>>>> command "chmod 777 /data/dalvik-cache" has to be executed (which
>>>>>>>>>>> shows
>>>>>>>>>>> us,
>>>>>>>>>>> that this will not work on a real phone)
>>>>>>>>>>>
>>>>>>>>>>> ->  with Felix 1.8.0 and the little "hack" it now runs and its
>>>>>>>>>>> starting
>>>>>>>>>>> Bundles. This is the first step getting the outdated ipojo sample
>>>>>>>>>>> running.
>>>>>>>>>>> May be some more work is left.
>>>>>>>>>>> ->  without the hack, systembundle and ipojo.annotations get
>>>>>>>>>>> active,
>>>>>>>>>>> but
>>>>>>>>>>> for
>>>>>>>>>>> example shell, shelltui and iPojo remain resolved and doesn't
>>>>>>>>>>> start.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Problem/Bug:
>>>>>>>>>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an
>>>>>>>>>>> Android
>>>>>>>>>>> Application.(same project as mentioned above, just switched
>>>>>>>>>>> classpath
>>>>>>>>>>> to
>>>>>>>>>>> newer jar file)
>>>>>>>>>>> The access-rights-hack doesn't help here, so it must be a bug or
>>>>>>>>>>> something
>>>>>>>>>>> like that.
>>>>>>>>>>>
>>>>>>>>>>> If someone is interested in this bug, I can send my eclipse
>>>>>>>>>>> project,
>>>>>>>>>>> if
>>>>>>>>>>> needed
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>>>>>>>>
>>>>>>>>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>>>>>>>>> Ljava/lang/RuntimeException; thrown during
>>>>>>>>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>>>>>>>>
>>>>>>>>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout has
>>>>>>>>>>> expired,
>>>>>>>>>>> giving up wake lock!
>>>>>>>>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle
>>>>>>>>>>> timeout
>>>>>>>>>>> for
>>>>>>>>>>> HistoryRecord{435f61b0
>>>>>>>>>>> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
>>>>>>>>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM
>>>>>>>>>>>
>>>>>>>>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread
>>>>>>>>>>> exiting
>>>>>>>>>>> with
>>>>>>>>>>> uncaught exception (group=0x4000fe70)
>>>>>>>>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught handler:
>>>>>>>>>>> thread
>>>>>>>>>>> main exiting due to uncaught exception
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>>>>>>>>> java.lang.ExceptionInInitializerError
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:142)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> de.mn.felixembedand.FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> android.os.Looper.loop(Looper.java:123)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> dalvik.system.NativeStart.main(Native Method)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>>>> java.lang.RuntimeException: Problem creating boot delegation
>>>>>>>>>>> class
>>>>>>>>>>> loader.
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:114)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> org.apache.felix.framework.util.SecureAction.invoke(SecureAction.java:862)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>>
>>>>>>>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:109)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>>>> java.lang.NullPointerException: Parent ClassLoader may not be
>>>>>>>>>>> null
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> My Config:
>>>>>>>>>>> Eclipse 3.4
>>>>>>>>>>> Android SDK 1.5r2
>>>>>>>>>>> ADT 0.91 (current)
>>>>>>>>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> regards
>>>>>>>>>>> matthias
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Karl Pauls
>>>>>>> karlpauls@gmail.com
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Karl Pauls
>>>>> karlpauls@gmail.com
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Karl Pauls
>>> karlpauls@gmail.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Matthias Neubert <su...@onlinehome.de>.
Hello,

it finally worked!!

Loading Fileinstall via an activator from resources dir of Android  
project and starting it doesn't interfer
with the other bundles (which are started the same way)

Meanwhile I learned, that the folder watched by fileinstall shall NOT  
be the same folder fileinstall and the other on startup loaded
bundles are installed to. I now have to seperate folders for this.

The best thing is: After some changes I now got the tutorial on http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html 
  run in the the following configuration:

Felix 1.9.0 (current snapshot 08.July.2009)
FileInstall 1.3.0 snap
iPojo snap
iPojo.arch snap
Android SDK 1.5r2
Eclipse 3.4
MacOS X 10.5.7
JVM 1.5 (set to 1.6 compatibility mode in eclipse)

WITHOUT "chmod 777 /data/dalvik-cache"

this  hopefully makes this sample work on a real 1.5 android device.  
Next weeks I hope to be able to borrow an G1 Phone
from my university to test this on an real device. I will later report  
on that if someone is interested.

Thank you all who helped me working this out. You realy helped me  
getting further with my diploma thesis!

For those who are interested I commit my code on an google code  
project website. It will take some time to add some clean code
comments in english language. If someone here is interested, I post  
the link here.


regards
Matthias


Am 08.07.2009 um 16:53 schrieb Matthias Neubert:

> Hello,
>
> OK, I'try it.
>
> Current state: newly build felix and fileinstall (with "patch"  
> without osgi log package)
> works. I get no more errors and can start the app.
>
> BUT ;-)
>
> this causes the other bundles (like ipojo, ipojo.arch, shell,  
> shelltui) which load via an InstallerActivator from resources area  
> of the android project)
> not to start correctly.
>
> I'll try loading and  starting fileinstall with the same method lie  
> the other bundles and then I'll see if the problems remain.
>
>
> regards
> matthias
>
>
>
>
> Am 08.07.2009 um 16:43 schrieb Karl Pauls:
>
>> On Wed, Jul 8, 2009 at 3:29 PM, Matthias  
>> Neubert<su...@onlinehome.de> wrote:
>>> Hello,
>>>
>>>> Workaround: just set the property as a string for the key and  
>>>> install
>>>> the fileinstall bundle into felix. That should make it work.
>>>
>>> thats right, but it doesn't help with the activator-part in the  
>>> HostApp
>>
>> You don't need to do the activator part if you just install the
>> fileinstall.jar as a bundle.
>>
>> regards,
>>
>> Karl
>>
>>>> I'm not sure (would have to look at it first) but it is pretty  
>>>> common
>>>> in OSGi land to have bundles that have some shared packages  
>>>> embedded
>>>> to make them working standalone and when they can get the package  
>>>> from
>>>> another provider.
>>>
>>> I currently checked the FileInstall Sources. There is no
>>> "org.osgi.service.log" implemented,
>>> but DirectoryWatcher imports and uses it: import  
>>> org.osgi.service.log.*;
>>> The mentioned LogEntry is not used there!
>>>
>>> Then I checked the pom.xml and pom-transformed.xml file of  
>>> fileinstall
>>> (todays snapshot) There I found it:
>>>
>>> <build>
>>>   <plugins>
>>>     <plugin>
>>>       <groupId>org.apache.felix</groupId>
>>>       <artifactId>maven-bundle-plugin</artifactId>
>>>       <version>1.4.0</version>
>>>       <extensions>true</extensions>
>>>       <configuration>
>>>         <instructions>
>>>
>>> <Export-Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,
>>> org.osgi.service.log</Export-Package>            <-- HERE
>>>
>>> <Bundle-Activator>org.apache.felix.fileinstall.FileInstall</Bundle- 
>>> Activator>
>>>           <Bundle-SymbolicName>${pom.artifactId}</Bundle- 
>>> SymbolicName>
>>>           <Bundle-Vendor>The Apache Software Foundation</Bundle- 
>>> Vendor>
>>>         </instructions>
>>>       </configuration>
>>>     </plugin>
>>> ...
>>>
>>>
>>>
>>> may be "org.osgi.service.cm" would be the next issue.
>>>
>>> If I understand it right, that maven integrated the  
>>> "org.osgi.service.log"
>>> classes (and may be cm) into fileinstall.jar on build.
>>> The same is done while building feilx 1.9.0.
>>>
>>> The dex tool, or the APK Builder (makes app file bundles which are  
>>> installed
>>> to the phone/emulator) has a problem, when 2 jars
>>> have the same package integrated, right?
>>>
>>> -> I gues the problem is not the eclipse plugin it self, its the  
>>> dx or
>>> apkbuilder tool delivered with android sdk which do the trouble
>>>
>>> I'll try to build fileinstall without this 2 packages in pom.xml ,  
>>> to see if
>>> this "patched" fileinstall make trouble too.
>>>
>>> Regarding fileinstall there is no difference for me in pom.xml  
>>> between 1.20
>>> and 130snapshot
>>>
>>>
>>> I keep on searching. May be we'll find a good solution.  
>>> (unfortunatly I
>>> cannot wait for Google fixing this. I also believe they dont want  
>>> to fix
>>> this)
>>>
>>>
>>>
>>> regards
>>> matthias
>>>
>>>
>>>
>>>
>>> Am 08.07.2009 um 14:22 schrieb Karl Pauls:
>>>
>>>> On Wed, Jul 8, 2009 at 2:12 PM, Matthias Neubert<sureal@onlinehome.de 
>>>> >
>>>> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I add Fileinstall, because my Android HostApplication with its  
>>>>> embedded
>>>>> Felix shall
>>>>> watch a directory on the Android Phone where new Bundles are  
>>>>> stored to.
>>>>> I'm following mostly the iPojo+Android Sample on:
>>>>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on- 
>>>>> android.html .
>>>>>
>>>>> For that I add Fileinstall Dir to Felix' config like this:
>>>>>
>>>>> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/ 
>>>>> bundle");
>>>>> //"felix.fileinstall.dir"
>>>>> configProps.put(DirectoryWatcher.DEBUG,  
>>>>> "1"); //"felix.fileinstall.debug"
>>>>
>>>> Workaround: just set the property as a string for the key and  
>>>> install
>>>> the fileinstall bundle into felix. That should make it work.
>>>>
>>>>> In the HostApplication it self I use FileInstall the following  
>>>>> way:
>>>>>
>>>>> Adding FileInstall to AutoStart with System Bundle:
>>>>>
>>>>> List<BundleActivator> activatorList = new  
>>>>> ArrayList<BundleActivator>();
>>>>> activatorList.add(m_hostActivator);
>>>>>
>>>>> activatorList.add(new FileInstall());
>>>>>
>>>>> // add list of activators which shall be started with system  
>>>>> bundle to
>>>>> config
>>>>> m_felixProperties.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>>>>> activatorList);
>>>>>
>>>>>
>>>>> Equipped with fileinstall I guess the ServiceTracker (see iPojo 
>>>>> +Android
>>>>> Sample) notices when a bundle
>>>>> copied to the watched directory is installed and started (by  
>>>>> fileinstall)
>>>>>
>>>>> If there is an other way, please tell me! (generally I have some  
>>>>> problems
>>>>> understanding that loose coupling thing in Felix and iPojo. I  
>>>>> have to
>>>>> read
>>>>> more regarding this issue.)
>>>>>
>>>>> The thing I wonder about is why this problem occurs in 1.9.0 but  
>>>>> not in
>>>>> 1.8.0. Why I an class defined in fileinstall (with identical  
>>>>> name an
>>>>> package) also defined in felix 1.9.0?
>>>>
>>>> I'm not sure (would have to look at it first) but it is pretty  
>>>> common
>>>> in OSGi land to have bundles that have some shared packages  
>>>> embedded
>>>> to make them working standalone and when they can get the package  
>>>> from
>>>> another provider.
>>>>
>>>>> As far as I know the dexer stops at the first problem. So it may  
>>>>> be that
>>>>>
>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>
>>>>> is not the only problem. It also may happen at other Jars than
>>>>> fileinstall.jar
>>>>>
>>>>> I don't know about visibility filters in eclipse. I will try to  
>>>>> find out.
>>>>> But I think it's not a real solution to do it that way.
>>>>
>>>> Sounds like a bug/problem with android or their eclipse  
>>>> integration to me.
>>>>
>>>> regards,
>>>>
>>>> Karl
>>>>
>>>>>
>>>>> regards
>>>>> Matthias
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>>>>>
>>>>>> Well, why would you want to add fileinstall in the first place?  
>>>>>> You
>>>>>> could just dex it and then install as a bundle no?
>>>>>>
>>>>>> Regarding the issue, it looks like the dex compiler can't handle
>>>>>> multiple definitions of the same class in one compile. Thats  
>>>>>> not nice
>>>>>> but not the end of the world either I guess. If you have to  
>>>>>> have both
>>>>>> felix and fileinstall on the classpath then maybe try to set-up a
>>>>>> visibility filter for one of them that filters out the package in
>>>>>> question.
>>>>>>
>>>>>> regards,
>>>>>>
>>>>>> Karl
>>>>>>
>>>>>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias Neubert<sureal@onlinehome.de 
>>>>>> >
>>>>>> wrote:
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I've tried your patch and it worked! Thank you!
>>>>>>>
>>>>>>> BUT:
>>>>>>>
>>>>>>> There is another Problem which only occur in all 1.9.0  
>>>>>>> snapshots (4. ,
>>>>>>> 7.,
>>>>>>> 8. july), but NOT with 1.8.0 :
>>>>>>>
>>>>>>> If I add in my Android Project in Eclipse the fileinstall.jar  
>>>>>>> (1.2.0 or
>>>>>>> current snapshot) to classpath while
>>>>>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get  
>>>>>>> folling
>>>>>>> Error
>>>>>>> when Eclipse tries to build the project (right after adding)
>>>>>>>
>>>>>>> -> this does not happen with Felix 1.8.0
>>>>>>>
>>>>>>> -> I can add fileinstall.jar without problems if no felix.jar  
>>>>>>> is added
>>>>>>>
>>>>>>> -> if adding fileinstall.jar first, then adding felix.jar, the  
>>>>>>> same
>>>>>>> problem
>>>>>>> occurs
>>>>>>>
>>>>>>> -> problem also occurs in a completly fresh android project
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>>>>>> java.lang.IllegalArgumentException: already added:
>>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com 
>>>>>>> .android 
>>>>>>> .dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java: 
>>>>>>> 276)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java: 
>>>>>>> 228)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> com 
>>>>>>> .android 
>>>>>>> .dx 
>>>>>>> .cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java: 
>>>>>>> 245)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> com 
>>>>>>> .android 
>>>>>>> .dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java: 
>>>>>>> 130)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> com 
>>>>>>> .android 
>>>>>>> .dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> sun 
>>>>>>> .reflect 
>>>>>>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 
>>>>>>> 39)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> sun 
>>>>>>> .reflect 
>>>>>>> .DelegatingMethodAccessorImpl 
>>>>>>> .invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> java.lang.reflect.Method.invoke(Method.java:585)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown  
>>>>>>> Source)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown  
>>>>>>> Source)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>>>> $2.run(BuildManager.java:633)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> org 
>>>>>>> .eclipse 
>>>>>>> .core 
>>>>>>> .internal.events.BuildManager.basicBuild(BuildManager.java:170)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> org 
>>>>>>> .eclipse 
>>>>>>> .core 
>>>>>>> .internal.events.BuildManager.basicBuild(BuildManager.java:201)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>>>> $1.run(BuildManager.java:253)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> org 
>>>>>>> .eclipse 
>>>>>>> .core 
>>>>>>> .internal.events.BuildManager.basicBuild(BuildManager.java:256)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> org 
>>>>>>> .eclipse 
>>>>>>> .core 
>>>>>>> .internal.events.BuildManager.basicBuildLoop(BuildManager.java: 
>>>>>>> 309)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> org 
>>>>>>> .eclipse 
>>>>>>> .core.internal.events.BuildManager.build(BuildManager.java:341)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>>
>>>>>>> org 
>>>>>>> .eclipse 
>>>>>>> .core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java: 
>>>>>>> 140)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>>
>>>>>>> org 
>>>>>>> .eclipse 
>>>>>>> .core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik  
>>>>>>> format
>>>>>>> failed
>>>>>>> with error 1
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> regards
>>>>>>> Matthias
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>>>>>>>
>>>>>>>> Ok, I have committed a potential workaround as described here:
>>>>>>>>
>>>>>>>> https://issues.apache.org/jira/browse/FELIX-1193
>>>>>>>>
>>>>>>>> If you could test again on trunk and respond on the issue  
>>>>>>>> that would
>>>>>>>> be
>>>>>>>> great. Thanks!
>>>>>>>>
>>>>>>>> -> richard
>>>>>>>>
>>>>>>>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>>>>>>>
>>>>>>>>> Looks like a bug in android. Or at least it is something  
>>>>>>>>> where sun
>>>>>>>>> java behaves differently then dalvik/android. Anyways, we  
>>>>>>>>> should be
>>>>>>>>> able to workaround this. We will track this using  
>>>>>>>>> FELIX-1193. Thanks
>>>>>>>>> for letting us know!
>>>>>>>>>
>>>>>>>>> regards,
>>>>>>>>>
>>>>>>>>> Karl
>>>>>>>>>
>>>>>>>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias
>>>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> since nobody answered on my first mail (subject "Android +  
>>>>>>>>>> Felix
>>>>>>>>>> 1.80
>>>>>>>>>> =
>>>>>>>>>> Problems")
>>>>>>>>>> I took the long way and found the solution on my own. It  
>>>>>>>>>> took a bit
>>>>>>>>>> longer
>>>>>>>>>> because I'm completely new to OSGi and felix.
>>>>>>>>>>
>>>>>>>>>> First the solution on that one thing, then the current bug:
>>>>>>>>>>
>>>>>>>>>> Solution:
>>>>>>>>>> Felix 1.8.0 release doesn't have the patch for Android  
>>>>>>>>>> compatible
>>>>>>>>>> Classloading ( before I thought it has it already), so in  
>>>>>>>>>> adb shell
>>>>>>>>>> the
>>>>>>>>>> command "chmod 777 /data/dalvik-cache" has to be executed  
>>>>>>>>>> (which
>>>>>>>>>> shows
>>>>>>>>>> us,
>>>>>>>>>> that this will not work on a real phone)
>>>>>>>>>>
>>>>>>>>>> ->  with Felix 1.8.0 and the little "hack" it now runs and  
>>>>>>>>>> its
>>>>>>>>>> starting
>>>>>>>>>> Bundles. This is the first step getting the outdated ipojo  
>>>>>>>>>> sample
>>>>>>>>>> running.
>>>>>>>>>> May be some more work is left.
>>>>>>>>>> ->  without the hack, systembundle and ipojo.annotations  
>>>>>>>>>> get active,
>>>>>>>>>> but
>>>>>>>>>> for
>>>>>>>>>> example shell, shelltui and iPojo remain resolved and  
>>>>>>>>>> doesn't start.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Problem/Bug:
>>>>>>>>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an
>>>>>>>>>> Android
>>>>>>>>>> Application.(same project as mentioned above, just switched
>>>>>>>>>> classpath
>>>>>>>>>> to
>>>>>>>>>> newer jar file)
>>>>>>>>>> The access-rights-hack doesn't help here, so it must be a  
>>>>>>>>>> bug or
>>>>>>>>>> something
>>>>>>>>>> like that.
>>>>>>>>>>
>>>>>>>>>> If someone is interested in this bug, I can send my eclipse  
>>>>>>>>>> project,
>>>>>>>>>> if
>>>>>>>>>> needed
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>>>>>>>
>>>>>>>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>>>>>>>> Ljava/lang/RuntimeException; thrown during
>>>>>>>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>>>>>>>
>>>>>>>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch  
>>>>>>>>>> timeout has
>>>>>>>>>> expired,
>>>>>>>>>> giving up wake lock!
>>>>>>>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity  
>>>>>>>>>> idle timeout
>>>>>>>>>> for
>>>>>>>>>> HistoryRecord{435f61b0
>>>>>>>>>> {de.mn.felixembedand/ 
>>>>>>>>>> de.mn.felixembedand.FelixEmbedAndStarter}}
>>>>>>>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting  
>>>>>>>>>> down VM
>>>>>>>>>>
>>>>>>>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread  
>>>>>>>>>> exiting
>>>>>>>>>> with
>>>>>>>>>> uncaught exception (group=0x4000fe70)
>>>>>>>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught  
>>>>>>>>>> handler:
>>>>>>>>>> thread
>>>>>>>>>> main exiting due to uncaught exception
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>>>>>>>> java.lang.ExceptionInInitializerError
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org 
>>>>>>>>>> .apache 
>>>>>>>>>> .felix 
>>>>>>>>>> .framework.ExtensionManager.<init>(ExtensionManager.java:142)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> de 
>>>>>>>>>> .mn 
>>>>>>>>>> .felixembedand 
>>>>>>>>>> .FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> android 
>>>>>>>>>> .app 
>>>>>>>>>> .Instrumentation.callActivityOnCreate(Instrumentation.java: 
>>>>>>>>>> 1123)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> android 
>>>>>>>>>> .app 
>>>>>>>>>> .ActivityThread.performLaunchActivity(ActivityThread.java: 
>>>>>>>>>> 2231)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> android 
>>>>>>>>>> .app 
>>>>>>>>>> .ActivityThread.handleLaunchActivity(ActivityThread.java: 
>>>>>>>>>> 2284)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> android.app.ActivityThread.access$1800(ActivityThread.java: 
>>>>>>>>>> 112)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> android.app.ActivityThread 
>>>>>>>>>> $H.handleMessage(ActivityThread.java:1692)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> android.os.Looper.loop(Looper.java:123)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> com.android.internal.os.ZygoteInit 
>>>>>>>>>> $MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> dalvik.system.NativeStart.main(Native Method)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>>> java.lang.RuntimeException: Problem creating boot  
>>>>>>>>>> delegation class
>>>>>>>>>> loader.
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> org 
>>>>>>>>>> .apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>>>>>>> 114)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16  
>>>>>>>>>> more
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> java 
>>>>>>>>>> .security.SecureClassLoader.<init>(SecureClassLoader.java:76)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java: 
>>>>>>>>>> 446)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org 
>>>>>>>>>> .apache 
>>>>>>>>>> .felix.framework.util.SecureAction.invoke(SecureAction.java: 
>>>>>>>>>> 862)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> org 
>>>>>>>>>> .apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>>>>>>> 109)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16  
>>>>>>>>>> more
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>>> java.lang.NullPointerException: Parent ClassLoader may not  
>>>>>>>>>> be null
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21  
>>>>>>>>>> more
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> My Config:
>>>>>>>>>> Eclipse 3.4
>>>>>>>>>> Android SDK 1.5r2
>>>>>>>>>> ADT 0.91 (current)
>>>>>>>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> regards
>>>>>>>>>> matthias
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Karl Pauls
>>>>>> karlpauls@gmail.com
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Karl Pauls
>>>> karlpauls@gmail.com
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>>
>>
>> -- 
>> Karl Pauls
>> karlpauls@gmail.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Matthias Neubert <su...@onlinehome.de>.
Hello,

OK, I'try it.

Current state: newly build felix and fileinstall (with "patch" without  
osgi log package)
works. I get no more errors and can start the app.

BUT ;-)

this causes the other bundles (like ipojo, ipojo.arch, shell,  
shelltui) which load via an InstallerActivator from resources area of  
the android project)
not to start correctly.

I'll try loading and  starting fileinstall with the same method lie  
the other bundles and then I'll see if the problems remain.


regards
matthias




Am 08.07.2009 um 16:43 schrieb Karl Pauls:

> On Wed, Jul 8, 2009 at 3:29 PM, Matthias  
> Neubert<su...@onlinehome.de> wrote:
>> Hello,
>>
>>> Workaround: just set the property as a string for the key and  
>>> install
>>> the fileinstall bundle into felix. That should make it work.
>>
>> thats right, but it doesn't help with the activator-part in the  
>> HostApp
>
> You don't need to do the activator part if you just install the
> fileinstall.jar as a bundle.
>
> regards,
>
> Karl
>
>>> I'm not sure (would have to look at it first) but it is pretty  
>>> common
>>> in OSGi land to have bundles that have some shared packages embedded
>>> to make them working standalone and when they can get the package  
>>> from
>>> another provider.
>>
>> I currently checked the FileInstall Sources. There is no
>> "org.osgi.service.log" implemented,
>> but DirectoryWatcher imports and uses it: import  
>> org.osgi.service.log.*;
>>  The mentioned LogEntry is not used there!
>>
>> Then I checked the pom.xml and pom-transformed.xml file of  
>> fileinstall
>> (todays snapshot) There I found it:
>>
>>  <build>
>>    <plugins>
>>      <plugin>
>>        <groupId>org.apache.felix</groupId>
>>        <artifactId>maven-bundle-plugin</artifactId>
>>        <version>1.4.0</version>
>>        <extensions>true</extensions>
>>        <configuration>
>>          <instructions>
>>
>>  <Export-Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,
>> org.osgi.service.log</Export-Package>            <-- HERE
>>
>>  <Bundle-Activator>org.apache.felix.fileinstall.FileInstall</Bundle- 
>> Activator>
>>            <Bundle-SymbolicName>${pom.artifactId}</Bundle- 
>> SymbolicName>
>>            <Bundle-Vendor>The Apache Software Foundation</Bundle- 
>> Vendor>
>>          </instructions>
>>        </configuration>
>>      </plugin>
>> ...
>>
>>
>>
>> may be "org.osgi.service.cm" would be the next issue.
>>
>> If I understand it right, that maven integrated the  
>> "org.osgi.service.log"
>> classes (and may be cm) into fileinstall.jar on build.
>> The same is done while building feilx 1.9.0.
>>
>> The dex tool, or the APK Builder (makes app file bundles which are  
>> installed
>> to the phone/emulator) has a problem, when 2 jars
>> have the same package integrated, right?
>>
>> -> I gues the problem is not the eclipse plugin it self, its the dx  
>> or
>> apkbuilder tool delivered with android sdk which do the trouble
>>
>> I'll try to build fileinstall without this 2 packages in pom.xml ,  
>> to see if
>> this "patched" fileinstall make trouble too.
>>
>> Regarding fileinstall there is no difference for me in pom.xml  
>> between 1.20
>> and 130snapshot
>>
>>
>> I keep on searching. May be we'll find a good solution.  
>> (unfortunatly I
>> cannot wait for Google fixing this. I also believe they dont want  
>> to fix
>> this)
>>
>>
>>
>> regards
>> matthias
>>
>>
>>
>>
>> Am 08.07.2009 um 14:22 schrieb Karl Pauls:
>>
>>> On Wed, Jul 8, 2009 at 2:12 PM, Matthias Neubert<sureal@onlinehome.de 
>>> >
>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> I add Fileinstall, because my Android HostApplication with its  
>>>> embedded
>>>> Felix shall
>>>> watch a directory on the Android Phone where new Bundles are  
>>>> stored to.
>>>> I'm following mostly the iPojo+Android Sample on:
>>>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html .
>>>>
>>>> For that I add Fileinstall Dir to Felix' config like this:
>>>>
>>>> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/bundle");
>>>> //"felix.fileinstall.dir"
>>>> configProps.put(DirectoryWatcher.DEBUG,  
>>>> "1"); //"felix.fileinstall.debug"
>>>
>>> Workaround: just set the property as a string for the key and  
>>> install
>>> the fileinstall bundle into felix. That should make it work.
>>>
>>>> In the HostApplication it self I use FileInstall the following way:
>>>>
>>>> Adding FileInstall to AutoStart with System Bundle:
>>>>
>>>> List<BundleActivator> activatorList = new  
>>>> ArrayList<BundleActivator>();
>>>> activatorList.add(m_hostActivator);
>>>>
>>>> activatorList.add(new FileInstall());
>>>>
>>>> // add list of activators which shall be started with system  
>>>> bundle to
>>>> config
>>>> m_felixProperties.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>>>> activatorList);
>>>>
>>>>
>>>> Equipped with fileinstall I guess the ServiceTracker (see iPojo 
>>>> +Android
>>>> Sample) notices when a bundle
>>>> copied to the watched directory is installed and started (by  
>>>> fileinstall)
>>>>
>>>> If there is an other way, please tell me! (generally I have some  
>>>> problems
>>>> understanding that loose coupling thing in Felix and iPojo. I  
>>>> have to
>>>> read
>>>> more regarding this issue.)
>>>>
>>>> The thing I wonder about is why this problem occurs in 1.9.0 but  
>>>> not in
>>>> 1.8.0. Why I an class defined in fileinstall (with identical name  
>>>> an
>>>> package) also defined in felix 1.9.0?
>>>
>>> I'm not sure (would have to look at it first) but it is pretty  
>>> common
>>> in OSGi land to have bundles that have some shared packages embedded
>>> to make them working standalone and when they can get the package  
>>> from
>>> another provider.
>>>
>>>> As far as I know the dexer stops at the first problem. So it may  
>>>> be that
>>>>
>>>> Lorg/osgi/service/log/LogEntry;
>>>>
>>>> is not the only problem. It also may happen at other Jars than
>>>> fileinstall.jar
>>>>
>>>> I don't know about visibility filters in eclipse. I will try to  
>>>> find out.
>>>> But I think it's not a real solution to do it that way.
>>>
>>> Sounds like a bug/problem with android or their eclipse  
>>> integration to me.
>>>
>>> regards,
>>>
>>> Karl
>>>
>>>>
>>>> regards
>>>> Matthias
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>>>>
>>>>> Well, why would you want to add fileinstall in the first place?  
>>>>> You
>>>>> could just dex it and then install as a bundle no?
>>>>>
>>>>> Regarding the issue, it looks like the dex compiler can't handle
>>>>> multiple definitions of the same class in one compile. Thats not  
>>>>> nice
>>>>> but not the end of the world either I guess. If you have to have  
>>>>> both
>>>>> felix and fileinstall on the classpath then maybe try to set-up a
>>>>> visibility filter for one of them that filters out the package in
>>>>> question.
>>>>>
>>>>> regards,
>>>>>
>>>>> Karl
>>>>>
>>>>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias Neubert<sureal@onlinehome.de 
>>>>> >
>>>>> wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I've tried your patch and it worked! Thank you!
>>>>>>
>>>>>> BUT:
>>>>>>
>>>>>> There is another Problem which only occur in all 1.9.0  
>>>>>> snapshots (4. ,
>>>>>> 7.,
>>>>>> 8. july), but NOT with 1.8.0 :
>>>>>>
>>>>>> If I add in my Android Project in Eclipse the fileinstall.jar  
>>>>>> (1.2.0 or
>>>>>> current snapshot) to classpath while
>>>>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get  
>>>>>> folling
>>>>>> Error
>>>>>> when Eclipse tries to build the project (right after adding)
>>>>>>
>>>>>> -> this does not happen with Felix 1.8.0
>>>>>>
>>>>>> -> I can add fileinstall.jar without problems if no felix.jar  
>>>>>> is added
>>>>>>
>>>>>> -> if adding fileinstall.jar first, then adding felix.jar, the  
>>>>>> same
>>>>>> problem
>>>>>> occurs
>>>>>>
>>>>>> -> problem also occurs in a completly fresh android project
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>>>>> java.lang.IllegalArgumentException: already added:
>>>>>> Lorg/osgi/service/log/LogEntry;
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com 
>>>>>> .android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java: 
>>>>>> 123)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java: 
>>>>>> 228)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> com 
>>>>>> .android 
>>>>>> .dx 
>>>>>> .cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java: 
>>>>>> 245)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> com 
>>>>>> .android 
>>>>>> .dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java: 
>>>>>> 130)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> com 
>>>>>> .android 
>>>>>> .dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> sun 
>>>>>> .reflect 
>>>>>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 
>>>>>> 39)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> sun 
>>>>>> .reflect 
>>>>>> .DelegatingMethodAccessorImpl 
>>>>>> .invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> java.lang.reflect.Method.invoke(Method.java:585)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown  
>>>>>> Source)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown  
>>>>>> Source)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>>> $2.run(BuildManager.java:633)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> org 
>>>>>> .eclipse 
>>>>>> .core.internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>>>> 170)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> org 
>>>>>> .eclipse 
>>>>>> .core.internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>>>> 201)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> org.eclipse.core.internal.events.BuildManager 
>>>>>> $1.run(BuildManager.java:253)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> org 
>>>>>> .eclipse 
>>>>>> .core.internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>>>> 256)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> org 
>>>>>> .eclipse 
>>>>>> .core 
>>>>>> .internal.events.BuildManager.basicBuildLoop(BuildManager.java: 
>>>>>> 309)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> org 
>>>>>> .eclipse 
>>>>>> .core.internal.events.BuildManager.build(BuildManager.java:341)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>>
>>>>>> org 
>>>>>> .eclipse 
>>>>>> .core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>>
>>>>>> org 
>>>>>> .eclipse 
>>>>>> .core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik  
>>>>>> format
>>>>>> failed
>>>>>> with error 1
>>>>>>
>>>>>>
>>>>>>
>>>>>> regards
>>>>>> Matthias
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>>>>>>
>>>>>>> Ok, I have committed a potential workaround as described here:
>>>>>>>
>>>>>>>  https://issues.apache.org/jira/browse/FELIX-1193
>>>>>>>
>>>>>>> If you could test again on trunk and respond on the issue that  
>>>>>>> would
>>>>>>> be
>>>>>>> great. Thanks!
>>>>>>>
>>>>>>> -> richard
>>>>>>>
>>>>>>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>>>>>>
>>>>>>>> Looks like a bug in android. Or at least it is something  
>>>>>>>> where sun
>>>>>>>> java behaves differently then dalvik/android. Anyways, we  
>>>>>>>> should be
>>>>>>>> able to workaround this. We will track this using FELIX-1193.  
>>>>>>>> Thanks
>>>>>>>> for letting us know!
>>>>>>>>
>>>>>>>> regards,
>>>>>>>>
>>>>>>>> Karl
>>>>>>>>
>>>>>>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias
>>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>>>  wrote:
>>>>>>>>
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> since nobody answered on my first mail (subject "Android +  
>>>>>>>>> Felix
>>>>>>>>> 1.80
>>>>>>>>> =
>>>>>>>>> Problems")
>>>>>>>>> I took the long way and found the solution on my own. It  
>>>>>>>>> took a bit
>>>>>>>>> longer
>>>>>>>>> because I'm completely new to OSGi and felix.
>>>>>>>>>
>>>>>>>>> First the solution on that one thing, then the current bug:
>>>>>>>>>
>>>>>>>>> Solution:
>>>>>>>>> Felix 1.8.0 release doesn't have the patch for Android  
>>>>>>>>> compatible
>>>>>>>>> Classloading ( before I thought it has it already), so in  
>>>>>>>>> adb shell
>>>>>>>>> the
>>>>>>>>> command "chmod 777 /data/dalvik-cache" has to be executed  
>>>>>>>>> (which
>>>>>>>>> shows
>>>>>>>>> us,
>>>>>>>>> that this will not work on a real phone)
>>>>>>>>>
>>>>>>>>> ->  with Felix 1.8.0 and the little "hack" it now runs and its
>>>>>>>>> starting
>>>>>>>>> Bundles. This is the first step getting the outdated ipojo  
>>>>>>>>> sample
>>>>>>>>> running.
>>>>>>>>> May be some more work is left.
>>>>>>>>> ->  without the hack, systembundle and ipojo.annotations get  
>>>>>>>>> active,
>>>>>>>>> but
>>>>>>>>> for
>>>>>>>>> example shell, shelltui and iPojo remain resolved and  
>>>>>>>>> doesn't start.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Problem/Bug:
>>>>>>>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an
>>>>>>>>> Android
>>>>>>>>> Application.(same project as mentioned above, just switched
>>>>>>>>> classpath
>>>>>>>>> to
>>>>>>>>> newer jar file)
>>>>>>>>> The access-rights-hack doesn't help here, so it must be a  
>>>>>>>>> bug or
>>>>>>>>> something
>>>>>>>>> like that.
>>>>>>>>>
>>>>>>>>> If someone is interested in this bug, I can send my eclipse  
>>>>>>>>> project,
>>>>>>>>> if
>>>>>>>>> needed
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>>>>>>
>>>>>>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>>>>>>> Ljava/lang/RuntimeException; thrown during
>>>>>>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>>>>>>
>>>>>>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch  
>>>>>>>>> timeout has
>>>>>>>>> expired,
>>>>>>>>> giving up wake lock!
>>>>>>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle  
>>>>>>>>> timeout
>>>>>>>>> for
>>>>>>>>> HistoryRecord{435f61b0
>>>>>>>>> {de.mn.felixembedand/ 
>>>>>>>>> de.mn.felixembedand.FelixEmbedAndStarter}}
>>>>>>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting  
>>>>>>>>> down VM
>>>>>>>>>
>>>>>>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread  
>>>>>>>>> exiting
>>>>>>>>> with
>>>>>>>>> uncaught exception (group=0x4000fe70)
>>>>>>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught  
>>>>>>>>> handler:
>>>>>>>>> thread
>>>>>>>>> main exiting due to uncaught exception
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>>>>>>> java.lang.ExceptionInInitializerError
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org 
>>>>>>>>> .apache 
>>>>>>>>> .felix 
>>>>>>>>> .framework.ExtensionManager.<init>(ExtensionManager.java:142)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> de 
>>>>>>>>> .mn 
>>>>>>>>> .felixembedand 
>>>>>>>>> .FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> android 
>>>>>>>>> .app 
>>>>>>>>> .Instrumentation.callActivityOnCreate(Instrumentation.java: 
>>>>>>>>> 1123)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> android 
>>>>>>>>> .app 
>>>>>>>>> .ActivityThread.performLaunchActivity(ActivityThread.java: 
>>>>>>>>> 2231)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> android 
>>>>>>>>> .app.ActivityThread.handleLaunchActivity(ActivityThread.java: 
>>>>>>>>> 2284)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> android.app.ActivityThread.access$1800(ActivityThread.java: 
>>>>>>>>> 112)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> android.app.ActivityThread 
>>>>>>>>> $H.handleMessage(ActivityThread.java:1692)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> android.os.Looper.loop(Looper.java:123)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> com.android.internal.os.ZygoteInit 
>>>>>>>>> $MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> dalvik.system.NativeStart.main(Native Method)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>> java.lang.RuntimeException: Problem creating boot delegation  
>>>>>>>>> class
>>>>>>>>> loader.
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> org 
>>>>>>>>> .apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>>>>>> 114)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16  
>>>>>>>>> more
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> java 
>>>>>>>>> .security.SecureClassLoader.<init>(SecureClassLoader.java:76)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java: 
>>>>>>>>> 446)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org 
>>>>>>>>> .apache 
>>>>>>>>> .felix.framework.util.SecureAction.invoke(SecureAction.java: 
>>>>>>>>> 862)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> org 
>>>>>>>>> .apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>>>>>> 109)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16  
>>>>>>>>> more
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>>> java.lang.NullPointerException: Parent ClassLoader may not  
>>>>>>>>> be null
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21  
>>>>>>>>> more
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> My Config:
>>>>>>>>> Eclipse 3.4
>>>>>>>>> Android SDK 1.5r2
>>>>>>>>> ADT 0.91 (current)
>>>>>>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> regards
>>>>>>>>> matthias
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Karl Pauls
>>>>> karlpauls@gmail.com
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Karl Pauls
>>> karlpauls@gmail.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
>
>
> -- 
> Karl Pauls
> karlpauls@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Karl Pauls <ka...@gmail.com>.
On Wed, Jul 8, 2009 at 3:29 PM, Matthias Neubert<su...@onlinehome.de> wrote:
> Hello,
>
>> Workaround: just set the property as a string for the key and install
>> the fileinstall bundle into felix. That should make it work.
>
> thats right, but it doesn't help with the activator-part in the HostApp

You don't need to do the activator part if you just install the
fileinstall.jar as a bundle.

regards,

Karl

>> I'm not sure (would have to look at it first) but it is pretty common
>> in OSGi land to have bundles that have some shared packages embedded
>> to make them working standalone and when they can get the package from
>> another provider.
>
> I currently checked the FileInstall Sources. There is no
> "org.osgi.service.log" implemented,
> but DirectoryWatcher imports and uses it: import org.osgi.service.log.*;
>  The mentioned LogEntry is not used there!
>
> Then I checked the pom.xml and pom-transformed.xml file of fileinstall
> (todays snapshot) There I found it:
>
>  <build>
>    <plugins>
>      <plugin>
>        <groupId>org.apache.felix</groupId>
>        <artifactId>maven-bundle-plugin</artifactId>
>        <version>1.4.0</version>
>        <extensions>true</extensions>
>        <configuration>
>          <instructions>
>
>  <Export-Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,
> org.osgi.service.log</Export-Package>            <-- HERE
>
>  <Bundle-Activator>org.apache.felix.fileinstall.FileInstall</Bundle-Activator>
>            <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
>            <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
>          </instructions>
>        </configuration>
>      </plugin>
> ...
>
>
>
> may be "org.osgi.service.cm" would be the next issue.
>
> If I understand it right, that maven integrated the "org.osgi.service.log"
> classes (and may be cm) into fileinstall.jar on build.
> The same is done while building feilx 1.9.0.
>
> The dex tool, or the APK Builder (makes app file bundles which are installed
> to the phone/emulator) has a problem, when 2 jars
> have the same package integrated, right?
>
> -> I gues the problem is not the eclipse plugin it self, its the dx or
> apkbuilder tool delivered with android sdk which do the trouble
>
> I'll try to build fileinstall without this 2 packages in pom.xml , to see if
> this "patched" fileinstall make trouble too.
>
> Regarding fileinstall there is no difference for me in pom.xml between 1.20
> and 130snapshot
>
>
> I keep on searching. May be we'll find a good solution. (unfortunatly I
> cannot wait for Google fixing this. I also believe they dont want to fix
> this)
>
>
>
> regards
> matthias
>
>
>
>
> Am 08.07.2009 um 14:22 schrieb Karl Pauls:
>
>> On Wed, Jul 8, 2009 at 2:12 PM, Matthias Neubert<su...@onlinehome.de>
>> wrote:
>>>
>>> Hello,
>>>
>>> I add Fileinstall, because my Android HostApplication with its embedded
>>> Felix shall
>>> watch a directory on the Android Phone where new Bundles are stored to.
>>> I'm following mostly the iPojo+Android Sample on:
>>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html .
>>>
>>> For that I add Fileinstall Dir to Felix' config like this:
>>>
>>> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/bundle");
>>> //"felix.fileinstall.dir"
>>> configProps.put(DirectoryWatcher.DEBUG, "1"); //"felix.fileinstall.debug"
>>
>> Workaround: just set the property as a string for the key and install
>> the fileinstall bundle into felix. That should make it work.
>>
>>> In the HostApplication it self I use FileInstall the following way:
>>>
>>> Adding FileInstall to AutoStart with System Bundle:
>>>
>>> List<BundleActivator> activatorList = new ArrayList<BundleActivator>();
>>> activatorList.add(m_hostActivator);
>>>
>>> activatorList.add(new FileInstall());
>>>
>>> // add list of activators which shall be started with system bundle to
>>> config
>>> m_felixProperties.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>>> activatorList);
>>>
>>>
>>> Equipped with fileinstall I guess the ServiceTracker (see iPojo+Android
>>> Sample) notices when a bundle
>>> copied to the watched directory is installed and started (by fileinstall)
>>>
>>> If there is an other way, please tell me! (generally I have some problems
>>> understanding that loose coupling thing in Felix and iPojo. I have to
>>> read
>>> more regarding this issue.)
>>>
>>> The thing I wonder about is why this problem occurs in 1.9.0 but not in
>>> 1.8.0. Why I an class defined in fileinstall (with identical name an
>>> package) also defined in felix 1.9.0?
>>
>> I'm not sure (would have to look at it first) but it is pretty common
>> in OSGi land to have bundles that have some shared packages embedded
>> to make them working standalone and when they can get the package from
>> another provider.
>>
>>> As far as I know the dexer stops at the first problem. So it may be that
>>>
>>> Lorg/osgi/service/log/LogEntry;
>>>
>>> is not the only problem. It also may happen at other Jars than
>>> fileinstall.jar
>>>
>>> I don't know about visibility filters in eclipse. I will try to find out.
>>> But I think it's not a real solution to do it that way.
>>
>> Sounds like a bug/problem with android or their eclipse integration to me.
>>
>> regards,
>>
>> Karl
>>
>>>
>>> regards
>>> Matthias
>>>
>>>
>>>
>>>
>>>
>>> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>>>
>>>> Well, why would you want to add fileinstall in the first place? You
>>>> could just dex it and then install as a bundle no?
>>>>
>>>> Regarding the issue, it looks like the dex compiler can't handle
>>>> multiple definitions of the same class in one compile. Thats not nice
>>>> but not the end of the world either I guess. If you have to have both
>>>> felix and fileinstall on the classpath then maybe try to set-up a
>>>> visibility filter for one of them that filters out the package in
>>>> question.
>>>>
>>>> regards,
>>>>
>>>> Karl
>>>>
>>>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias Neubert<su...@onlinehome.de>
>>>> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I've tried your patch and it worked! Thank you!
>>>>>
>>>>> BUT:
>>>>>
>>>>> There is another Problem which only occur in all 1.9.0 snapshots (4. ,
>>>>> 7.,
>>>>> 8. july), but NOT with 1.8.0 :
>>>>>
>>>>> If I add in my Android Project in Eclipse the fileinstall.jar (1.2.0 or
>>>>> current snapshot) to classpath while
>>>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get folling
>>>>> Error
>>>>> when Eclipse tries to build the project (right after adding)
>>>>>
>>>>> -> this does not happen with Felix 1.8.0
>>>>>
>>>>> -> I can add fileinstall.jar without problems if no felix.jar is added
>>>>>
>>>>> -> if adding fileinstall.jar first, then adding felix.jar, the same
>>>>> problem
>>>>> occurs
>>>>>
>>>>> -> problem also occurs in a completly fresh android project
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>>>> java.lang.IllegalArgumentException: already added:
>>>>> Lorg/osgi/service/log/LogEntry;
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> java.lang.reflect.Method.invoke(Method.java:585)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown Source)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>>
>>>>> org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>>
>>>>> org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik format
>>>>> failed
>>>>> with error 1
>>>>>
>>>>>
>>>>>
>>>>> regards
>>>>> Matthias
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>>>>>
>>>>>> Ok, I have committed a potential workaround as described here:
>>>>>>
>>>>>>  https://issues.apache.org/jira/browse/FELIX-1193
>>>>>>
>>>>>> If you could test again on trunk and respond on the issue that would
>>>>>> be
>>>>>> great. Thanks!
>>>>>>
>>>>>> -> richard
>>>>>>
>>>>>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>>>>>
>>>>>>> Looks like a bug in android. Or at least it is something where sun
>>>>>>> java behaves differently then dalvik/android. Anyways, we should be
>>>>>>> able to workaround this. We will track this using FELIX-1193. Thanks
>>>>>>> for letting us know!
>>>>>>>
>>>>>>> regards,
>>>>>>>
>>>>>>> Karl
>>>>>>>
>>>>>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias
>>>>>>> Neubert<su...@onlinehome.de>
>>>>>>>  wrote:
>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> since nobody answered on my first mail (subject "Android + Felix
>>>>>>>> 1.80
>>>>>>>> =
>>>>>>>> Problems")
>>>>>>>> I took the long way and found the solution on my own. It took a bit
>>>>>>>> longer
>>>>>>>> because I'm completely new to OSGi and felix.
>>>>>>>>
>>>>>>>> First the solution on that one thing, then the current bug:
>>>>>>>>
>>>>>>>> Solution:
>>>>>>>> Felix 1.8.0 release doesn't have the patch for Android compatible
>>>>>>>> Classloading ( before I thought it has it already), so in adb shell
>>>>>>>> the
>>>>>>>> command "chmod 777 /data/dalvik-cache" has to be executed (which
>>>>>>>> shows
>>>>>>>> us,
>>>>>>>> that this will not work on a real phone)
>>>>>>>>
>>>>>>>> ->  with Felix 1.8.0 and the little "hack" it now runs and its
>>>>>>>> starting
>>>>>>>> Bundles. This is the first step getting the outdated ipojo sample
>>>>>>>> running.
>>>>>>>> May be some more work is left.
>>>>>>>> ->  without the hack, systembundle and ipojo.annotations get active,
>>>>>>>> but
>>>>>>>> for
>>>>>>>> example shell, shelltui and iPojo remain resolved and doesn't start.
>>>>>>>>
>>>>>>>>
>>>>>>>> Problem/Bug:
>>>>>>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an
>>>>>>>> Android
>>>>>>>> Application.(same project as mentioned above, just switched
>>>>>>>> classpath
>>>>>>>> to
>>>>>>>> newer jar file)
>>>>>>>> The access-rights-hack doesn't help here, so it must be a bug or
>>>>>>>> something
>>>>>>>> like that.
>>>>>>>>
>>>>>>>> If someone is interested in this bug, I can send my eclipse project,
>>>>>>>> if
>>>>>>>> needed
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>>>>>
>>>>>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>>>>>> Ljava/lang/RuntimeException; thrown during
>>>>>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>>>>>
>>>>>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout has
>>>>>>>> expired,
>>>>>>>> giving up wake lock!
>>>>>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle timeout
>>>>>>>> for
>>>>>>>> HistoryRecord{435f61b0
>>>>>>>> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
>>>>>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM
>>>>>>>>
>>>>>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread exiting
>>>>>>>> with
>>>>>>>> uncaught exception (group=0x4000fe70)
>>>>>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught handler:
>>>>>>>> thread
>>>>>>>> main exiting due to uncaught exception
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>>>>>> java.lang.ExceptionInInitializerError
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:142)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> de.mn.felixembedand.FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.os.Looper.loop(Looper.java:123)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> dalvik.system.NativeStart.main(Native Method)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>> java.lang.RuntimeException: Problem creating boot delegation class
>>>>>>>> loader.
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:114)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.apache.felix.framework.util.SecureAction.invoke(SecureAction.java:862)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:109)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>>> java.lang.NullPointerException: Parent ClassLoader may not be null
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> My Config:
>>>>>>>> Eclipse 3.4
>>>>>>>> Android SDK 1.5r2
>>>>>>>> ADT 0.91 (current)
>>>>>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>>>>>
>>>>>>>>
>>>>>>>> regards
>>>>>>>> matthias
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Karl Pauls
>>>> karlpauls@gmail.com
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>
>>>
>>
>>
>>
>> --
>> Karl Pauls
>> karlpauls@gmail.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Matthias Neubert <su...@onlinehome.de>.
Hello,

> Workaround: just set the property as a string for the key and install
> the fileinstall bundle into felix. That should make it work.

thats right, but it doesn't help with the activator-part in the HostApp


> I'm not sure (would have to look at it first) but it is pretty common
> in OSGi land to have bundles that have some shared packages embedded
> to make them working standalone and when they can get the package from
> another provider.

I currently checked the FileInstall Sources. There is no  
"org.osgi.service.log" implemented,
but DirectoryWatcher imports and uses it: import  
org.osgi.service.log.*;  The mentioned LogEntry is not used there!

Then I checked the pom.xml and pom-transformed.xml file of fileinstall  
(todays snapshot) There I found it:

  <build>
     <plugins>
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
         <version>1.4.0</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
             <Export- 
Package>org.apache.felix.fileinstall.*,org.osgi.service.cm,  
org.osgi.service.log</Export-Package>            <-- HERE
             <Bundle- 
Activator>org.apache.felix.fileinstall.FileInstall</Bundle-Activator>
             <Bundle-SymbolicName>${pom.artifactId}</Bundle- 
SymbolicName>
             <Bundle-Vendor>The Apache Software Foundation</Bundle- 
Vendor>
           </instructions>
         </configuration>
       </plugin>
...



may be "org.osgi.service.cm" would be the next issue.

If I understand it right, that maven integrated the  
"org.osgi.service.log" classes (and may be cm) into fileinstall.jar on  
build.
The same is done while building feilx 1.9.0.

The dex tool, or the APK Builder (makes app file bundles which are  
installed to the phone/emulator) has a problem, when 2 jars
have the same package integrated, right?

-> I gues the problem is not the eclipse plugin it self, its the dx or  
apkbuilder tool delivered with android sdk which do the trouble

I'll try to build fileinstall without this 2 packages in pom.xml , to  
see if this "patched" fileinstall make trouble too.

Regarding fileinstall there is no difference for me in pom.xml between  
1.20 and 130snapshot


I keep on searching. May be we'll find a good solution. (unfortunatly  
I cannot wait for Google fixing this. I also believe they dont want to  
fix this)



regards
matthias




Am 08.07.2009 um 14:22 schrieb Karl Pauls:

> On Wed, Jul 8, 2009 at 2:12 PM, Matthias  
> Neubert<su...@onlinehome.de> wrote:
>> Hello,
>>
>> I add Fileinstall, because my Android HostApplication with its  
>> embedded
>> Felix shall
>> watch a directory on the Android Phone where new Bundles are stored  
>> to.
>> I'm following mostly the iPojo+Android Sample on:
>> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html .
>>
>> For that I add Fileinstall Dir to Felix' config like this:
>>
>> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/bundle");
>> //"felix.fileinstall.dir"
>> configProps.put(DirectoryWatcher.DEBUG,  
>> "1"); //"felix.fileinstall.debug"
>
> Workaround: just set the property as a string for the key and install
> the fileinstall bundle into felix. That should make it work.
>
>> In the HostApplication it self I use FileInstall the following way:
>>
>> Adding FileInstall to AutoStart with System Bundle:
>>
>> List<BundleActivator> activatorList = new  
>> ArrayList<BundleActivator>();
>> activatorList.add(m_hostActivator);
>>
>> activatorList.add(new FileInstall());
>>
>> // add list of activators which shall be started with system bundle  
>> to
>> config
>> m_felixProperties.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>> activatorList);
>>
>>
>> Equipped with fileinstall I guess the ServiceTracker (see iPojo 
>> +Android
>> Sample) notices when a bundle
>> copied to the watched directory is installed and started (by  
>> fileinstall)
>>
>> If there is an other way, please tell me! (generally I have some  
>> problems
>> understanding that loose coupling thing in Felix and iPojo. I have  
>> to read
>> more regarding this issue.)
>>
>> The thing I wonder about is why this problem occurs in 1.9.0 but  
>> not in
>> 1.8.0. Why I an class defined in fileinstall (with identical name an
>> package) also defined in felix 1.9.0?
>
> I'm not sure (would have to look at it first) but it is pretty common
> in OSGi land to have bundles that have some shared packages embedded
> to make them working standalone and when they can get the package from
> another provider.
>
>> As far as I know the dexer stops at the first problem. So it may be  
>> that
>>
>> Lorg/osgi/service/log/LogEntry;
>>
>> is not the only problem. It also may happen at other Jars than
>> fileinstall.jar
>>
>> I don't know about visibility filters in eclipse. I will try to  
>> find out.
>> But I think it's not a real solution to do it that way.
>
> Sounds like a bug/problem with android or their eclipse integration  
> to me.
>
> regards,
>
> Karl
>
>>
>> regards
>> Matthias
>>
>>
>>
>>
>>
>> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>>
>>> Well, why would you want to add fileinstall in the first place? You
>>> could just dex it and then install as a bundle no?
>>>
>>> Regarding the issue, it looks like the dex compiler can't handle
>>> multiple definitions of the same class in one compile. Thats not  
>>> nice
>>> but not the end of the world either I guess. If you have to have  
>>> both
>>> felix and fileinstall on the classpath then maybe try to set-up a
>>> visibility filter for one of them that filters out the package in
>>> question.
>>>
>>> regards,
>>>
>>> Karl
>>>
>>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias Neubert<sureal@onlinehome.de 
>>> >
>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> I've tried your patch and it worked! Thank you!
>>>>
>>>> BUT:
>>>>
>>>> There is another Problem which only occur in all 1.9.0 snapshots  
>>>> (4. ,
>>>> 7.,
>>>> 8. july), but NOT with 1.8.0 :
>>>>
>>>> If I add in my Android Project in Eclipse the fileinstall.jar  
>>>> (1.2.0 or
>>>> current snapshot) to classpath while
>>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get  
>>>> folling
>>>> Error
>>>> when Eclipse tries to build the project (right after adding)
>>>>
>>>> -> this does not happen with Felix 1.8.0
>>>>
>>>> -> I can add fileinstall.jar without problems if no felix.jar is  
>>>> added
>>>>
>>>> -> if adding fileinstall.jar first, then adding felix.jar, the same
>>>> problem
>>>> occurs
>>>>
>>>> -> problem also occurs in a completly fresh android project
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>>> java.lang.IllegalArgumentException: already added:
>>>> Lorg/osgi/service/log/LogEntry;
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com 
>>>> .android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java: 
>>>> 123)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> com 
>>>> .android 
>>>> .dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java: 
>>>> 245)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> com 
>>>> .android 
>>>> .dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> com 
>>>> .android 
>>>> .dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> sun 
>>>> .reflect 
>>>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> sun 
>>>> .reflect 
>>>> .DelegatingMethodAccessorImpl 
>>>> .invoke(DelegatingMethodAccessorImpl.java:25)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> java.lang.reflect.Method.invoke(Method.java:585)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown  
>>>> Source)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> org.eclipse.core.internal.events.BuildManager 
>>>> $2.run(BuildManager.java:633)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> org 
>>>> .eclipse 
>>>> .core.internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>> 170)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> org 
>>>> .eclipse 
>>>> .core.internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>> 201)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> org.eclipse.core.internal.events.BuildManager 
>>>> $1.run(BuildManager.java:253)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> org 
>>>> .eclipse 
>>>> .core.internal.events.BuildManager.basicBuild(BuildManager.java: 
>>>> 256)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> org 
>>>> .eclipse 
>>>> .core 
>>>> .internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> org 
>>>> .eclipse 
>>>> .core.internal.events.BuildManager.build(BuildManager.java:341)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>>
>>>> org 
>>>> .eclipse 
>>>> .core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> org 
>>>> .eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java: 
>>>> 238)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik  
>>>> format
>>>> failed
>>>> with error 1
>>>>
>>>>
>>>>
>>>> regards
>>>> Matthias
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>>>>
>>>>> Ok, I have committed a potential workaround as described here:
>>>>>
>>>>>  https://issues.apache.org/jira/browse/FELIX-1193
>>>>>
>>>>> If you could test again on trunk and respond on the issue that  
>>>>> would be
>>>>> great. Thanks!
>>>>>
>>>>> -> richard
>>>>>
>>>>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>>>>
>>>>>> Looks like a bug in android. Or at least it is something where  
>>>>>> sun
>>>>>> java behaves differently then dalvik/android. Anyways, we  
>>>>>> should be
>>>>>> able to workaround this. We will track this using FELIX-1193.  
>>>>>> Thanks
>>>>>> for letting us know!
>>>>>>
>>>>>> regards,
>>>>>>
>>>>>> Karl
>>>>>>
>>>>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias Neubert<sureal@onlinehome.de 
>>>>>> >
>>>>>>  wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> since nobody answered on my first mail (subject "Android +  
>>>>>>> Felix 1.80
>>>>>>> =
>>>>>>> Problems")
>>>>>>> I took the long way and found the solution on my own. It took  
>>>>>>> a bit
>>>>>>> longer
>>>>>>> because I'm completely new to OSGi and felix.
>>>>>>>
>>>>>>> First the solution on that one thing, then the current bug:
>>>>>>>
>>>>>>> Solution:
>>>>>>> Felix 1.8.0 release doesn't have the patch for Android  
>>>>>>> compatible
>>>>>>> Classloading ( before I thought it has it already), so in adb  
>>>>>>> shell
>>>>>>> the
>>>>>>> command "chmod 777 /data/dalvik-cache" has to be executed  
>>>>>>> (which shows
>>>>>>> us,
>>>>>>> that this will not work on a real phone)
>>>>>>>
>>>>>>> ->  with Felix 1.8.0 and the little "hack" it now runs and its
>>>>>>> starting
>>>>>>> Bundles. This is the first step getting the outdated ipojo  
>>>>>>> sample
>>>>>>> running.
>>>>>>> May be some more work is left.
>>>>>>> ->  without the hack, systembundle and ipojo.annotations get  
>>>>>>> active,
>>>>>>> but
>>>>>>> for
>>>>>>> example shell, shelltui and iPojo remain resolved and doesn't  
>>>>>>> start.
>>>>>>>
>>>>>>>
>>>>>>> Problem/Bug:
>>>>>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an  
>>>>>>> Android
>>>>>>> Application.(same project as mentioned above, just switched  
>>>>>>> classpath
>>>>>>> to
>>>>>>> newer jar file)
>>>>>>> The access-rights-hack doesn't help here, so it must be a bug or
>>>>>>> something
>>>>>>> like that.
>>>>>>>
>>>>>>> If someone is interested in this bug, I can send my eclipse  
>>>>>>> project,
>>>>>>> if
>>>>>>> needed
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>>>>
>>>>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>>>>> Ljava/lang/RuntimeException; thrown during
>>>>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>>>>
>>>>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout  
>>>>>>> has
>>>>>>> expired,
>>>>>>> giving up wake lock!
>>>>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle  
>>>>>>> timeout
>>>>>>> for
>>>>>>> HistoryRecord{435f61b0
>>>>>>> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
>>>>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM
>>>>>>>
>>>>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread  
>>>>>>> exiting
>>>>>>> with
>>>>>>> uncaught exception (group=0x4000fe70)
>>>>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught  
>>>>>>> handler:
>>>>>>> thread
>>>>>>> main exiting due to uncaught exception
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>>>>> java.lang.ExceptionInInitializerError
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>
>>>>>>>
>>>>>>> org 
>>>>>>> .apache 
>>>>>>> .felix.framework.ExtensionManager.<init>(ExtensionManager.java: 
>>>>>>> 142)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>
>>>>>>>
>>>>>>> de 
>>>>>>> .mn 
>>>>>>> .felixembedand 
>>>>>>> .FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>
>>>>>>>
>>>>>>> android 
>>>>>>> .app.Instrumentation.callActivityOnCreate(Instrumentation.java: 
>>>>>>> 1123)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>
>>>>>>>
>>>>>>> android 
>>>>>>> .app.ActivityThread.performLaunchActivity(ActivityThread.java: 
>>>>>>> 2231)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>
>>>>>>>
>>>>>>> android 
>>>>>>> .app.ActivityThread.handleLaunchActivity(ActivityThread.java: 
>>>>>>> 2284)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> android.app.ActivityThread$H.handleMessage(ActivityThread.java: 
>>>>>>> 1692)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> android.os.Looper.loop(Looper.java:123)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>
>>>>>>>
>>>>>>> com.android.internal.os.ZygoteInit 
>>>>>>> $MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> dalvik.system.NativeStart.main(Native Method)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>> java.lang.RuntimeException: Problem creating boot delegation  
>>>>>>> class
>>>>>>> loader.
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>>>> 114)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> java.security.SecureClassLoader.<init>(SecureClassLoader.java: 
>>>>>>> 76)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>>
>>>>>>>
>>>>>>> org 
>>>>>>> .apache 
>>>>>>> .felix.framework.util.SecureAction.invoke(SecureAction.java:862)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>>>> 109)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>>> java.lang.NullPointerException: Parent ClassLoader may not be  
>>>>>>> null
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> My Config:
>>>>>>> Eclipse 3.4
>>>>>>> Android SDK 1.5r2
>>>>>>> ADT 0.91 (current)
>>>>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>>>>
>>>>>>>
>>>>>>> regards
>>>>>>> matthias
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Karl Pauls
>>> karlpauls@gmail.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>
>
>
> -- 
> Karl Pauls
> karlpauls@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Karl Pauls <ka...@gmail.com>.
On Wed, Jul 8, 2009 at 2:12 PM, Matthias Neubert<su...@onlinehome.de> wrote:
> Hello,
>
> I add Fileinstall, because my Android HostApplication with its embedded
> Felix shall
> watch a directory on the Android Phone where new Bundles are stored to.
> I'm following mostly the iPojo+Android Sample on:
> http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html .
>
> For that I add Fileinstall Dir to Felix' config like this:
>
> configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/bundle");
> //"felix.fileinstall.dir"
> configProps.put(DirectoryWatcher.DEBUG, "1"); //"felix.fileinstall.debug"

Workaround: just set the property as a string for the key and install
the fileinstall bundle into felix. That should make it work.

> In the HostApplication it self I use FileInstall the following way:
>
> Adding FileInstall to AutoStart with System Bundle:
>
> List<BundleActivator> activatorList = new ArrayList<BundleActivator>();
> activatorList.add(m_hostActivator);
>
> activatorList.add(new FileInstall());
>
> // add list of activators which shall be started with system bundle to
> config
> m_felixProperties.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
> activatorList);
>
>
> Equipped with fileinstall I guess the ServiceTracker (see iPojo+Android
> Sample) notices when a bundle
> copied to the watched directory is installed and started (by fileinstall)
>
> If there is an other way, please tell me! (generally I have some problems
> understanding that loose coupling thing in Felix and iPojo. I have to read
> more regarding this issue.)
>
> The thing I wonder about is why this problem occurs in 1.9.0 but not in
> 1.8.0. Why I an class defined in fileinstall (with identical name an
> package) also defined in felix 1.9.0?

I'm not sure (would have to look at it first) but it is pretty common
in OSGi land to have bundles that have some shared packages embedded
to make them working standalone and when they can get the package from
another provider.

> As far as I know the dexer stops at the first problem. So it may be that
>
> Lorg/osgi/service/log/LogEntry;
>
> is not the only problem. It also may happen at other Jars than
> fileinstall.jar
>
> I don't know about visibility filters in eclipse. I will try to find out.
> But I think it's not a real solution to do it that way.

Sounds like a bug/problem with android or their eclipse integration to me.

regards,

Karl

>
> regards
> Matthias
>
>
>
>
>
> Am 08.07.2009 um 13:00 schrieb Karl Pauls:
>
>> Well, why would you want to add fileinstall in the first place? You
>> could just dex it and then install as a bundle no?
>>
>> Regarding the issue, it looks like the dex compiler can't handle
>> multiple definitions of the same class in one compile. Thats not nice
>> but not the end of the world either I guess. If you have to have both
>> felix and fileinstall on the classpath then maybe try to set-up a
>> visibility filter for one of them that filters out the package in
>> question.
>>
>> regards,
>>
>> Karl
>>
>> On Wed, Jul 8, 2009 at 12:30 PM, Matthias Neubert<su...@onlinehome.de>
>> wrote:
>>>
>>> Hello,
>>>
>>> I've tried your patch and it worked! Thank you!
>>>
>>> BUT:
>>>
>>> There is another Problem which only occur in all 1.9.0 snapshots (4. ,
>>> 7.,
>>> 8. july), but NOT with 1.8.0 :
>>>
>>> If I add in my Android Project in Eclipse the fileinstall.jar (1.2.0 or
>>> current snapshot) to classpath while
>>> having Felix 1.9.0 on classpath (as a referenced lib ) I get folling
>>> Error
>>> when Eclipse tries to build the project (right after adding)
>>>
>>> -> this does not happen with Felix 1.8.0
>>>
>>> -> I can add fileinstall.jar without problems if no felix.jar is added
>>>
>>> -> if adding fileinstall.jar first, then adding felix.jar, the same
>>> problem
>>> occurs
>>>
>>> -> problem also occurs in a completly fresh android project
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> UNEXPECTED TOP-LEVEL EXCEPTION:
>>> java.lang.IllegalArgumentException: already added:
>>> Lorg/osgi/service/log/LogEntry;
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.dx.command.dexer.Main.run(Main.java:139)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> java.lang.reflect.Method.invoke(Method.java:585)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown Source)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>>
>>> org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik format
>>> failed
>>> with error 1
>>>
>>>
>>>
>>> regards
>>> Matthias
>>>
>>>
>>>
>>>
>>>
>>> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>>>
>>>> Ok, I have committed a potential workaround as described here:
>>>>
>>>>  https://issues.apache.org/jira/browse/FELIX-1193
>>>>
>>>> If you could test again on trunk and respond on the issue that would be
>>>> great. Thanks!
>>>>
>>>> -> richard
>>>>
>>>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>>>
>>>>> Looks like a bug in android. Or at least it is something where sun
>>>>> java behaves differently then dalvik/android. Anyways, we should be
>>>>> able to workaround this. We will track this using FELIX-1193. Thanks
>>>>> for letting us know!
>>>>>
>>>>> regards,
>>>>>
>>>>> Karl
>>>>>
>>>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias Neubert<su...@onlinehome.de>
>>>>>  wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> since nobody answered on my first mail (subject "Android + Felix 1.80
>>>>>> =
>>>>>> Problems")
>>>>>> I took the long way and found the solution on my own. It took a bit
>>>>>> longer
>>>>>> because I'm completely new to OSGi and felix.
>>>>>>
>>>>>> First the solution on that one thing, then the current bug:
>>>>>>
>>>>>> Solution:
>>>>>> Felix 1.8.0 release doesn't have the patch for Android compatible
>>>>>> Classloading ( before I thought it has it already), so in adb shell
>>>>>> the
>>>>>> command "chmod 777 /data/dalvik-cache" has to be executed (which shows
>>>>>> us,
>>>>>> that this will not work on a real phone)
>>>>>>
>>>>>> ->  with Felix 1.8.0 and the little "hack" it now runs and its
>>>>>> starting
>>>>>> Bundles. This is the first step getting the outdated ipojo sample
>>>>>> running.
>>>>>> May be some more work is left.
>>>>>> ->  without the hack, systembundle and ipojo.annotations get active,
>>>>>> but
>>>>>> for
>>>>>> example shell, shelltui and iPojo remain resolved and doesn't start.
>>>>>>
>>>>>>
>>>>>> Problem/Bug:
>>>>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an Android
>>>>>> Application.(same project as mentioned above, just switched classpath
>>>>>> to
>>>>>> newer jar file)
>>>>>> The access-rights-hack doesn't help here, so it must be a bug or
>>>>>> something
>>>>>> like that.
>>>>>>
>>>>>> If someone is interested in this bug, I can send my eclipse project,
>>>>>> if
>>>>>> needed
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>>>
>>>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>>>> Ljava/lang/RuntimeException; thrown during
>>>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>>>
>>>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout has
>>>>>> expired,
>>>>>> giving up wake lock!
>>>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle timeout
>>>>>> for
>>>>>> HistoryRecord{435f61b0
>>>>>> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
>>>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM
>>>>>>
>>>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread exiting
>>>>>> with
>>>>>> uncaught exception (group=0x4000fe70)
>>>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught handler:
>>>>>> thread
>>>>>> main exiting due to uncaught exception
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>>>> java.lang.ExceptionInInitializerError
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>
>>>>>>
>>>>>> org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:142)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>
>>>>>>
>>>>>> de.mn.felixembedand.FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>
>>>>>>
>>>>>> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>
>>>>>>
>>>>>> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>
>>>>>>
>>>>>> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> android.os.Looper.loop(Looper.java:123)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>
>>>>>>
>>>>>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> dalvik.system.NativeStart.main(Native Method)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>> java.lang.RuntimeException: Problem creating boot delegation class
>>>>>> loader.
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:114)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>> java.lang.reflect.InvocationTargetException
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>>
>>>>>>
>>>>>> org.apache.felix.framework.util.SecureAction.invoke(SecureAction.java:862)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:109)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>>> java.lang.NullPointerException: Parent ClassLoader may not be null
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> My Config:
>>>>>> Eclipse 3.4
>>>>>> Android SDK 1.5r2
>>>>>> ADT 0.91 (current)
>>>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>>>
>>>>>>
>>>>>> regards
>>>>>> matthias
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>
>>
>>
>> --
>> Karl Pauls
>> karlpauls@gmail.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Matthias Neubert <su...@onlinehome.de>.
Hello,

I add Fileinstall, because my Android HostApplication with its  
embedded Felix shall
watch a directory on the Android Phone where new Bundles are stored to.
I'm following mostly the iPojo+Android Sample on: http://ipojo-dark-side.blogspot.com/2008/10/ipojo-on-android.html 
  .

For that I add Fileinstall Dir to Felix' config like this:

configProps.put(DirectoryWatcher.DIR, absFilePath+"/felix/ 
bundle"); //"felix.fileinstall.dir"
configProps.put(DirectoryWatcher.DEBUG,  
"1"); //"felix.fileinstall.debug"

In the HostApplication it self I use FileInstall the following way:

Adding FileInstall to AutoStart with System Bundle:

List<BundleActivator> activatorList = new ArrayList<BundleActivator>();
activatorList.add(m_hostActivator);

activatorList.add(new FileInstall());

// add list of activators which shall be started with system bundle to  
config
m_felixProperties.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,  
activatorList);


Equipped with fileinstall I guess the ServiceTracker (see iPojo 
+Android Sample) notices when a bundle
copied to the watched directory is installed and started (by  
fileinstall)

If there is an other way, please tell me! (generally I have some  
problems understanding that loose coupling thing in Felix and iPojo. I  
have to read more regarding this issue.)

The thing I wonder about is why this problem occurs in 1.9.0 but not  
in 1.8.0. Why I an class defined in fileinstall (with identical name  
an package) also defined in felix 1.9.0?
As far as I know the dexer stops at the first problem. So it may be that

Lorg/osgi/service/log/LogEntry;

is not the only problem. It also may happen at other Jars than  
fileinstall.jar

I don't know about visibility filters in eclipse. I will try to find  
out. But I think it's not a real solution to do it that way.


regards
Matthias





Am 08.07.2009 um 13:00 schrieb Karl Pauls:

> Well, why would you want to add fileinstall in the first place? You
> could just dex it and then install as a bundle no?
>
> Regarding the issue, it looks like the dex compiler can't handle
> multiple definitions of the same class in one compile. Thats not nice
> but not the end of the world either I guess. If you have to have both
> felix and fileinstall on the classpath then maybe try to set-up a
> visibility filter for one of them that filters out the package in
> question.
>
> regards,
>
> Karl
>
> On Wed, Jul 8, 2009 at 12:30 PM, Matthias  
> Neubert<su...@onlinehome.de> wrote:
>> Hello,
>>
>> I've tried your patch and it worked! Thank you!
>>
>> BUT:
>>
>> There is another Problem which only occur in all 1.9.0 snapshots  
>> (4. , 7.,
>> 8. july), but NOT with 1.8.0 :
>>
>> If I add in my Android Project in Eclipse the fileinstall.jar  
>> (1.2.0 or
>> current snapshot) to classpath while
>> having Felix 1.9.0 on classpath (as a referenced lib ) I get  
>> folling Error
>> when Eclipse tries to build the project (right after adding)
>>
>> -> this does not happen with Felix 1.8.0
>>
>> -> I can add fileinstall.jar without problems if no felix.jar is  
>> added
>>
>> -> if adding fileinstall.jar first, then adding felix.jar, the same  
>> problem
>> occurs
>>
>> -> problem also occurs in a completly fresh android project
>>
>>
>>
>>
>>
>>
>>
>> UNEXPECTED TOP-LEVEL EXCEPTION:
>> java.lang.IllegalArgumentException: already added:
>> Lorg/osgi/service/log/LogEntry;
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java: 
>> 123)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.dx.command.dexer.Main.processClass(Main.java:299)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.dx.command.dexer.Main.access$100(Main.java:56)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com 
>> .android 
>> .dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java: 
>> 245)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com 
>> .android 
>> .dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com 
>> .android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java: 
>> 108)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.dx.command.dexer.Main.processOne(Main.java:245)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.dx.command.dexer.Main.run(Main.java:139)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> sun 
>> .reflect 
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> sun 
>> .reflect 
>> .DelegatingMethodAccessorImpl 
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> java.lang.reflect.Method.invoke(Method.java:585)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown  
>> Source)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org.eclipse.core.internal.events.BuildManager 
>> $2.run(BuildManager.java:633)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org 
>> .eclipse 
>> .core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org 
>> .eclipse 
>> .core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org.eclipse.core.internal.events.BuildManager 
>> $1.run(BuildManager.java:253)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org 
>> .eclipse 
>> .core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org 
>> .eclipse 
>> .core.internal.events.BuildManager.basicBuildLoop(BuildManager.java: 
>> 309)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org 
>> .eclipse.core.internal.events.BuildManager.build(BuildManager.java: 
>> 341)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org 
>> .eclipse 
>> .core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java: 
>> 238)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
>> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
>> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik  
>> format failed
>> with error 1
>>
>>
>>
>> regards
>> Matthias
>>
>>
>>
>>
>>
>> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>>
>>> Ok, I have committed a potential workaround as described here:
>>>
>>>   https://issues.apache.org/jira/browse/FELIX-1193
>>>
>>> If you could test again on trunk and respond on the issue that  
>>> would be
>>> great. Thanks!
>>>
>>> -> richard
>>>
>>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>>
>>>> Looks like a bug in android. Or at least it is something where sun
>>>> java behaves differently then dalvik/android. Anyways, we should be
>>>> able to workaround this. We will track this using FELIX-1193.  
>>>> Thanks
>>>> for letting us know!
>>>>
>>>> regards,
>>>>
>>>> Karl
>>>>
>>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias Neubert<sureal@onlinehome.de 
>>>> >
>>>>  wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> since nobody answered on my first mail (subject "Android + Felix  
>>>>> 1.80 =
>>>>> Problems")
>>>>> I took the long way and found the solution on my own. It took a  
>>>>> bit
>>>>> longer
>>>>> because I'm completely new to OSGi and felix.
>>>>>
>>>>> First the solution on that one thing, then the current bug:
>>>>>
>>>>> Solution:
>>>>> Felix 1.8.0 release doesn't have the patch for Android compatible
>>>>> Classloading ( before I thought it has it already), so in adb  
>>>>> shell the
>>>>> command "chmod 777 /data/dalvik-cache" has to be executed (which  
>>>>> shows
>>>>> us,
>>>>> that this will not work on a real phone)
>>>>>
>>>>> ->  with Felix 1.8.0 and the little "hack" it now runs and its  
>>>>> starting
>>>>> Bundles. This is the first step getting the outdated ipojo sample
>>>>> running.
>>>>> May be some more work is left.
>>>>> ->  without the hack, systembundle and ipojo.annotations get  
>>>>> active, but
>>>>> for
>>>>> example shell, shelltui and iPojo remain resolved and doesn't  
>>>>> start.
>>>>>
>>>>>
>>>>> Problem/Bug:
>>>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an  
>>>>> Android
>>>>> Application.(same project as mentioned above, just switched  
>>>>> classpath to
>>>>> newer jar file)
>>>>> The access-rights-hack doesn't help here, so it must be a bug or
>>>>> something
>>>>> like that.
>>>>>
>>>>> If someone is interested in this bug, I can send my eclipse  
>>>>> project, if
>>>>> needed
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>>
>>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>>> Ljava/lang/RuntimeException; thrown during
>>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>>
>>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout has
>>>>> expired,
>>>>> giving up wake lock!
>>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle  
>>>>> timeout for
>>>>> HistoryRecord{435f61b0
>>>>> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
>>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM
>>>>>
>>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread  
>>>>> exiting with
>>>>> uncaught exception (group=0x4000fe70)
>>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught  
>>>>> handler: thread
>>>>> main exiting due to uncaught exception
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>>> java.lang.ExceptionInInitializerError
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>
>>>>> org 
>>>>> .apache 
>>>>> .felix.framework.ExtensionManager.<init>(ExtensionManager.java: 
>>>>> 142)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>
>>>>> de 
>>>>> .mn 
>>>>> .felixembedand 
>>>>> .FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>
>>>>> android 
>>>>> .app.Instrumentation.callActivityOnCreate(Instrumentation.java: 
>>>>> 1123)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>
>>>>> android 
>>>>> .app.ActivityThread.performLaunchActivity(ActivityThread.java: 
>>>>> 2231)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>
>>>>> android 
>>>>> .app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> android.app.ActivityThread$H.handleMessage(ActivityThread.java: 
>>>>> 1692)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> android.os.Looper.loop(Looper.java:123)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>
>>>>> com.android.internal.os.ZygoteInit 
>>>>> $MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> dalvik.system.NativeStart.main(Native Method)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>> java.lang.RuntimeException: Problem creating boot delegation class
>>>>> loader.
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>> 114)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>> java.lang.reflect.InvocationTargetException
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>>
>>>>> org 
>>>>> .apache 
>>>>> .felix.framework.util.SecureAction.invoke(SecureAction.java:862)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java: 
>>>>> 109)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>>> java.lang.NullPointerException: Parent ClassLoader may not be null
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> My Config:
>>>>> Eclipse 3.4
>>>>> Android SDK 1.5r2
>>>>> ADT 0.91 (current)
>>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>>
>>>>>
>>>>> regards
>>>>> matthias
>>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>
>
>
> -- 
> Karl Pauls
> karlpauls@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Karl Pauls <ka...@gmail.com>.
Well, why would you want to add fileinstall in the first place? You
could just dex it and then install as a bundle no?

Regarding the issue, it looks like the dex compiler can't handle
multiple definitions of the same class in one compile. Thats not nice
but not the end of the world either I guess. If you have to have both
felix and fileinstall on the classpath then maybe try to set-up a
visibility filter for one of them that filters out the package in
question.

regards,

Karl

On Wed, Jul 8, 2009 at 12:30 PM, Matthias Neubert<su...@onlinehome.de> wrote:
> Hello,
>
> I've tried your patch and it worked! Thank you!
>
> BUT:
>
> There is another Problem which only occur in all 1.9.0 snapshots (4. , 7.,
> 8. july), but NOT with 1.8.0 :
>
> If I add in my Android Project in Eclipse the fileinstall.jar (1.2.0 or
> current snapshot) to classpath while
> having Felix 1.9.0 on classpath (as a referenced lib ) I get folling Error
> when Eclipse tries to build the project (right after adding)
>
> -> this does not happen with Felix 1.8.0
>
> -> I can add fileinstall.jar without problems if no felix.jar is added
>
> -> if adding fileinstall.jar first, then adding felix.jar, the same problem
> occurs
>
> -> problem also occurs in a completly fresh android project
>
>
>
>
>
>
>
> UNEXPECTED TOP-LEVEL EXCEPTION:
> java.lang.IllegalArgumentException: already added:
> Lorg/osgi/service/log/LogEntry;
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.command.dexer.Main.processClass(Main.java:299)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.command.dexer.Main.access$100(Main.java:56)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.command.dexer.Main.processOne(Main.java:245)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.dx.command.dexer.Main.run(Main.java:139)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> java.lang.reflect.Method.invoke(Method.java:585)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown Source)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
> [2009-07-08 11:34:48 - FelixEmbedAndroid]       at
> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> [2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
> [2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik format failed
> with error 1
>
>
>
> regards
> Matthias
>
>
>
>
>
> Am 07.07.2009 um 22:54 schrieb Richard S. Hall:
>
>> Ok, I have committed a potential workaround as described here:
>>
>>   https://issues.apache.org/jira/browse/FELIX-1193
>>
>> If you could test again on trunk and respond on the issue that would be
>> great. Thanks!
>>
>> -> richard
>>
>> On 7/7/09 4:10 PM, Karl Pauls wrote:
>>>
>>> Looks like a bug in android. Or at least it is something where sun
>>> java behaves differently then dalvik/android. Anyways, we should be
>>> able to workaround this. We will track this using FELIX-1193. Thanks
>>> for letting us know!
>>>
>>> regards,
>>>
>>> Karl
>>>
>>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias Neubert<su...@onlinehome.de>
>>>  wrote:
>>>
>>>> Hello,
>>>>
>>>> since nobody answered on my first mail (subject "Android + Felix 1.80 =
>>>> Problems")
>>>> I took the long way and found the solution on my own. It took a bit
>>>> longer
>>>> because I'm completely new to OSGi and felix.
>>>>
>>>> First the solution on that one thing, then the current bug:
>>>>
>>>> Solution:
>>>> Felix 1.8.0 release doesn't have the patch for Android compatible
>>>> Classloading ( before I thought it has it already), so in adb shell the
>>>> command "chmod 777 /data/dalvik-cache" has to be executed (which shows
>>>> us,
>>>> that this will not work on a real phone)
>>>>
>>>> ->  with Felix 1.8.0 and the little "hack" it now runs and its starting
>>>> Bundles. This is the first step getting the outdated ipojo sample
>>>> running.
>>>> May be some more work is left.
>>>> ->  without the hack, systembundle and ipojo.annotations get active, but
>>>> for
>>>> example shell, shelltui and iPojo remain resolved and doesn't start.
>>>>
>>>>
>>>> Problem/Bug:
>>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an Android
>>>> Application.(same project as mentioned above, just switched classpath to
>>>> newer jar file)
>>>> The access-rights-hack doesn't help here, so it must be a bug or
>>>> something
>>>> like that.
>>>>
>>>> If someone is interested in this bug, I can send my eclipse project, if
>>>> needed
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>>
>>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>>> Ljava/lang/RuntimeException; thrown during
>>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>>
>>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout has
>>>> expired,
>>>> giving up wake lock!
>>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle timeout for
>>>> HistoryRecord{435f61b0
>>>> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
>>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM
>>>>
>>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread exiting with
>>>> uncaught exception (group=0x4000fe70)
>>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught handler: thread
>>>> main exiting due to uncaught exception
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>>> java.lang.ExceptionInInitializerError
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>
>>>> org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:142)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>
>>>> de.mn.felixembedand.FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>
>>>> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>
>>>> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>
>>>> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> android.os.Looper.loop(Looper.java:123)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> java.lang.reflect.Method.invokeNative(Native Method)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> java.lang.reflect.Method.invoke(Method.java:521)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>
>>>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> dalvik.system.NativeStart.main(Native Method)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>> java.lang.RuntimeException: Problem creating boot delegation class
>>>> loader.
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:114)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>> java.lang.reflect.InvocationTargetException
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>>
>>>> org.apache.felix.framework.util.SecureAction.invoke(SecureAction.java:862)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:109)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>>> java.lang.NullPointerException: Parent ClassLoader may not be null
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>>>>
>>>>
>>>>
>>>>
>>>> My Config:
>>>> Eclipse 3.4
>>>> Android SDK 1.5r2
>>>> ADT 0.91 (current)
>>>> Java SDK: JVM 1.5.0 MacOS X
>>>>
>>>>
>>>> regards
>>>> matthias
>>>>
>>>
>>>
>>>
>>>
>
>



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Matthias Neubert <su...@onlinehome.de>.
Hello,

I've tried your patch and it worked! Thank you!

BUT:

There is another Problem which only occur in all 1.9.0 snapshots (4. ,  
7., 8. july), but NOT with 1.8.0 :

If I add in my Android Project in Eclipse the fileinstall.jar (1.2.0  
or current snapshot) to classpath while
having Felix 1.9.0 on classpath (as a referenced lib ) I get folling  
Error when Eclipse tries to build the project (right after adding)

-> this does not happen with Felix 1.8.0

-> I can add fileinstall.jar without problems if no felix.jar is added

-> if adding fileinstall.jar first, then adding felix.jar, the same  
problem occurs

-> problem also occurs in a completly fresh android project







UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lorg/osgi/service/ 
log/LogEntry;
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.dex.file.DexFile.add(DexFile.java:143)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.command.dexer.Main.processClass(Main.java:299)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.command.dexer.Main.access$100(Main.java:56)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com 
.android 
.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com 
.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java: 
130)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java: 
108)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.command.dexer.Main.processOne(Main.java:245)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.dx.command.dexer.Main.run(Main.java:139)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
sun 
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 
39)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
sun 
.reflect 
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 
25)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
java.lang.reflect.Method.invoke(Method.java:585)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown Source)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java: 
633)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org 
.eclipse 
.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org 
.eclipse 
.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java: 
253)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org 
.eclipse 
.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org 
.eclipse 
.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java: 
341)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org 
.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java: 
140)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 	at  
org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
[2009-07-08 11:34:48 - FelixEmbedAndroid] 1 error; aborting
[2009-07-08 11:34:48 - FelixEmbedAndroid] Conversion to Dalvik format  
failed with error 1



regards
Matthias





Am 07.07.2009 um 22:54 schrieb Richard S. Hall:

> Ok, I have committed a potential workaround as described here:
>
>    https://issues.apache.org/jira/browse/FELIX-1193
>
> If you could test again on trunk and respond on the issue that would  
> be great. Thanks!
>
> -> richard
>
> On 7/7/09 4:10 PM, Karl Pauls wrote:
>> Looks like a bug in android. Or at least it is something where sun
>> java behaves differently then dalvik/android. Anyways, we should be
>> able to workaround this. We will track this using FELIX-1193. Thanks
>> for letting us know!
>>
>> regards,
>>
>> Karl
>>
>> On Tue, Jul 7, 2009 at 7:42 PM, Matthias  
>> Neubert<su...@onlinehome.de>  wrote:
>>
>>> Hello,
>>>
>>> since nobody answered on my first mail (subject "Android + Felix  
>>> 1.80 =
>>> Problems")
>>> I took the long way and found the solution on my own. It took a  
>>> bit longer
>>> because I'm completely new to OSGi and felix.
>>>
>>> First the solution on that one thing, then the current bug:
>>>
>>> Solution:
>>> Felix 1.8.0 release doesn't have the patch for Android compatible
>>> Classloading ( before I thought it has it already), so in adb  
>>> shell the
>>> command "chmod 777 /data/dalvik-cache" has to be executed (which  
>>> shows us,
>>> that this will not work on a real phone)
>>>
>>> ->  with Felix 1.8.0 and the little "hack" it now runs and its  
>>> starting
>>> Bundles. This is the first step getting the outdated ipojo sample  
>>> running.
>>> May be some more work is left.
>>> ->  without the hack, systembundle and ipojo.annotations get  
>>> active, but for
>>> example shell, shelltui and iPojo remain resolved and doesn't start.
>>>
>>>
>>> Problem/Bug:
>>> occures when I try run Felix 1.9.0 Snapshot as embedded in an  
>>> Android
>>> Application.(same project as mentioned above, just switched  
>>> classpath to
>>> newer jar file)
>>> The access-rights-hack doesn't help here, so it must be a bug or  
>>> something
>>> like that.
>>>
>>> If someone is interested in this bug, I can send my eclipse  
>>> project, if
>>> needed
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Here is the stacktrace: (from DDMS Android Debugger)
>>>
>>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>>> Ljava/lang/RuntimeException; thrown during
>>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>>
>>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout has  
>>> expired,
>>> giving up wake lock!
>>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle  
>>> timeout for
>>> HistoryRecord{435f61b0
>>> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
>>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM
>>>
>>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread  
>>> exiting with
>>> uncaught exception (group=0x4000fe70)
>>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught handler:  
>>> thread
>>> main exiting due to uncaught exception
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>>> java.lang.ExceptionInInitializerError
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> org 
>>> .apache 
>>> .felix.framework.ExtensionManager.<init>(ExtensionManager.java:142)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> de 
>>> .mn 
>>> .felixembedand 
>>> .FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> android 
>>> .app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> android 
>>> .app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> android 
>>> .app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> android.os.Handler.dispatchMessage(Handler.java:99)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> android.os.Looper.loop(Looper.java:123)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> android.app.ActivityThread.main(ActivityThread.java:3948)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> java.lang.reflect.Method.invokeNative(Native Method)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> java.lang.reflect.Method.invoke(Method.java:521)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> com.android.internal.os.ZygoteInit 
>>> $MethodAndArgsCaller.run(ZygoteInit.java:782)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> dalvik.system.NativeStart.main(Native Method)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>> java.lang.RuntimeException: Problem creating boot delegation class  
>>> loader.
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:114)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>> java.lang.reflect.InvocationTargetException
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> java.lang.reflect.Constructor.constructNative(Native Method)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> org 
>>> .apache.felix.framework.util.SecureAction.invoke(SecureAction.java: 
>>> 862)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:109)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>>> java.lang.NullPointerException: Parent ClassLoader may not be null
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>>>
>>>
>>>
>>>
>>> My Config:
>>> Eclipse 3.4
>>> Android SDK 1.5r2
>>> ADT 0.91 (current)
>>> Java SDK: JVM 1.5.0 MacOS X
>>>
>>>
>>> regards
>>> matthias
>>>
>>
>>
>>
>>


Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Ok, I have committed a potential workaround as described here:

     https://issues.apache.org/jira/browse/FELIX-1193

If you could test again on trunk and respond on the issue that would be 
great. Thanks!

-> richard

On 7/7/09 4:10 PM, Karl Pauls wrote:
> Looks like a bug in android. Or at least it is something where sun
> java behaves differently then dalvik/android. Anyways, we should be
> able to workaround this. We will track this using FELIX-1193. Thanks
> for letting us know!
>
> regards,
>
> Karl
>
> On Tue, Jul 7, 2009 at 7:42 PM, Matthias Neubert<su...@onlinehome.de>  wrote:
>    
>> Hello,
>>
>> since nobody answered on my first mail (subject "Android + Felix 1.80 =
>> Problems")
>> I took the long way and found the solution on my own. It took a bit longer
>> because I'm completely new to OSGi and felix.
>>
>> First the solution on that one thing, then the current bug:
>>
>> Solution:
>> Felix 1.8.0 release doesn't have the patch for Android compatible
>> Classloading ( before I thought it has it already), so in adb shell the
>> command "chmod 777 /data/dalvik-cache" has to be executed (which shows us,
>> that this will not work on a real phone)
>>
>> ->  with Felix 1.8.0 and the little "hack" it now runs and its starting
>> Bundles. This is the first step getting the outdated ipojo sample running.
>> May be some more work is left.
>> ->  without the hack, systembundle and ipojo.annotations get active, but for
>> example shell, shelltui and iPojo remain resolved and doesn't start.
>>
>>
>> Problem/Bug:
>> occures when I try run Felix 1.9.0 Snapshot as embedded in an Android
>> Application.(same project as mentioned above, just switched classpath to
>> newer jar file)
>> The access-rights-hack doesn't help here, so it must be a bug or something
>> like that.
>>
>> If someone is interested in this bug, I can send my eclipse project, if
>> needed
>>
>>
>>
>>
>>
>>
>>
>> Here is the stacktrace: (from DDMS Android Debugger)
>>
>> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
>> Ljava/lang/RuntimeException; thrown during
>> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>>
>> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout has expired,
>> giving up wake lock!
>> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle timeout for
>> HistoryRecord{435f61b0
>> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
>> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM
>>
>> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread exiting with
>> uncaught exception (group=0x4000fe70)
>> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught handler: thread
>> main exiting due to uncaught exception
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
>> java.lang.ExceptionInInitializerError
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:142)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> org.apache.felix.framework.Felix.<init>(Felix.java:302)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> de.mn.felixembedand.FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> android.os.Handler.dispatchMessage(Handler.java:99)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> android.os.Looper.loop(Looper.java:123)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> android.app.ActivityThread.main(ActivityThread.java:3948)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> java.lang.reflect.Method.invokeNative(Native Method)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> java.lang.reflect.Method.invoke(Method.java:521)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> dalvik.system.NativeStart.main(Native Method)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>> java.lang.RuntimeException: Problem creating boot delegation class loader.
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:114)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>> java.lang.reflect.InvocationTargetException
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> java.lang.reflect.Constructor.constructNative(Native Method)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> org.apache.felix.framework.util.SecureAction.invoke(SecureAction.java:862)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:109)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
>> java.lang.NullPointerException: Parent ClassLoader may not be null
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> java.lang.ClassLoader.<init>(ClassLoader.java:239)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
>> java.lang.ClassLoader.<init>(ClassLoader.java:226)
>> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>>
>>
>>
>>
>> My Config:
>> Eclipse 3.4
>> Android SDK 1.5r2
>> ADT 0.91 (current)
>> Java SDK: JVM 1.5.0 MacOS X
>>
>>
>> regards
>> matthias
>>      
>
>
>
>    

Re: Found bug in current Felix 1.9.0 SNAPSHOT while run embedded in Android

Posted by Karl Pauls <ka...@gmail.com>.
Looks like a bug in android. Or at least it is something where sun
java behaves differently then dalvik/android. Anyways, we should be
able to workaround this. We will track this using FELIX-1193. Thanks
for letting us know!

regards,

Karl

On Tue, Jul 7, 2009 at 7:42 PM, Matthias Neubert<su...@onlinehome.de> wrote:
> Hello,
>
> since nobody answered on my first mail (subject "Android + Felix 1.80 =
> Problems")
> I took the long way and found the solution on my own. It took a bit longer
> because I'm completely new to OSGi and felix.
>
> First the solution on that one thing, then the current bug:
>
> Solution:
> Felix 1.8.0 release doesn't have the patch for Android compatible
> Classloading ( before I thought it has it already), so in adb shell the
> command "chmod 777 /data/dalvik-cache" has to be executed (which shows us,
> that this will not work on a real phone)
>
> -> with Felix 1.8.0 and the little "hack" it now runs and its starting
> Bundles. This is the first step getting the outdated ipojo sample running.
> May be some more work is left.
> -> without the hack, systembundle and ipojo.annotations get active, but for
> example shell, shelltui and iPojo remain resolved and doesn't start.
>
>
> Problem/Bug:
> occures when I try run Felix 1.9.0 Snapshot as embedded in an Android
> Application.(same project as mentioned above, just switched classpath to
> newer jar file)
> The access-rights-hack doesn't help here, so it must be a bug or something
> like that.
>
> If someone is interested in this bug, I can send my eclipse project, if
> needed
>
>
>
>
>
>
>
> Here is the stacktrace: (from DDMS Android Debugger)
>
> 07-07 19:02:31.133: WARN/dalvikvm(1187): Exception
> Ljava/lang/RuntimeException; thrown during
> Lorg/apache/felix/framework/ModuleImpl;.<clinit>
>
> 07-07 19:02:36.108: WARN/ActivityManager(600): Launch timeout has expired,
> giving up wake lock!
> 07-07 19:02:36.553: WARN/ActivityManager(600): Activity idle timeout for
> HistoryRecord{435f61b0
> {de.mn.felixembedand/de.mn.felixembedand.FelixEmbedAndStarter}}
> 07-07 19:02:36.858: DEBUG/AndroidRuntime(1187): Shutting down VM
>
> 07-07 19:02:36.858: WARN/dalvikvm(1187): threadid=3: thread exiting with
> uncaught exception (group=0x4000fe70)
> 07-07 19:02:36.864: ERROR/AndroidRuntime(1187): Uncaught handler: thread
> main exiting due to uncaught exception
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):
> java.lang.ExceptionInInitializerError
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:142)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> org.apache.felix.framework.Felix.<init>(Felix.java:302)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> de.mn.felixembedand.FelixEmbedAndStarter.onCreate(FelixEmbedAndStarter.java:77)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> android.os.Looper.loop(Looper.java:123)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> android.app.ActivityThread.main(ActivityThread.java:3948)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> dalvik.system.NativeStart.main(Native Method)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
> java.lang.RuntimeException: Problem creating boot delegation class loader.
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:114)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
> java.lang.reflect.InvocationTargetException
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> java.lang.reflect.Constructor.constructNative(Native Method)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> org.apache.felix.framework.util.SecureAction.invoke(SecureAction.java:862)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> org.apache.felix.framework.ModuleImpl.<clinit>(ModuleImpl.java:109)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 16 more
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187): Caused by:
> java.lang.NullPointerException: Parent ClassLoader may not be null
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> java.lang.ClassLoader.<init>(ClassLoader.java:239)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     at
> java.lang.ClassLoader.<init>(ClassLoader.java:226)
> 07-07 19:02:37.043: ERROR/AndroidRuntime(1187):     ... 21 more
>
>
>
>
> My Config:
> Eclipse 3.4
> Android SDK 1.5r2
> ADT 0.91 (current)
> Java SDK: JVM 1.5.0 MacOS X
>
>
> regards
> matthias



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org