Sunday, December 5, 2010

Using Scomp

I'm working on a project that deals with XMPP information. I'm using xmlbeans scomp to compile xsd files into java classes. I got the source code to work, but scomp failed to generate a jar file. I got the error described by Three Wise Men and Celinio Fernandes. I'm working on Windows XP.

With the scomp src I built an Eclipse project and could build against it, but got this run time exception:
ClassNotFoundException : Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s68C41DB812F52C975439BA10FE4FEE54
In trying to solve it I learned to use javac from the command line (I have only used the Eclipse JDE until now.) I installed Ant (I thought there was a dependency) and learned to use. I learned how to produce a jar in Eclipse. None of these solved the problem.

Three Wise Men set me on the right track. The problem is a space in the javac path. Three Wise Men fix it by using scomp's -compiler option. However, for me, scomp still choked on the space. So I found out about junction (see Wikipedia). I used junction to make Program-Files link to Program Files (skip the md step in the junction example). Put the hypen in my JAVA_HOME and path. Still scomp failed to make jar. Finally used compiler option with hypen and it worked. Added jar to my build path in Eclipse and finally my project ran correctly.

Whew! Lotta work just for that.

No comments:

Post a Comment