• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Apache QPID on Android

 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to Android development. I am wondering if there is any message broker API can be used on Android platform.
I heard that Apache QPID java API can be used on Android platform. Is it true? Please help.


thanks
Benson
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


There used to be a commercial android jms broker available "iBus//Mobile" from the company "Softwired" a couple years ago,.. but it seems there are no longer any traces of that company or their product to be found.

Apache QPID cannot currently be used as is on the Android platform, because QPID extends jms classes.

JMS classes, along with JNDI are not provided by the Android platform out of the box because these classes are in the javax.* package -- which is large and poses versioning issues that Android releases avoid.

QPID has stated plans of supporting Android in a future QPID release.

To put QPID on Android by oneself, it would require finding out what the needed packages are by JMS,.. and extracting/re-bundling these packages, and putting them on Android.
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Chris Riffle wrote:
To put QPID on Android by oneself, it would require finding out what the needed packages are by JMS,.. and extracting/re-bundling these packages, and putting them on Android.


Unless I'm getting you wrong, this is totally wrong.
According to you, we can use many Java APIs like JDBC/EJB/JTA in an Android app.
 
Chris Riffle
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Android folks,

I'm trying to port: Apache Qpid Client, JMS and JNDI -- to Android. I'm able to get a successful compile/build of my QpidDroid project when running the ant debug install targets after passing Dalvik the --core-library parameter to allow javax packages for JMS/JNDI.

I think this is legally legit because I'm using the old/first seperate JNDI jar currently provided by Oracle's website. I'm using the JMS jar that comes with Apache Geronimo in Qpid,.. but I think it's also available from Oracle as a seperate download. My dev environment uses Android platform 2.1 and jdk 1.6.

The problem is, it seems it currently cannot instantiate my custom jndi connection factory: PropertiesFileInitialContextFactory. This is a .java source file in my QpidDroid project(not a .class in a libs jar) (I extracted the class out of the qpidClient jar). Would someone have any idea as to why it cannot be instantiated here? I was wondering if proguard might be breaking reflection,... but I'm building it with the debug ant task,.. so I'm thinking proguard shouldn't be running at all.

The exception occurs when I run the installed app on the emulator.


01-18 18:05:16.966: W/System.err(296): [Root exception is java.lang.ClassNotFoundException: org.apache.qpid.jndi.PropertiesFileInitialContextFactory]javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.qpid.jndi.PropertiesFileInitialContextFactory
01-18 18:05:17.006: W/System.err(296): at javax.naming.spi.NamingManager.getDefaultInitialContextFactory(NamingManager.java:720)
01-18 18:05:17.006: W/System.err(296): at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:768)
01-18 18:05:17.016: W/System.err(296): at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:169)
01-18 18:05:17.016: W/System.err(296): at javax.naming.InitialContext.<init>(InitialContext.java:146)
01-18 18:05:17.016: W/System.err(296): at org.rif.QpidDroid.Hello.runTest(Hello.java:56
)


Thanks for any tips!
 
Chris Riffle
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I found the problem -- Android has bugs in it with Reflection prior to version 2.3

http://code.google.com/p/android/issues/detail?id=6636

I ported my QpidDroid project to Android 2.3 and it looks like JNDI is successfully creating the InitialContext now with the QPID connection params
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic