Hi Kenny, I haven't used JiBX in a J2ME environment myself. You've seen the discussion of J2ME on the Jira issue at http://jira.codehaus.org/browse/JIBX-110 From the original comments I thought the only problem was the use of java.sql classes, and I eliminated those for 1.1 using the the code modifications done by the enablej2me target.
From your report in this email there are several other problem classes, at least in the current code. You might want to try going back to the 1.1 release code to see if the problem classes were also present then, or if they've all been added since that time. But I would also like to get this working again for J2ME, if it's possible to do so without a lot of work. It looks like I'd need to replace ArrayList with Vector and HashMap with Hashmap within the org.jibx.runtime classes, and probably eliminate a couple of the other classes from the J2ME build. You'd then need to use the kXML2 implementation of the XMLPull parser interface (http://kxml.sourceforge.net/), replacing xpp3.jar with the corresponding jar from the kXML distribution. If you're still interested in giving this a try let me know via a direct email. I'll make the changes to the code and work with you to resolve any problems. - Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Yu Yeung Ho wrote: > 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 > > ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users