Classloading control

Put your problem here if it does not fit any of the other categories.

Classloading control

Postby mikeottinger » Fri Jan 11, 2008 6:05 pm

Hello, my android application is using a thirdparty api that uses a version of org.w3c.dom.Document that contains a normalizeDocument() method. The version of this class that Android references doesn't contain this method, so running it within Android I get a NoSuchMethodError. How do I inform Android that I'd like it to use a version of the class with this method in it? In a typical application server there are ways to provide your own classes to the classloader, anything equivalent in Android? Thanks!
mikeottinger
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Jan 11, 2008 6:00 pm

Top

Postby ravis » Mon Jan 14, 2008 3:26 am

I've had trouble with this same exact thing. This is what I've tried thus far:

I avoid errors in my eclipse environment because I include a xml-utils.jar downloaded from the Apache Commons ( http://apache.hoxt.com/xml/commons/xml- ... 04-bin.zip ). The Document class in this jar file obviously has a normalizeDocument method. From what I've read, all included "external jars" do get rolled into the final package that is sent to the emulator. However, the class-loading order is not specified anywhere, which causes the native android API's Document class to be used. In the configure build path screen where libraries are included, there is a tab for Order and Export which is normally used rank native libraries lower or higher than particular libraries as needed. However, from my attempts of moving the xml-apis.jar up all the way to the top in order to indicate that it should be used to resolve before android's native libraries are used (android.jar). Unfortunately, this didn't work for me either. You should try this in your scenario and see what happens. Please let me know if you ended finding a way to solve this problem.

Can anyone help in solving this problem? Please?
ravis
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Jan 14, 2008 3:10 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 15 guests