Jaxb-xjc-1.0-ea.jar

Hi All
I downloaded the jwsdp-1_1-windows-i586.exe and installed jaxb1.0 (from the sun site). But I am not able to find jaxb-xjc-1.0-ea.jar and jaxb-rt-1.0-ea.jar
in the \jre\lib directory. Can I copy these two jars separately ?
Thanks all

Hi All
I downloaded the jwsdp-1_1-windows-i586.exe and
installed jaxb1.0 (from the sun site). But I am not
able to find jaxb-xjc-1.0-ea.jar and
jaxb-rt-1.0-ea.jar
in the \jre\lib directory. Can I copy these two jars
separately ?
Thanks allThe JWSDP1.1 will not contain the jaxb-xjc-1.0-ea.jar.
The JAXB1.0 Reference Implementation is based on 1.0 version of the JAXB spec and those jars are shipped with the JWSDP1.1
We no longer support the 1.0 EA release.
Regards,
Bhakti

Similar Messages

  • How to use jaxb-impl-2.1.3.jar  for jaxb

    hi ,
    I want to use jaxb-impl-2.1.3.jar ,thus I am placing the same jar in 'endorsed' folder in the jdk1.6.0/jre/lib folder . But while generating the java classes from the XSD it using 'xjc -verbose -d [folder] -p[package structure]' command it gives
    Exception in thread "main" java.lang.NoSuchMethodError: com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(Lcom/sun/xml/bind/v2/runtime/JAXBContextImpl$JAXBContextBuilder;)V
            at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1136)
            at com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo.getJAXBContext(BindInfo.java:330)
            at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserFactoryImpl$1.<init>(AnnotationParserFactoryImpl.java:80)
            at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserFactoryImpl.create(AnnotationParserFactoryImpl.java:79)
            at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.createAnnotationParser(NGCCRuntimeEx.java:359)
            at com.sun.xml.xsom.impl.parser.state.annotation.action0(annotation.java:48)
            at com.sun.xml.xsom.impl.parser.state.annotation.enterElement(annotation.java:73)
            at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
            at com.sun.xml.xsom.impl.parser.state.NGCCHandler.spawnChildFromEnterElement(NGCCHandler.java:74)
            at com.sun.xml.xsom.impl.parser.state.simpleType.enterElement(simpleType.java:62)
            at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
            at com.sun.xml.xsom.impl.parser.state.NGCCHandler.revertToParentFromEnterElement(NGCCHandler.java:111)
            at com.sun.xml.xsom.impl.parser.state.foreignAttributes.enterElement(foreignAttributes.java:50)
            at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
            at com.sun.xml.xsom.impl.parser.state.NGCCHandler.spawnChildFromEnterElement(NGCCHandler.java:74)
            at com.sun.xml.xsom.impl.parser.state.simpleType.enterElement(simpleType.java:145)
            at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
            at com.sun.xml.xsom.impl.parser.state.simpleType.enterElement(simpleType.java:86)
            at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
            at com.sun.xml.xsom.impl.parser.state.simpleType.enterElement(simpleType.java:107)
            at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:219)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.util.SubtreeCutter.startElement(SubtreeCutter.java:104)
            at com.sun.tools.xjc.reader.ExtensionBindingChecker.startElement(ExtensionBindingChecker.java:144)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.reader.xmlschema.parser.IncorrectNamespaceURIChecker.startElement(IncorrectNamespaceURIChecker.java:113)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.startElement(CustomizationContextChecker.java:188)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.ModelLoader$SpeculationChecker.startElement(ModelLoader.java:455)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.reader.internalizer.VersionChecker.startElement(VersionChecker.java:98)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
            at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
            at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
            at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
            at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
            at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
            at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)If I removes the endorse folder it generates the classes properly ,but it uses jaxb2.0 jar which is there in rt.jar .
    Please suggest me how to use the jaxb-impl-2.1.3.jar ....
    With Regards
    Arunabh Dash

    You can set JDeveloper to use JDK 1.4 for your project compile.
    JDeveloper 10.1.3.2 has the needed portlet wizards.
    See:
    http://download.oracle.com/otndocs/tech/webcenter/files/owcs_10132_buildportlets_viewlet.html
    You might also want to verify these on the Portal/WebCenter forums as well.

  • Jaxb xjc compiler problem

    I have downloaded JAXB from java.sun.com through FTP and HTTP. When i tried to extract the zip file, i found the xjc compiler is existing as a file instead of an .exe file.Becoz of which i couldn't able to work with it.Pls help me out asap.
    regards
    Meena

    Extract the following Jar files from jaxb-1.0-ea\lib to dircetroy where you want to keep your xml and generated java classes.
    jxb-rt-1.0-ea
    jaxb-xjc-1.0-ea
    and then use the following commnad to run it:
    java com.sun.tools.xjc.Main abc.dtd dcf.xjc
    iam able generate the Java class with this commanad.

  • JAXB (XJC) problem with Java 1.4.2_02

    Hi,
    I am trying to migrate our system to Java version 1.4.2_02 (currently using 1.4.1_02). We use XJC from JAXB to compile XML schema files into java classes. JAXB is packaged in JWSDP (we are using version 1.3). I am currently experiencing a problem whereby if I use java version 1.4.2_02 and run XJC on the xml schema file its not generating any of the inner classes. All classes including inner are generated properly if I am pointing 1.4.1_02.
    Just wondering if you came across this problem before and would know of a possible solution.
    thanks for your help
    Manish

    I was having this problem as well. I extracted the MSI from the InstallShield and found that it's looking for a property called "SystemFilesLocked" to equal 1. If you pass it as a parameter and give it a value of 0, this error message doesn't appear. I've installed now to 15 W2K desktops without any issues.
    The 'silent installation' documentation for this product is sorely lacking. The install string I'm using is below:
    j2re-1_4_2_03-windows-i586-p.exe /S /v/qn"ADDLOCAL=jrecore SYSTEMFILESLOCKED=0 CONTROLPANELLOCKED=1 SKDSILENT=1 IEXPLORER=0 SYSTRAY=0 REBOOT=Suppress JAVAUPDATE=0 JAVAJAVAWLOCKED=0 WEBSTARTICON=0 /L C:\TEMP\LogFiles\JRE_JWS_142_03.log"
    Hope this helps...

  • How to force lang level 7.0 (diamond op.) for classes generated by JAXB xjc

    I tried various JAXB maven plugins in the respective latest version and none uses the diamond operator in the generated code.
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <version>1.5</version>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb2-plugin</artifactId>
    <version>0.8.3</version>
    <groupId>com.sun.tools.xjc.maven2</groupId>
    <artifactId>maven-jaxb-plugin</artifactId>
    <version>1.1</version>
    Is there a way to configure one of these to do so? Setting source/target in the config of the jvnet-plugin to 1.7 for example didn't do the trick unfortunately.

    What would be the benefit of the diamond operator being used in the generated code? It is not code you should be messing with yourself and it has no influence on the compiled state of the class. Not using the diamond operator keeps the generated code compatible with any version of Java you are likely to find in use.

  • Getting error while using jaxb/xjc

    hello every one,
    i have a xsd and i want automated classes from it for which i am using jaxb and xjc compiler but when i am running it then i am getting error
    parsing a schema...
    compiling a schema...
    Exception in thread "main" java.lang.IllegalArgumentException: Expected
    class ja
    vax.xml.bind.annotation.XmlAccessType but found class
    javax.xml.bind.annotation.
    my xsd is
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="clients"
    type="ClientsDef"/>
    <xs:complexType name=" ClientsDef ">
    <xs:sequence>
    <xs:element name="pers" type="Person"
    maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Person">
    <xs:sequence>
    <xs:element name="name"
    type="xs:string"/>
    <xs:element name="date_of_birth"
    type="xs:date"/>
    <xs:element name="cnp"
    type="xs:string"/>
    <xs:element name="adress"
    type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    any one please help me out...

    Hi,
    XSD is well formed but for JAXB, it needs to have the complexType declaration inner the root element:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="clients">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="pers" type="Person" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="Person">
    <xs:sequence>
    <xs:element name="name" type="xs:string"/>
    <xs:element name="date_of_birth" type="xs:date"/>
    <xs:element name="cnp" type="xs:string"/>
    <xs:element name="adress" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>Tested this works with this Main using jaxb-bindings in Netbeans (defining XSD compilation under clients package, Main in default package):
    import clients.Clients;
    import clients.ObjectFactory;
    import clients.Person;
    import java.io.ByteArrayOutputStream;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.Marshaller;
    public class Main
        public static void main(String args[]) throws Exception
            ObjectFactory of = new ObjectFactory();
            Clients cd = of.createClients();
            Person p = of.createPerson();
            p.setAdress("address");
            p.setCnp("cnp");
            p.setName("name");
            cd.getPers().add(p);
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            try
                JAXBContext ctx;
                ctx = JAXBContext.newInstance(Clients.class);
                Marshaller marshaller = ctx.createMarshaller();
                marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));
                marshaller.marshal(cd, bos);
                System.out.println(bos.toString());
            finally
                bos.close();
    }Generates:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <clients>
    <pers>
    <name>name</name>
    <cnp>cnp</cnp>
    <adress>address</adress>
    </pers>
    </clients>

  • JAXB xjc Error

    I am new to JAXB. I installed JWSDP 1.3 and tried to ran xjc.
    I ran xjc in the example below and have the
    following errors. Even I run the example in C:\jwsdp-1.3\jaxb\samples
    and have same error. Any ideas??
    http://java.sun.com/developer/technicalArticles/WebServices/jaxb/index.html
    D:\jaxbtest>xjc -p test.jaxb book.xsd -d work
    parsing a schema...
    compiling a schema...
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
    Caused by: java.io.IOException: work: non-existent directory
    at com.sun.codemodel.writer.FileCodeWriter.<init>(FileCodeWriter.java:43
    at com.sun.tools.xjc.Driver.createCodeWriter(Driver.java:410)
    at com.sun.tools.xjc.Driver.run(Driver.java:226)
    at com.sun.tools.xjc.Driver._main(Driver.java:80)
    at com.sun.tools.xjc.Driver.access$000(Driver.java:46)
    at com.sun.tools.xjc.Driver$1.run(Driver.java:60)

    The eror report says:
    work: non-existent directory
    So: does the destination directory exist?

  • JAXB: XJC src-resolve error when importing other schemes

    Hi!
    I keep getting a src-resolve error from the JAXB binding compiler whenever I try to import other XML schemes into my own.
    For example:
    I want to use a SignatureType element as defined in the official XML signature schema.
    So I imported it into my own schema and use it as follows:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#"
    schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>
    <xsd:complexType name="PayloadType">
    <xsd:sequence>
       <xsd:element name="signature" type="ds:SignatureType" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>However if I run XJC to compile my schema I get this error:
    [xjc] [ERROR] src-resolve: Cannot resolve the name 'ds:SignatureType' to a(n) 'type definition' component.I am using JAXB 2.0 EA from the JWSDP 2.0 and XJC is called from an Ant task.
    I am pretty new to JAXB and XML schemes, so any help on this topic would be greatly appreciated.

    I got the the answer from another forum; it was a proxy problem. Just to inform succeeding readers, here is what I did:
    To receive a better error output, I modified my ant buildfile to use the "nv" parameter:
    <xjc schema="${path}/.../mySchema.xsd" package="mySchemaPackage" destdir="${path}/.../src">
    <arg value="-nv" />
    <produces dir="${path}/.../src/mySchemaPackage" includes="**/*.java" />
    </xjc>Result:
    The XJC compiler gives me a different (better) error message:
    [xjc] [ERROR] java.net.ConnectException: Connection timed out: connectSo I looked in my Ant buildfile again to check the proxy settings. I merely used property-tags to define my proxy settings (<property name="http.proxyHost" value="nnn.nnn.nnn.nnn" /> and <property name="http.proxyPort" value="nnnn" /> ) which apparently do not work.
    Instead this here does the trick:
    <setproxy proxyhost="nnn.nnn.nnn.nnn" proxyport="nnnn"/>Good to now that "nv" might give you a better error report.

  • Preventing JAXB xjc from re-generating java code of import ed schemas...

    Hi, I am using XJC to generate java code from xsd.
    However the xsd I run it on often has imports to another xsd that will be in a jar along with its java classes already existing.
    This jar is on the calsspath too.
    XJC however not only generates java code for existing xsd, but also for every import it has.
    And also for every import each of those imported xsd's might have.
    So if it were a long import chain A->B->C->D it generates code for all.
    How can i get it to generate code for only A and assume all the remaing code can be found on the jars in the classpath.
    The A.xsd also has a catalog file associated with it that has every namespace reference pointing to the correct xsd locations within jars.
    So it even has B->C mapping and C->D mapping. This was needed or else XJC didnt even generate anything at all and complained it could not reach C from B and so on.
    Catalog file solved that problem but not the fact that it keeps regnerating code.
    Thanks
    Edited by: Priyajeet on Dec 9, 2008 1:36 PM

    Problem solved.
    The xjc compiler reads file name in a case-sensitive fashion, even on windows.
    So, common.xsd and Common.xsd are seen as two distinct files.
    This was the cause of the compilation errors, since feature1 imported the schema using the filename Common.xsd, whereas the other schemas imported common using common.xsd
    I hope this could help.
    Salvatore

  • JAXB XJC class generation problem

    Hi!, I�m trying to generate the classes for the IMS-LearningDesign schema:
    xjc -d src_temp -p edu.eci.ims.ld IMS_LD_Level_A.xsd
    parsing a schema...
    [ERROR] Attempt to create a property having the same name as the reserved word "Class".
    line 177 of IMS_LD_Level_A.xsd
    The problem is that schema has a 'class' attribute, and that`s a reserved word for JAXB.
    When the schema is modified (add a character to the attribute name - oclass) it works fine, but I need to keep the standard specification (to parse standard XML - LD files). What can I do to solve this problem without modifying the schema?

    I'd suggest you repost this to the JAXB users mailing list at Java.Net. That list is monitored by the JAXB implementation team.
    Check http://jaxb.dev.java.net/

  • JAXB xjc error on name collision

    The xjc is invoked with the following command line:
    C:\jwsdp-1.3\jaxb\bin>xjc -p com.multex.rrapi -d \multex -extension ReutersResearchAPI.xsd
    The ReutersResearchAPI.xsd looks like below:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="http://api.reutersresearch.com/ReutersResearchAPI"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://api.reutersresearch.com/ReutersResearchAPI"
    xmlns:ns1="http://api.reutersresearch.com/Estimates" xmlns:ns="http://api.reutersresearch.com/Collaboration"
    elementFormDefault="qualified">
    <xs:import namespace="http://api.reutersresearch.com/Collaboration" schemaLocation="Collaboration.xsd"/>
    <xs:import namespace="http://api.reutersresearch.com/Estimates" schemaLocation="Estimates.xsd"/>
    <xs:element name="ENTER_NAME_OF_ROOT_ELEMENT_HERE">
    </xs:element>
    </xs:schema>
    The Collaboration.xsd looks like below:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="http://api.reutersresearch.com/Collaboration"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://api.reutersresearch.com/Collaboration"
    elementFormDefault="qualified">
    <xs:element name="status">
    <xs:complexType>
    <xs:simpleContent>
    <xs:extension base="xs:int"/>
    </xs:simpleContent>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    The Estimates.xsd looks like below:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="http://api.reutersresearch.com/Estimates" xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://api.reutersresearch.com/Estimates" elementFormDefault="qualified">
    <xs:element name="Status">
    <xs:complexType>
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="errorCode" type="errorCode_AttrT" use="optional"/>
    <xs:attribute name="success" type="success_AttrT" use="required"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    The xjc generates the following error message:
    [ERROR] A class/interface with the same name "com.multex.rrapi.Status" is alread
    y in use.
    line 285 of Estimates.xsd
    [ERROR] (Relevant to above error) another one is generated from here.
    line 2017 of Collaboration.xsd

    Thank you. I read the fix-collision sample. In my case I have to fix collision between an <element> from one namespace and an <element> from another. Would appending the "element" suffix eliminate the collision?

  • Compiling Jaxb (XJC.bat) inside Java Code

    This simple class doesn't work. �can anyone tell me why?
    The program starts, the process runs OK, but the program never reachs the sentence println ("Finished...");
    When the program is interrupted by using Ctrl+C, the files of the JAXB compilation are created.
    public class PruebaJaxb {
    public static void main (String[] args) {
    System.out.println("JaxB Compilation");
    try {
    Process proceso = Runtime.getRuntime().exec("D:\\jwsdp-1.3\\jaxb\\bin\\xjc.bat -d D:\\jwsdp-1.3\\jaxb\\bin -p tdi.eleva D:\\jwsdp-1.3\\jaxb\\bin\\estilos.xsd");
    System.out.println ("Waiting for the process to finish...");
    proceso.waitFor();
    System.out.println ("Finished. Exit value: "+proceso.exitValue());
    catch (Exception e) {
    }

    The JAXB SI engineering team is monitoring the users mailing list at http://jaxb.dev.java.net. You may want to repost there.
    - eduard/o

  • How to compile the Java classes generated in JAXB

    I am using Windows 2000 Operating System. I found a xjc
    batch file on the sun's java forum.
    I used that to generate classes from XML. After generating
    the classes I could not compile
    the classes each depends on other AND THEY REQUIRE BOTH
    CLASS FILES.
    I will attach the schema file and dtd . Can you explaine me the problem.
    #<transactions.dtd>
    <?xml version="1.0" encoding="UTF-8"?>
    <!ELEMENT transactions (cardtocard*)>
    <!ELEMENT cardtocard (tocard, fromcard, fromcardver, amount, transdate, transid)
    >
    <!ELEMENT tocard (#PCDATA)>
    <!ELEMENT fromcard (#PCDATA)>
    <!ELEMENT fromcardver (#PCDATA)>
    <!ELEMENT amount (#PCDATA)>
    <!ELEMENT transdate (#PCDATA)>
    <!ELEMENT transid (#PCDATA)>
    transactions.xjs
    <xml-java-binding-schema>
    <element name="transactions" type="class" root="true"/>
    <element name="cardtocard" type="class"/>
    </xml-java-binding-schema>
    XML file
    ?xml version="1.0" encoding="UTF-8"?>
    <!--Sample XML file generated by XML Spy v4.4 U (http://www.xmlspy.com)-->
    <transactions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="C:\My Documents\Xml\SVTConcord.xsd">
    <cardtocard>
    <tocard>1111222233334444</tocard>
    <fromcard>6666777788889999</fromcard>
    <fromcardver>567</fromcardver>
    <amount>100.00</amount>
    <transdate>2002-06-04 00:00:00.000</transdate>
    <transid>1111222202</transid>
    </cardtocard>
    </transactions>
    the XJC compiler for windows is
    @echo off
    echo JAXB Schema Compiler
    echo --------------------
    if "%JAVA_HOME%" == "" goto errorJVM
    if "%JAXB_HOME%" == "" goto errorJAXB
    set JAXB_LIB=%JAXB_HOME%\lib
    set JAXB_CLASSES=%JAXB_HOME%\classes
    echo %JAVA_HOME%\bin\java.exe -jar %JAXB_LIB%\jaxb-xjc-1.0-ea.jar %1 %2 %3 %4 %5
    %JAVA_HOME%\bin\java.exe -jar %JAXB_LIB%\jaxb-xjc-1.0-ea.jar %1 %2 %3 %4 %5
    goto end
    :errorJVM
    echo ERROR: JAVA_HOME not found in your environment.
    echo Please, set the JAVA_HOME variable in your environment to match the
    echo location of the Java Virtual Machine you want to use.
    echo For example:
    echo set JAVA_HOME=c:\jdk1.4.0_01
    goto end
    :errorJAXB
    echo ERROR: JAXB_HOME not found in your environment.
    echo Please, set the JAXB_HOME variable in your environment to match the
    echo location of the JAXB installation directory.
    echo For example:
    echo set JAXB_HOME=c:\jdk1.4.0_01\jaxb-1.0-ea
    :end

    When you compile the generated classes, be sure to put jaxb-rt-1.0-ea.jar in your classpath!

  • Heavy loading of jaxb classes

    Hi,
    We need to use the latest jaxb 2.1 libraries in our application. We are using netweaver 7.1 CE and it seems to ship with jaxb 2.0 libs. (file:/usr/sap/CE7/J00/j2ee/cluster/bin/ext/jaxb20/jaxb-impl.jar)
    We are already using heavy loading for the hibernate classes, and I assumed I could to the same for jaxb. The dump of the heavy loaded classes from telnet is as follows:
       /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/javassist-3.4.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/hibernate-entitymanager-3.3.2.GA.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/asm-1.5.3.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/antlr-2.7.6.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/commons-collections-3.1.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/hibernate-commons-annotations-3.0.0.GA.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/jaxb-xjc-2.1.7.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/hibernate-annotations-3.3.1.GA.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/jaxb-impl-2.1.7.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/log4j-1.2.15.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/asm-attrs-1.5.3.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/jaxb-api-2.1.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/commons-logging-1.0.4.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/cglib-2.1.3.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/ehcache-1.5.0.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/dom4j-1.6.1.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/hibernate-3.2.6.ga.jar
    The jaxb classes is included, but it does not seem that my jaxb libraries is used by my application. I've added a util method to do o lookup of the classloader of the jaxb class that I get hold of in the app, and it is still the original jaxb2.0
    Is this the correct approach to use a newer JAXB or is there some other way of doing it?
    Regards Jaco

    In the NetWeaver you can make one application dependent on another one using the [application-j2ee-engine.xml|http://help.sap.com/saphelp_nwce10/helpdata/en/45/053c1041f30486e10000000a155369/content.htm] descriptor.
    If you have YourApp.ear, and HibernateJars.ear (the latter one as "Heavy Library"), in the YourApp.ear/META-INF/application-j2ee-engine.xml you could write:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
    <application-j2ee-engine>
         <provider-name>yourcompany.com</provider-name>
         <reference reference-type="hard">
              <reference-target target-type="application" provider-name="yourcompany.com">HibernateJars</reference-target>
         </reference>
    </application-j2ee-engine>
    In such case, the HibernateJars' classloader will not see the jaxb classes loaded by server, and whatever refers to jaxb there - will use the version you want. BUT, YourApp's classloader will use the jaxb version loaded on server.
    I know this may still be confusing... I would recommend you to browse through the classloader viewer on the web console (port 50000):
    SAP NetWeaver Administrator > Problem Management > Classloader viewer > Java Class Loader Viewer
    (find the classloaders of your applications and browse through Children, Parents and Resources tabs -
    this is where I understood the NetWeaver's classloading approach

  • Xjc in code - not command line

    I'm new to java xml, and may be wanting to force a square peg through a round hole but, I would like to create source files using xjc from dtd's and xjs's from datasources or other basically non file based sources. Am I looking at the wrong tool? I don't want to write the dtd's and xjs's to disk and then compile through a command line.
    Thanks
    fj

    Thanks Danny,
    I've read through the pdf's got the example to work as well as many in the java_xml_pack-spring-02-dev. Wipped up a proof of concept database, some JDBC classess, and a servlet. Went through XML Hell with Tomcat 4, then deleted the xerces from the common folder, changed some classpath statements and the example works being triggered from a servlet. Then I gabbed DTD, XJS, and XML content like so
    (1) a couple prepared statements
    first statement to retrieve an xml file from the database
    "SELECT XML_NAM, XML_CNT " +
    "FROM XML_CNT_JAXB "
    second one to retrieve the DTD and XJS content from a database
    "SELECT INFO_DTD_CNT.DTD_CNT, INFO_XJS_CNT.XJS_CNT " +
    "FROM INFO_DTDXJS_BLD " +
    "INNER JOIN " +
    "INFO_DTD_CNT ON INFO_DTDXJS_BLD.DTD_ID = INFO_DTD_CNT.DTD_ID " +
    "INNER JOIN " +
    "INFO_XJS_CNT ON INFO_DTDXJS_BLD.XJS_ID = INFO_XJS_CNT.XJS_ID " +
    "WHERE (INFO_DTDXJS_BLD.DTD_BLD_NM = ?)"
    (2) execute and get results
    ResultSet resultSet = sqlXML_CNT.executeQuery();
    etc..
    (3) place resultset XML strings in an InputStream
    sbin_XML_CNT = new StringBufferInputStream(str_XML_CNT);
    etc..
    (4) now it works fine if you already used xjc to create your java classes and compile... then you can just use the BufferedInputStream to build your trees
    buildTrees(StringBufferInputStream bIn)
    foo = foo.unmarshal(bIn);
    etc...
    (5) what I don' want to do with the DTD and XJS is stream the content write the file to disk and execute commands to build the java files..
    Process myXJC = Runtime.getRuntime().exec("myXJC.bat");
    Again I'm new to Java XML, but if people want to use an XML file that does not have a DTD or XJS within a system, say they are requesting a new content area, the app then gives them a screen to define the DTD or builds a DTD for them or whatever, and then asks them for the content they want to manipulate or reports or whatever, and them creates an XJS, Java classes are then built compiled and someone can test and approve them... etc then save them to disk, database, a distributed server,.. etc
    I'm sure there is a way to compile Java from within a application. what I'm not sure of is if there is a way avoid the Java -jar %JAXB_HOME%\lib\jaxb-xjc-1.0-ea.jar file.dtd file.xjs -d directory from command line.
    If you could point me to any articles or book chapters address this, I'd really appreciate it!
    Thanks
    fj

Maybe you are looking for