Hi Lookman,

Its good that you're keeping your weekly updates. Don't get discouraged, I
also experienced severe difficulties with running Tuscany SCA on Android.
Please see comments inline below.

On Tue, Jun 2, 2009 at 11:48 PM, lookman sanni <[email protected]> wrote:

>  Hi.I'm back again with my weekly progress. Not easy at all to write after
> each week, and i hope i won't soon give up.
>
> Stage 2 Running Tuscany SCA from Android
>
> Running the existing version of calculator-android fires the following
> error in the android Logcat:
>
> 05-31 06:12:43.478: ERROR/dalvikvm(1261): Could not find method
> javax.xml.stream.XMLInputFactory.newInstance, referenced from method
> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain
> .createDeploymentComposite
> 05-31 06:12:43.498: ERROR/AndroidRuntime(1261): Uncaught handler: thread
> main exiting due to uncaught exception
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): java.lang.VerifyError:
> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> org.apache.tuscany.sca.host.embedded.SCADomain
> .createNewInstance(SCADomain.java:183)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> org.apache.tuscany.sca.host.embedded.SCADomain
> .newInstance(SCADomain.java:63)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> calculator.android.CalculatorClient.onCreate(CalculatorClient.
> java:183)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.
> java:1123)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.
> java:2231)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> android.os.Looper.loop(Looper.java:123)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> android.app.ActivityThread.main(ActivityThread.java:3948)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> java.lang.reflect.Method.invoke(Method.java:521)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> 05-31 06:12:43.528: ERROR/AndroidRuntime(1261): at
> dalvik.system.NativeStart.main(Native Method)
>
> Regarding my experience with Abdera, the tweakings i performed with the
> calculator-android, and the openness of android, i suggest these:
>
>    - Creating an eclipse workspace for tuscany’s projects on which the
>    calculator-android depends on;
>
>
This is a good idea, at least for the initial debugging and testing. On the
project threads from last year you will find some discussion about putting
stuff only on Eclipse. For now, I think this is the best approach,
afterwards we can look into it in more detail.

>
>    -
>    - Replacing their references to the JRE library by another reference
>    but to Android Library (android.jar)
>
> This is good, as long as you don't change things in a way that a normal
Android user won't be able to "run Tuscany" out of the box. Keep in mind
this is only my opinion, I would encourage you to approach the problem in a
way you find best. For example, it might be a good idea for testing, and
after you find out that it works you might consider taking steps to make it
run in a more straightforward way.

>
>    -
>    - Replacing all references to external jars by relevant projects source
>    code. I first thought that checking out those projects in the workspace 
> will
>    be ok but as they include android’s native packages namespace (ex:
>    javax.xml), they’ll surely for security reason will be rejected at launch 
> by
>    android (java.lang.verifyError exceptions). I guess the solution now will 
> be
>    to rebuild the android.jar with the sources of these projects.
>
> The same comment applies here, I wouldn't change things in a way that a
normal Android user won't be able to "run Tuscany" out of the box, or at
least in a very easy way. Again, it might be good for initial testing and
debugging.


