A little bit more...

Friday, April 15, 2005

XMLBeans Practice--Automate Exchanging data between XML's & Java (1)

Installation of XMLBEANS
I hope this section can help solve your problems, if not all, encountered when installing XMLBEANS. XMLBEANS installation is hard to deal with and I think most of people will encounter problems when installing it and I'm not an exception.
The XMLBEANS(here it's 2.0.0-beta1) binary archive package, by convention, contains directories, bin, docs, lib, etc. And you'll have to set your path and classpath just like installing other java tools. But after that I think 90% people can't run XMLBEANS correctly. There're some points to notice and I hope your encountering problems are listed below (OS:WIN XP SP2) :

  • About your jdk directory. My jdk directory is under the "Program Files" directory. And when I run XMLBEANS with "scomp...." in the command line prompt, errors saying roughly like this(on my PC erro message is in Chinese): "'E:\program' is not a internal or external command, neither is it a executable or a batch file." This error message reminded me of the caution information I read when I was installing Weblogic 8.1. The information said "Don't leave a white space in your weblogic path, for it may cause severe problems". Since both of XMLBEANS and Weblogic are produced by BEA. So I move my "JAVA_HOME" to the root directory of one of my partition.
  • About your "PATH". When I thought I would make it. The fact again let me down. When I run "scomp...", XMLBEANS threw IOException saying "'javac' is required on the path.java.io.IOException : CreateProcess: c:\xmlbeans-1.0.2\schemas\javac @c:\DOCUME~1\alex\LOCALS~1\Temp\javac20992 error=2nulljava.io.IOException: CreateProcess: c:\xmlbeans-1.0.2\schemas\javac @c:\DOCUME~1\alex\LOCALS~1\Temp\javac20992 error=2 ", something like this. And this time I checked FAQ at here .I followed its advice but I couldn't find JAVA_HOME in my scomp script(in the bin folder). I think it's for old version of XMLBEANS and the information was not timely refreshed. And another piece of information solved my problem. There is a precedence among your JRE and JDK when java program finds java path. The former would be first located by default. So I put my JDK directory at the left most of my PATH variable.
  • About your "XMLBEANS_LIB". The official installation guide doesn't mention this. I found it in the scomp script. So I add a new environment variable called XMLBEANS_LIB pointing to my lib folder.

After the three steps I'm processing my XML Schema files with XMLBEANS. In addition, I wonder why BEA don't make it easier to install it just as install other java tools. Do they want to test our patience of using their tools?

Coming soon: XMLBeans Practice--Automate Exchanging data between XML's & Java (2): Working With XMLBeans

No comments:

About Me

My photo
I'm finishing my master degree in Software Engineering, Computer Science. I believe and have been following what Forrest Gump's Mam said: you have to do the best with what god gave you.