Ok, I'm now using 2.0.3 on the Nexus. I've downloaded the jar for HTTP Service
Jetty 2.0.4 from the Felix site, and have dexified it as follows:
$ dx -JXms1024M -JXmx2048M --dex --output=classes.dex
org.apache.felix.http.jetty-2.0.4.jar
$ aapt add org.apache.felix.http.jetty-2.0.4.jar classes.dex
I’ve transferred the bundle to tha handset, and then I start the framework:
# sh felix.sh
Welcome to Felix
================
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Problem creating boot delegation class loader:
java.lang.reflect.InvocationTargetException
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:28 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
DEBUG: WIRE: 1.0 -> org.osgi.service.startlevel -> 0
DEBUG: WIRE: 1.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 1.0 -> org.osgi.service.packageadmin -> 0
DEBUG: WIRE: 2.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 2.0 -> org.apache.felix.shell -> 1.0
Feb 15, 2010 11:26:28 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
-> ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (2.0.3)
Feb 15, 2010 11:26:30 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
[ 1] [Active ] [ 1] Apache Felix Shell Service (1.0.2)
Feb 15, 2010 11:26:30 AM java.io.BufferedReader <init>
INFO: Default buffer size used in BufferedReader constructor. It would be
better to be explicit if an 8k-char buffer is required.
[ 2] [Active ] [ 1] Apache Felix Shell TUI (1.0.2)
-> install file:bundle/org.apache.felix.http.jetty-2.0.4.jar
Feb 15, 2010 11:26:38 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:38 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:38 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:39 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:39 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Feb 15, 2010 11:26:39 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
Bundle ID: 4
-> ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (2.0.3)
[ 1] [Active ] [ 1] Apache Felix Shell Service (1.0.2)
[ 2] [Active ] [ 1] Apache Felix Shell TUI (1.0.2)
[ 4] [Installed ] [ 1] Apache Felix Http Jetty (2.0.4)
-> start 4
Feb 15, 2010 11:26:45 AM java.io.BufferedWriter <init>
INFO: Default buffer size used in BufferedWriter constructor. It would be
better to be explicit if an 8k-char buffer is required.
DEBUG: WIRE: 4.0 -> javax.xml.parsers -> 0
DEBUG: WIRE: 4.0 -> org.xml.sax -> 0
DEBUG: WIRE: 4.0 -> javax.security.cert -> 0
DEBUG: WIRE: 4.0 -> org.osgi.util.tracker -> 0
DEBUG: WIRE: 4.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 4.0 -> javax.net.ssl -> 0
DEBUG: WIRE: 4.0 -> org.xml.sax.helpers -> 0
org.osgi.framework.BundleException: Activator start error in bundle
org.apache.felix.http.jetty [4].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1803)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1678)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:892)
at
org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:82)
at
org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:276)
at
org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:167)
at java.lang.Thread.run(Thread.java:1096)
Caused by: java.lang.NoClassDefFoundError:
org.apache.felix.http.base.internal.logger.LogServiceLogger
at
org.apache.felix.http.base.internal.AbstractActivator.start(AbstractActivator.java:39)
at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:661)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1756)
... 7 more
java.lang.NoClassDefFoundError:
org.apache.felix.http.base.internal.logger.LogServiceLogger
->
I’ve exploded the org.apache.felix.http.jetty jar file, so I can see the class
is certainly there. This is why I assumed that this was a compiler issue,
whereby dx was ignorning certain classes. Any ideas?
Thanks
Bruce
On 12/02/2010 22:08, "Karl Pauls" <[email protected]> wrote:
> Well, the first thing to try is to use the latest version of felix.
> You are using 1.4.0 which for sure had a lot of not addressed issues
> on android. I fixed a couple of bugs and reimplemented all of the
> classloading in later versions. My guess would be that this is your
> problem and not some compiler thing. Can you try with felix 2.0.2 and
> 2.0.3 plus get me the logcat output if it doesn't work?
>
> regards,
>
> Karl
>
> On Fri, Feb 12, 2010 at 5:27 PM, Jackson, Bruce <[email protected]> wrote:
>> I've got the Felix framework installed on my Nexus. If I download the
>> org.apache.felix.http.jetty-2.0.4.jar bundle from the Felix site, dx it
>> (which generates piles of warnings) push it to the phone, start Felix and
>> then install the jetty bundle, Felix just hangs:
>>
>> -> ps
>> START LEVEL 1
>> ID State Level Name
>> [ 0] [Active ] [ 0] System Bundle (1.4.0)
>> [ 1] [Active ] [ 1] Apache Felix Shell Service (1.0.2)
>> [ 2] [Active ] [ 1] Apache Felix Shell TUI (1.0.2)
>> [ 3] [Active ] [ 1] JDOM (1.0.0.v200803070505)
>> -> install file:bundle/org.apache.felix.http.jetty-2.0.4.jar
>> Feb 12, 2010 4:15:03 PM java.io.BufferedWriter <init>
>> INFO: Default buffer size used in BufferedWriter constructor. It would be
>> better to be explicit if an 8k-char buffer is required.
>> Feb 12, 2010 4:15:03 PM java.io.BufferedWriter <init>
>> INFO: Default buffer size used in BufferedWriter constructor. It would be
>> better to be explicit if an 8k-char buffer is required.
>> Feb 12, 2010 4:15:03 PM java.io.BufferedWriter <init>
>> INFO: Default buffer size used in BufferedWriter constructor. It would be
>> better to be explicit if an 8k-char buffer is required.
>> Feb 12, 2010 4:15:04 PM java.io.BufferedWriter <init>
>> INFO: Default buffer size used in BufferedWriter constructor. It would be
>> better to be explicit if an 8k-char buffer is required.
>> Feb 12, 2010 4:15:04 PM java.io.BufferedWriter <init>
>> INFO: Default buffer size used in BufferedWriter constructor. It would be
>> better to be explicit if an 8k-char buffer is required.
>> Feb 12, 2010 4:15:04 PM java.io.BufferedWriter <init>
>> INFO: Default buffer size used in BufferedWriter constructor. It would be
>> better to be explicit if an 8k-char buffer is required.
>> Bundle ID: 5
>> -> ps
>> START LEVEL 1
>> ID State Level Name
>> [ 0] [Active ] [ 0] System Bundle (1.4.0)
>> [ 1] [Active ] [ 1] Apache Felix Shell Service (1.0.2)
>> [ 2] [Active ] [ 1] Apache Felix Shell TUI (1.0.2)
>> [ 3] [Active ] [ 1] JDOM (1.0.0.v200803070505)
>> [ 5] [Installed ] [ 1] Apache Felix Http Jetty (2.0.4)
>> -> start 5
>> Feb 12, 2010 4:15:08 PM java.io.BufferedWriter <init>
>> INFO: Default buffer size used in BufferedWriter constructor. It would be
>> better to be explicit if an 8k-char buffer is required.
>> DEBUG: WIRE: 5.0 -> javax.xml.parsers -> 0
>> DEBUG: WIRE: 5.0 -> org.xml.sax -> 0
>> DEBUG: WIRE: 5.0 -> javax.servlet.resources -> 5.0
>> DEBUG: WIRE: 5.0 -> javax.servlet -> 5.0
>> DEBUG: WIRE: 5.0 -> javax.security.cert -> 0
>> DEBUG: WIRE: 5.0 -> org.osgi.util.tracker -> 0
>> DEBUG: WIRE: 5.0 -> org.osgi.framework -> 0
>> DEBUG: WIRE: 5.0 -> javax.servlet.jsp.resources -> 5.0
>> DEBUG: WIRE: 5.0 -> javax.net.ssl -> 0
>> DEBUG: WIRE: 5.0 -> org.xml.sax.helpers -> 0
>> DEBUG: WIRE: 5.0 -> org.osgi.service.http -> 5.0
>> DEBUG: WIRE: 5.0 -> org.apache.felix.http.api -> 5.0
>> DEBUG: WIRE: 5.0 -> javax.servlet.http -> 5.0
>>
>> At this point, I have to CTRL-C to kill Felix. The same thing happened before
>> I compiled JDOM with 1.5+. I might be missing something, but my assumption,
>> perhaps wrong, was that it was the compiler version that was causing this
>> behavior?
>>
>> Thanks
>>
>> Bruce
>>
>>
>>
>>
>>
>>
>> On 12/02/2010 15:51, "Clement Escoffier" <[email protected]> wrote:
>>
>>>
>>> On 12.02.2010, at 16:45, Jackson, Bruce wrote:
>>>
>>>> Whenever you dx a bundle which has been built with a pre-1.5 compiler you
>>>> will usually get a pile of:
>>>>
>>>> warning: Ignoring InnerClasses attribute for an anonymous inner class that
>>>> doesn't come with an associated EnclosingMethod attribute. (This class was
>>>> probably produced by a broken compiler.)
>>>>
>>>> ...messages (assuming that you do use inner classes in the bundle). These
>>>> are generated because the bundle was compiled with a pre-1.5 compiler. With
>>>> something like the org.jdom bundle, the bundle will not work correctly if
>>>> it
>>>> was compiled with a pre-1.5 compiler and then dx-ed, while using a post-1.5
>>>> it does.
>>>>
>>>> It may a be a broad assessment of the situation, but I took this experience
>>>> to indicate that it was required to build bundles with a post-1.5 compiler.
>>>> Indeed if you look around the web, you'll see this warning mentioned in
>>>> relation to a number of problems people are having with getting apps
>>>> running
>>>> on Android, when using JARs that were compiled pre-1.5.
>>>
>>> Well, you got less messages if you compile with 1.5+, but that's does say
>>> that
>>> a bundle will not work.
>>> When dexifying iPOJO, I have a couple of message too, but the complete iPOJO
>>> test suite works on Android (except some features using on the fly bytecode
>>> generation).
>>>
>>> Regards,
>>>
>>> Clement
>>>
>>>
>>>
>>>>
>>>> Thanks
>>>>
>>>> Bruce
>>>>
>>>> On 12/02/2010 15:25, "Karl Pauls" <[email protected]> wrote:
>>>>
>>>>> On Fri, Feb 12, 2010 at 4:22 PM, Jackson, Bruce <[email protected]>
>>>>> wrote:
>>>>>> I'm taking here about the ad-on bundles (like http, for example) rather
>>>>>> than
>>>>>> the framework. The dx tool needs to have classes that were compiled with
>>>>>> >>>>>> a
>>>>>> "new" compiler (i.e. greater than 1.5).
>>>>>
>>>>> Since when? Always worked for me. Again, the framework itself is
>>>>> compiled for 1.3...
>>>>>
>>>>> regards,
>>>>>
>>>>> Karl
>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Bruce
>>>>>>
>>>>>>
>>>>>> On 12/02/2010 13:33, "Karl Pauls" <[email protected]> wrote:
>>>>>>
>>>>>>> Why would you need 1.5 to be able to dex the bundle (the framework
>>>>>>> itself is build for 1.3 btw.)?
>>>>>>>
>>>>>>> regards,
>>>>>>>
>>>>>>> Karl
>>>>>>>
>>>>>>> On Fri, Feb 12, 2010 at 1:15 PM, Jackson, Bruce <[email protected]>
>>>>>>> wrote:
>>>>>>>> Hi Pablo
>>>>>>>>
>>>>>>>> See the attached code. The biggest problem I've encountered is that the
>>>>>>>> Felix distribution is a huge pain to build under JDK 1.5, and therefore
>>>>>>>> to
>>>>>>>> be able to use some of the bundles (for example the http service) that
>>>>>>>> are
>>>>>>>> part of the distribution. Its not a simple job of just changing a
>>>>>>>> couple
>>>>>>>> of
>>>>>>>> entries in POM files: some components download pre-built JAR files from
>>>>>>>> the
>>>>>>>> web and explode these, thereby having classes built under 1.4 which
>>>>>>>> will
>>>>>>>> not
>>>>>>>> work when you dexify the bundles.
>>>>>>>>
>>>>>>>> This is something that would be great to see some work done on by the
>>>>>>>> Felix
>>>>>>>> community, because while its true that the basic Felix core does and
>>>>>>>> will
>>>>>>>> support Android, most of the add-on bundles wont.
>>>>>>>>
>>>>>>>> For my part, the ideal solution would be to see the whole framework be
>>>>>>>> based
>>>>>>>> on JDK 1.5 and not 1.4.
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> Bruce
>>>>>>>>
>>>>>>>>
>>>>>>>> On 12/02/2010 11:32, "pablomj" <[email protected]> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi Bruce, I am trying the same, but I don't have the solution yet.
>>>>>>>>> Do you have some advance?
>>>>>>>>> Salutations, thanks.
>>>>>>>>> Pablo.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Jackson, Bruce wrote:
>>>>>>>>>>
>>>>>>>>>> The Felix site has a useful section on getting things going on
>>>>>>>>>> Android >>>>>>>> (
>>>>>>>>>> http://felix.apache.org/site/apache-felix-and-google-android.html)
>>>>>>>>>> but
>>>>>>>>>> isn't
>>>>>>>>>> so clear about embedding the framework into an Android app"
>>>>>>>>>>
>>>>>>>>>> "Apache Felix can also be integrated with an Android application. To
>>>>>>>>>> achieve
>>>>>>>>>> this, you need to embed Felix into onCreate() method of your Activity
>>>>>>>>>> class
>>>>>>>>>> (see Android docs for more details on how to use an Activity) and
>>>>>>>>>> process
>>>>>>>>>> your bundles as shown above."
>>>>>>>>>>
>>>>>>>>>> Has anyone got an example of how you do this? I understand how to
>>>>>>>>>> write
>>>>>>>>>> the
>>>>>>>>>> Android app, and I get the point being made here. What I need to
>>>>>>>>>> understand
>>>>>>>>>> is:
>>>>>>>>>>
>>>>>>>>>> 1. How do you launch the Felix framework. What do I need to
>>>>>>>>>> instantiate?
>>>>>>>>>> 2. Where does the framework get its boot configuration (i.e. what
>>>>>>>>>> bundles
>>>>>>>>>> to
>>>>>>>>>> load, run levels, environment variables, etc) from in this case?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
>