>
>    -
>
>    I’ve listed projects that should be included in the calculator-android
>    build path, and create a new workspace with’em and the calculator-android
>    project.
>
>    tuscany-assembly
>    tuscany-assembly-xml
>    tuscany-assembly-xsd
>    tuscany-binding-sca
>    tuscany-binding-sca-xml
>    tuscany-contribution
>    tuscany-contribution-impl
>    tuscany-contribution-java
>    tuscany-contribution-namespace
>    tuscany-contribution-xml
>    tuscany-core
>    tuscany-core-databinding
>    tuscany-core-spi
>    tuscany-databinding
>    tuscany-databinding-jaxb
>    tuscany-definitions
>    tuscany-definitions-xml
>    tuscany-endpoint
>    tuscany-extensibility
>    tuscany-host-android(embedded)
>    tuscany-implementation-java
>    tuscany-implementation-java-runtime
>    tuscany-implementation-java-xml
>    tuscany-implementation-node
>    tuscany-interface
>    tuscany-interface-java
>    tuscany-interface-java-jaxws
>    tuscany-interface-java-xml
>    tuscany-monitor
>    tuscany-node-api
>    tuscany-node-impl
>    tuscany-policy
>    tuscany-policy-xml
>    tuscany-policy-xml-ws
>    tuscany-sca-api
>    tuscany-sca-api-extensions
>    tuscany-workspace
>    tuscany-workspace-impl
>    tuscany-workspace-xml
>    tuscany-xsd
>
>    I then build a list of the needed jars, and have started downloading
>    their source code. Here are the concerned projects:
>
>    easymock-2.4 --ok
>    axiom-api-1.2.7 --ok
>    axiom-impl-1.2.7 --ok
>    commons-logging-1.1.1 --ok
>    geronimo-activation_1.1_spec-1.0.1 --ok
>    geronimo-javamail_1.4_spec-1.2 --ok
>    geronimo-stax-api_1.0_spec-1.0.1 --ok
>    jaxen-1.1.1 --ok
>    junit-4.5 --ok
>    neethi-2.0.4 --ok
>    stax-api-1.0-2 --ok
>    wstx-asl-3.2.4 --ok
>    activation-1.1 --ok
>    cglib-nodep-2.2 --ok
>    jaxb-api-2.1 --ok
>    jaxws-api-2.1 --ok
>    XmlSchema-1.4.2 --ok
>    jaxb-impl-2.1.7 --ok
>    asm-all-3.1 --ok
>    groovy-all-minimal-1.5.4 --ok
>    jsr-181-api-1.0
>    jsr250-api-1.0
>    jdk tools (com.sun...)
>
>    *Projects for which i already have sources (svn, cvs, zip & jnlp
>    download), are marked “ok”. *
>
>    It just dawned on me that these projects may also have references to
>    some jars files. It’s going to be harder then i think. Uploading all these
>    projects into my workspace and resolving their dependencies by getting 
> their
>    sources too won’t be easy at all.
>
> I completely agree. As I mentioned on a previous thread:

===>
This year at ApacheCon Europe there was a presentation by Marcel Offermans
and Christian van Spaandonk, about getting Apache Felix running on Android.
Here's an excerpt of what they said about getting Felix to run on Android:

   - "When Android was first released, the first problem was getting Felix
   to run ... even without any bundles, just the plain framework. The framework
   is pretty portable by itself, so that wasn't too hard to do. The hard part
   started when we wanted to actually dynamically deploy bundles. That didn't
   work at first, because these bundles only contain OSGi Java code, and we
   somehow had to dex'ify these bundles and then try and load these dex'ified
   classes. And there wasn't and still isn't an API to officially do that."


   - "...but, well, specifically I remember on a Friday evening was a little
   after 10 o'clock - found a way of doing that. So when we did that we
   immediately started to write a blog about that and it spread like wildfire,
   and in no time everybody was running this out. And actually we figured out
   the fix was pretty easy, so we even embedded that as part of Felix. So if
   you download Felix right now, you can just deploy it on Android, and it
   will run."

I believe the blog Marcel was talking about is found in [2]. Hopefully it'll
be helpful to get SCA running on Android. We can also try to contact him on
the Felix mailing list to get more help if needed.

[1] http://felix.apache.org/site/apache-felix-and-google-android.html
<====

I would recommend that you make a post on the Felix mailing list. You can
tell about your efforts and ask for help or suggestions. You might also want
to mention Marcel's talk and try to make a connection to your efforts.

>
>
>    Later i’ll add those projects sources to android sources and perform a
>    “make sdk”. I hope to have then an “Tuscanily” operational android.jar.
>
>    *Questions:*
>    - Can anyone give help on how to have the jsr listed above
>       implementation sources?
>       - In which directory exactly and how should i organize those source
>       files in android sources directory to get them built in the new 
> android.jar?
>       - Is there anyway rebuilding android.jar, using some jar files? Some
>       may say that i’m lazy ;.) but!!!!!
>
> At the moment I don't have any idea about these questions. Try to look it
up on the Android documentation, if you don't find it make a post about it
on the Android mailing list. If I find something useful I'll let you know.

Good luck, and keep up your good progress!


>
>
> --
> Best Regards
>
> Lookman SANNI
> http://blog.lookouster.org
> MSBI Intern at Umanis Tours Services;
>



-- 
best,
-oscar

Oscar Castañeda
http://people.apache.org/~ocastaneda<http://people.apache.org/%7Eocastaneda>

Reply via email to