Skip to main content

XMLParser integration problems

4 replies [Last post]
jjjaime
Offline
Joined: 2008-03-12
Points: 0

I need XML support for a phoneMe Advanced to be deployed in a Windows Mobile device. I've tried to integrate the xmlparser:
https://phoneme.dev.java.net/source/browse/phoneme/components/xmlparser

Today I've downloaded the source code for the cdc, tools and xmlparser projects from the trunk. I've compiled it according to the instructions of the phoneMe site. I've included an additional parameter to integrate the xmlparser: USE_XMLPARSER=true, but I'm not sure if it's enough. The complete build file is:

make JDK_HOME=C:/java/sdk1.4 J2ME_CLASSLIB=foundation CVM_JIT=true CVM_PRELOAD_LIB=true USE_JPEG=true USE_XMLPARSER=true

The compilation was successful but when I tested my application again, I still get an exception:
java.lang.NoClassDefFoundError: javax.xml.parsers.ParserConfigurationException

What's the problem? How can I know if the XML classes (of the xmlparser project) are integrated in the binary files? Do I need other optional projects in order to include xmlparser?

Thank you very much in advance,
Jaime

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cjplummer
Offline
Joined: 2006-10-16
Points: 0

The following simple test case works for me (sorry in advance for the format butchering I know is going to happen):

public class XMLTest {
public static void main(String[] args) throws Throwable {
throw (Throwable)(new javax.xml.parsers.ParserConfigurationException("it worked"));
}
}

After the build, you should have lib/xmlparser.jar files. If you don't something went wrong.

BTW, I initially got build failures because the xmlparser makefiles don't properly trigger the build of Jpp first. I guess no one noticed this before because usually xmlparser gets build along with other components the force Jpp to get build. I fixed this build problem by having the rules in xmlparser/build/share/rules.gmk the call runjpp depend on $(JPP_CLASS_FILES). Did you see this problem? If not, I suspect you didn't build properly.

jjjaime
Offline
Joined: 2008-03-12
Points: 0

Thank you for your reply.

I did so many attempts (with different results) that I didn´t pay attention to every error message. But certainly, I found several times the JPP error that you've commented. But it didn´t happen always, so I didn´t consider it as relevant.

I've tried to fix it with your hint, but I lack this expertise and I don´t know how to add this dependency. Would you mind to explain it a bit more or to attach the rules.gmk file?

Thank you very much,
Jaime

cjplummer
Offline
Joined: 2006-10-16
Points: 0

I don't want to paste my modified rules.gmk because the forum will mess up the formatting, which will cause the makefile to no longer work. For the first 3 rules in rules. gmk, just add $(JPP_CLASS_FILES) right after the ':'

jjjaime
Offline
Joined: 2008-03-12
Points: 0

Thank you cjplummer,
Now it works.