Skip navigation.
Arch2Arch Tab BEA.com

Article: Configuring XMLBeans
Subject:  Instruction to compile java classes in sample.zip file with XMLBeans Ver 2.0.0
Date:  2005-12-12 07:56:45
From:  shahhetalc

To compile java classes in sample.zip file with XMLBeans version 2.0.0, please add <<XML Installation Directory>>\lib\jsr173_api.jar file to environment variable CLASSPATH as shown below in the modified build instruction for interface extensions feature's example java files in the article:

Building XMLBeans with Interface extension feature, and PrePost extension feature is divided into four steps.

  1. Put xml comments around both <xb:extension> elements in localInfo.xsdconfig file, then at a prompt in the working directory where you extracted the files from the example archive, type the following line.

           scomp -out localinfo_XmlBeans.jar localInfo.xsd localInfo.xsdconfig
    
  2. Compile extension interface, and handler class using localinfo_XmlBeans.jar,jsr173_api.jar, and xbean.jar.

           SET CLASSPATH=%CLASSPATH%;localinfo_XmlBeans.jar;.;c:\xmlbeans-2.0.0\lib\xbean.jar;c:\xmlbeans-2.0.0\lib\jsr173_api.jar
    
           javac -d . weatherExtension.java
           javac -d . weatherExtensionHandler.java
    
  3. Remove xml comment around <xb:extension> element of interface extension feature in localInfo.xsdconfig file. Then run scomp again with localInfo.xsd and localInfo.xsdconfig files, make sure that compiled interface extension classes are on the classpath.

           scomp -out localinfo_XmlBeans.jar localInfo.xsd localInfo.xsdconfig
    
    Compile PrePostSet handler class,
           javac -d . MapPrePostSetHandler.java
    
  4. Now remove xml comment around <xb:extension> element of PrePost extension feature in localInfo.xsdconfig file. Then run scomp again with localInfo.xsd and localInfo.xsdconfig files, make sure that compiled PrePost extension class is on the classpath.

           scomp -out localinfo_XmlBeans.jar localInfo.xsd localInfo.xsdconfig
    

We are ready to compile, and run our XMLBeans based client application prePostClient.java,

       javac prePostClient.java
       java prePostClient localInfo_68154.xml.