Hi,

I have been trying to get JiBX running on RIM/BlackBerry platform (by
using the J2ME target since BB accept MIDlet/J2ME app.)  But I think
my limited skills have failed me.  I will share what I have done and
some results.  Hopefully someone can shad a light on this before I
must move on.  I am doing my development on windows with Eclipse 3.4,
Java 1.6 and BlackBerry JDE 4.6.

As outlined in my comment here:
http://jira.codehaus.org/browse/JIBX-110

I tried building JiBX to the j2me target with the given Ant script but
no success, but I did get something by going through the build step
manually.

I then proceed to build a trial app in BB similar to the starter app.
The binding compiler was successful in modifying the class files with
the following feedbacks:

Using paths:
 jibx-j2me-bind.jar
 bcel.jar
 jibx-j2me-run.jar
 xpp3.jar
 stax-api.jar
 wstx-asl.jar
 .
Using bindings:
 binding.xml
Running binding compiler version jibx_1_1_6a
binding binding:
 context (mp#=1) (cv#=0) (fm#=0)
  mapping class BBExample.Customer to element customer (#0)
   context (cv#=0) (fm#=0)
   element wrapper customer
    object binding for BBExample.Customer create class BBExample.Customer
     structure ordered
      element wrapper person
       component property person (BBExample.Person)
        object binding for BBExample.Person create class BBExample.Person
         structure ordered
          element cust-num from property customerNumber (int)
          element first-name from property firstName (java.lang.String)
          element last-name from property lastName (java.lang.String)
      element street from property street (java.lang.String)
      element city from property city (java.lang.String)
      element state from property state (java.lang.String)
      element zip from property zip (java.lang.Integer)
      element phone from property phone (java.lang.String)
Generating code for mapping BBExample.Customer

Wrote 4 files

 BBExample.Customer output file size is 4244 bytes

 BBExample.Person output file size is 2187 bytes

 BBExample.JiBX_bindingCustomer_access output file size is 1818 bytes

 BBExample.JiBX_bindingFactory output file size is 2568 bytes

Kept 0 files unchanged:

Deleted 0 files:

And the modified file was successfully packaged into a .cod file using
blackberry rapc compiler.  (A quick note on cod file and rapc here:
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800738/800901/How_To_-_Use_the_RAPC_compiler.html?nodeid=800818&vernum=0)

But then, when I tried to convert the jar files (jibx-j2me-run.jar and
xpp3.jar) into cod, I was not successful and I get the following
error:
java.util.Comparator: Warning!: No definition found
org.jibx.runtime.EnumSet$1: Warning!: Implements undefined interface:
java.util.Comparator
java.util.Iterator: Warning!: No definition found
org.jibx.runtime.impl.ArrayRangeIterator: Warning!: Implements
undefined interface: java.util.Iterator
java.util.ArrayList: Warning!: No definition found
java.util.HashMap: Warning!: No definition found
org.jibx.runtime.impl.SparseArrayIterator: Warning!: Implements
undefined interface: java.util.Iterator
javax.xml.stream.XMLInputFactory: Warning!: No definition found
javax.xml.stream.XMLStreamReader: Warning!: No definition found
javax.xml.stream.XMLStreamWriter: Warning!: No definition found
java.lang.Cloneable: Warning!: No definition found
org.xmlpull.mxp1.MXParserCachingStrings: Warning!: Implements
undefined interface: java.lang.Cloneable
java.lang.Class: Warning!: No definition found for method: getDeclaredField
java.lang.reflect.Field: Warning!: No definition found
org.jibx.runtime.BindingDirectory: Warning!: Reference to undefined class: java.
lang.reflect.Field
org.jibx.runtime.BindingDirectory: Error!: Missing stack map at label: 15

When I did this step, I imported most of the jar file from JiBX lib
(except xmlpull1_1_4 and stax-api.jar because it generate duplicate
definition error with javax.xml.namespace.QName) and the blackberry
library file.  With my limited knowledge in this area (EE by
training), I am not sure what to do next.  The "No definition found"
may indicate that the j2me target build was indeed faulty (I don't
think J2ME support things like HashMap and Iterator...)... and I
really have no clue what the Missing stack map means.

That's all I've got.  Hopefully some of you expert out there can give
some insight into this.  From what I've read in the last few days,
JiBX sounds perfect for the mobile applications.  I'd hate to give up
on this and go back to SAX based stuff.

Regards,
Kenny Ho

------------------------------------------------------------------------------
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to