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? >>>>>>>> >>>>>>>> >>>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >
