JAXB class question

does anyone know which jar file has the javax.xml.XMLConstants class? I'm getting an error while going through some examples for JAXB and I am almost positive that my classpath is messed up or not pointing to the right jars.

Good job mate. That's the way!
And you came back and let us know we needn't waste precious time answering a solved question. That's just exellent. Thanks.
:)

Similar Messages

  • Cannot Use JaxB classes in ADF application.

    Hi
    I am using JDeveloper 11.1.1.6
    I am trying to call the Oracle Business Rules (OBR) Ruleset from the frontend.
    When I call a simple rule only using Java facts (facts are object references of classes which are used in OBR)  as input, the Rules are verified and executed correctly.
    After that I tried to give XML Facts as input the application is facing ClassNotFoundException.
    To access the XML facts I had to add the XML Fact class known as JAXB_CLASSES into the Libraries and Classpath of Project Properties.
    First I tried to call the OBR rules containing the XML Facts / Jaxb_classes from the page and it throwed ClassNotFoundException while deploying the application.
    Next I tried to invoke the Jaxb_classes from main method and it worked fine.
    My Question is : How can I access JAXB Classes in an ADF View Controller Project/ Application?
    Thanks,
    Nigel.

    I am adding the JAXB_classes into the application in the Backend and the code for intialising is also written in the Backens.
    Still, the application is throwing a exception like
    <RuleSession> <logIt> The symbol 'generated.ParametersType' is undefined.
    at line 7 column 14 in main
    <RuleSession> <logIt> UndefinedException: The symbol 'generated.ParametersType' is undefined.
      at line 7 column 14 in main
    <RuleSession> <logIt> The symbol 'generated.ParametersType' is undefined.
    at line 7 column 14 in main
    <RuleSession> <logIt> UndefinedException: The symbol 'generated.ParametersType' is undefined.
      at line 7 column 14 in main
    oracle.rules.sdk2.exception.SDKException: RUL-05186: error setting up rule session pool for decision point

  • Customize names of generated JAXB classes

    I have a peculiar requirement. We have been using JAXB1.0 in our project to parse XMLs. External binding files were used to provide proper names for the generated JAXB classes. Now, I have an xml that looks something like this:
    //sample xml. Original format is much bigger
    <b>
    <MasterTag>
    <attr id="123">Value1</attr>
    <attr id="736">Value2</attr>
    <attr id="900">value3</attr>
    </MasterTag>
    </b>
    There's a property file which has key value pairs for the attr id
    Eg:
    <b>
    123=CompanyID
    736=CompanyAddress
    900=CompanyPinCode
    </b>
    Is it possible to generate JAXB classes names based on the attr id value? These values finally need to persisted in the db. JAXB is the preferred technology.
    Any other ideas are also welcome. Thanks.

    I might be misunderstanding your question, but if you control the single large schema, it would be simple to define the things that you want to treat specially as either individual elements or complexTypes inside the single schema file. Using psuedo-schema, say you have something like this now:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element name='Header'>
              <!-- your definition here -->
          </xs:element>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>You can change that to:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element ref='Header'/>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name='Header'>
      <!-- your definition here -->
    </xs:element>That should produce distinct classes for your Information and Header elements. You similary can break out the Item and Trailer elements.

  • How do I unmarshal to only a portion of generated JAXB classes?

    I have an XML schema that is laid out something like this:
    <Information>
    <Header/>
    <Item> (Unbounded)
    <Trailer/>
    </Information>
    I receive files that have thousands of items in them. Because of the size of the files, I must use SAX to parse the file.
    I need to unmarshal each file and store the results in a database after following some conditional logic. It is not practical to unmarshal a 500 MB file.
    What I have been doing is using a SAX DefaultHandler to strip out each <Item> element.
    I had to create a separate schema for just the <Item> element so that I could use JAXB's xjc to generate a set of classes to unmarshal each <Item> element to.
    This works great, but it is a hassle to maintain. You see, I also need to unmarshal the <Header> element. So I have to create a separate schema for that as well. So then I end up with two sets of JAXB classes, with lots of duplication. Plus, if I have any complex types that are referenced in both the <Header> and the <Item>, then I have to include those in each sub schema.
    What I want to know is:
    Is it possible to just generate ONE set of JAXB classes for the main schema, and then unmarshal the stripped out <Item> element to just the corresponding Item in the generated JAXB classes?
    This is a complicated topic, and I hope I've been clear. Basically, I have to create these <Header> and <Item> schemas by hand every time the main schema changes, and I want to get away from that.

    I might be misunderstanding your question, but if you control the single large schema, it would be simple to define the things that you want to treat specially as either individual elements or complexTypes inside the single schema file. Using psuedo-schema, say you have something like this now:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element name='Header'>
              <!-- your definition here -->
          </xs:element>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>You can change that to:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element ref='Header'/>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name='Header'>
      <!-- your definition here -->
    </xs:element>That should produce distinct classes for your Information and Header elements. You similary can break out the Item and Trailer elements.

  • Update Unbounded element using SOAP_CLIENT and JAXB classes

    I am writing a custom worklist application using 10.1.3.3. I am able to successfully kick off my BPEL process from my Java application and I am even able to modify most of the fields defined in my XSD. My problem occurs when I try to update the unbounded elements. They are of complex type and each request can have an unlimited number of these elements.
    I used JDeveloper's tool to generate the JAXB classes I'm using to interact and modify the payload of my task. I know that JAXB does not generate setter methods for unbounded elements. I should be able to get the list of elements and simply add to it. Unfortunately, the new list elements are not being saved when I marshall my payload and update the task with the new payload.
    Any ideas on what I'm doing wrong or if there is another way to do this? I've posted code snippets below.
    Thanks!
    Quote Element from XSD:
    <xsd:element name="Quote" nillable="true" minOccurs="0" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="WorksheetId" type="xsd:int" minOccurs="0"/>
    <xsd:element name="QuoteId" type="xsd:int" minOccurs="0"/>
    <xsd:element name="Description" nillable="true" minOccurs="0">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="250"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="Quantity" type="xsd:int" nillable="true" minOccurs="0"/>
    <xsd:element name="UnitPrice" type="xsd:float" nillable="true" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    AddQuote java code:
    JAXBContext jc = JAXBContext.newInstance("myproject.xml");
    Unmarshaller u = jc.createUnmarshaller();
    Task detailTask = wfSvcClient.getTaskQueryService().getTaskDetailsById(ctx, thisId);
    Element detailPayload = detailTask.getPayloadAsElement();
    ObjectFactory objFactory = new ObjectFactory();
    XMLWorksheet xRequest = objFactory.createWorksheet();
    xRequest = (XMLWorksheet)u.unmarshal(detailPayload.getFirstChild());
    List quotes = xRequest.getQuote();
    quotes.add(quote);
    Marshaller m = jc.createMarshaller();
    m.marshal(xRequest, detailPayload);
    detailTask.setPayloadAsElement(detailPayload);
    taskService.updateTask(ctx, detailTask);

    who actually managed to make the SOAP_CLIENT working ?
    What is the jar list and order you use ?
    Does it work with java 5 ?
    Thanks for the help!

  • 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

  • JAXB classes generation

    Hi all,
    I have 4 XMLSchema files and need to generate JAXB classes out of them. But most of the nodes like header parts of request and response of messages are same in structure. If I generate classes in 4 different packages how can I separate out the common node .java classes so that setting / getting repetition is avoided in my application.
    Thanks in advance.
    JoyBoy

    There are some good examples here:
    http://java.sun.com/webservices/jaxb/users-guide/jaxb-using.html

  • Problem Generating JAXB Classes

    I am using Eclipse (Enterprise Pack) and want to generate JAXB classes from a schema. I right click on the schema, select Generate JAXB classes - fill in package name, next and get the error:
    java.lang.NoClassDefFoundError: com/sun/tools/xjc/XJCFacade
    Caused by: java.lang.ClassNotFoundException: com.sun.tools.xjc.XJCFacade
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
    Exception in thread "main"
    Am I missing a library?
    Steve Watson

    The web service project will add additional server runtime libraries to the classpath thus resolving the jaxb dependencies, in the case of a dynamic web project, you'll have to manage that with the JPA facet and eclipselink, or by adding the Moxy jars seperately. However, if you want to use the target runtime libraries create a user-library and reference the following server libraries: (from Server Install Dir\modules) glassfish.jaxb_"version".jar, glassfish.jaxb.xjc_"version".jar, javax.activation_"version".jar, javax.xml.bind_"version".jar, javax.xml.stream_"version".jar.

  • Generating JAXB classes

    Hi,
    My xml: http://www.javaexperience.com/catalog.xml
    I have an xml for which I want to generate JAXB classes. Unfortunately I don't have access to xsd for this xml.
    Could someone please share steps to generate JAXB classes for a xml. What I have tried is:
    1) Generate the xsd from this xml using XML to XSD Generater Online - xmlGrid.net
    2) Use the Maven JAXB plugin "org.jvnet.jaxb2_commons"
    The problem I faced with my approach was that:
    Since the xml has root element and one of the child element as same name, the JAXB processor fails on reaching the child "Catalog" tag. Even though it had successfully processed the root "Catalog" tag.
    Any pointers would of great help.

    The web service project will add additional server runtime libraries to the classpath thus resolving the jaxb dependencies, in the case of a dynamic web project, you'll have to manage that with the JPA facet and eclipselink, or by adding the Moxy jars seperately. However, if you want to use the target runtime libraries create a user-library and reference the following server libraries: (from Server Install Dir\modules) glassfish.jaxb_"version".jar, glassfish.jaxb.xjc_"version".jar, javax.activation_"version".jar, javax.xml.bind_"version".jar, javax.xml.stream_"version".jar.

  • JAXB class conflict error

    I am new to JAXB.
    I am using external customization file to create JAXB classes.
    I have one XSD file which includes another XSD. Both of them have the same element name and the classes are getting created in the same folder. I have tried each and every option of the options mentioned in the fix collides examples of JAXB sun tutorial without any success.
    Please guide me on this.
    This is the following error:
    compile:
    [echo] Compiling the schema...
    [xjc] C:\Sun\jwsdp-1.6\jaxb\samples\acord-dri\gen-src\primer.po is not found and thus excluded from the dependency
    check
    [xjc] Compiling file:/C:/Sun/jwsdp-1.6/jaxb/samples/acord-dri/Aon_Acord-Repository_v-1-0-1.xsd
    [xjc] [ERROR] Multiple <schemaBindings> are defined for the target namespace "http://www.ACORD.org/Standards/Acord
    MsgSvc/1.1.0"
    [xjc] line 129 of binding.xjb
    [xjc] [ERROR] Another <schemaBindings> is defined here
    [xjc] line 98 of binding.xjb
    [xjc] [ERROR] A class/interface with the same name "primer.po.SenderAonAcord" is already in use. Use a class custo
    mization to resolve this conflict.
    [xjc] line 265 of Acord-Repository_v-1-0-1.xsd
    [xjc] [ERROR] (Relevant to above error) another "SENDERAonAcord" is generated from here.
    [xjc] line 217 of Aon_Acord-Repository_v-1-0-1.xsd
    [xjc] [ERROR] This error is caused because on Windows you cannot have both "SENDERAonAcord.java" and "SenderAonAco
    rd.java" in the same directory.
    [xjc] unknown location
    [xjc] failure in the XJC task. Use the Ant -verbose switch for more details

    This is because of name conflicts in the xsd. If the <xsd:element> name is same as some <xsd:complexType> and that is referenced from the element this happens. If you provide different names, it will solve the problem
    Regards,
    Sushil

  • Generating JAXB classes from an XSD

    Hi All,
    Can anyone please tell me how to generate Jaxb classes for xsd in eclipse , or in ant .
    Thanks and Regards

    Try here as well
    https://jaxb.dev.java.net/

  • Can anyone help me change fonts and size on my page? I don't understand the class questions?

    Can anyone help me change fonts and size on my page? I don't understand the class questions? All I want to do is change the font and size of a table or div.
    http://www.allgearinc.com/AG12SSWL-Swift.htm -One problem page

    If you want to change the fonts of the entire page then this code will do the trick:
    body {
        font-size: 16pt;
        color: silver;
         font-family: whatever, goes, here;
    If you want to change the fonts of ALL tables on a page then the code is something like this:
    table {
        font-size: 20pt;
        font-family: "Courier New", Courier, monospace;
        font-style: italic;
        font-weight: bold;
    what exactly do you want to change?  Can you be a bit specific so that Ben or Ken can give you the exact code and tell you about the short-hand method to write the code in one line.
    Have you bought a book on CSS yet?  If not, it is a good idea to get one as a reference.  Eric Meyer writes good books on CSS.

  • How to unmarshal non-root JAXB class

    How to unmarshal non-root JAXB class? I used work around to marshal an object without *@XmlRootElement*:
    marshaller.marshal( new JAXBElement(
      new QName("uri","local"), MessageType.class, messageType ));Now I need to unmarshal this object.

    what happened when you tried it?

  • JAXB Unmarshalling question

    I want to create Java objects from an XML file; JAXB sounds like the way to go, from what I've read.
    One question though: the object I want to create is an existing class. What I'd like to do is have JAXB create objects of the existing class, instead of the bean class that the JAXB binding compiler creates from looking at the schema.
    Is there a way to do this? Am I using the wrong tool? The existing class does not adhere to the bean standard.
    Thanks!

    Hi,
    You could place the binding schema,xml document,dtd could be at any location on your filesystem.When you use the binding compiler, you need to specify the location.
    For ex. you could use as following:
    D:\Softwares\jwsdp1.2\jaxb\bin\xjc -b c:\binding.xjb d:\examples\example.xsd
    If your are using jwsdp1.3, you need to set the JAVA_HOME and JWSDP_HOME environment variables.
    Refer the section "configuring and running the samples" for details at http://java.sun.com/webservices/docs/1.3/tutorial/doc/JAXBUsing2.html#wp87739
    -Amol

  • Special Characters issue in JAXB Classes generated

    Hi,
    I have generated Java bean classes from an xml schema using JAXB 2.0 Content Model feature in Jdeveloper 11g. I have another class, which has a method testMethod which takes the Java Bean class object as input. I have exposed this method as java webservice. I am just printing the FirstName from the input I have got.
    public String testMethod(TestBean testbean) {
    testBean,getContact().getFirstName();
    When there are some special characters like �, my java bean accepts and displays as �. I printed the value directly in my getter method, but it prints differently.
    How can I set my Java Bean class to use ISO-8859-1 as encoding.

    Sorry but this has nothing to do with ADF. Please try in the right forum here https://forums.oracle.com/forums/category.jspa?categoryID=285

Maybe you are looking for

  • Sound no longer working

    Last night we had a big storm. My wife's computer was asleep and when we woke up, it was frozen. We didn't lose power, but I suppose there could have been a surge of some kind. Anyway, the computer is behaving normally except for one thing: there is

  • My DVDs won't play on my eMac

    I can play my own burnt DVDs on my DVD player but I cannot play the DVDs that I made and burnt on my eMac on my eMac. Having made and burnt a DVD on my eMac, when I put the DVD into my eMac the DVD icon shows on my desktop. When I double click the DV

  • ITunes Refuses to Eject My iPod Classic 160GB

    I purchased one of the newest iPod Classic 160GB models and while it originally connected great when I connected to iTunes, now, iTunes absolutely refuses to eject my iPod everytime I connect. I have to eject my iPod through Windows Explorer and this

  • Sync of Primary and Standby

    Hi, SQL> select database_role from v$database; DATABASE_ROLE PRIMARY SQL> select applied,status from v$archived_log where applied='NO' and status='A'; APP S NO A NO A NO A NO A NO A NO A NO A NO A NO A NO A NO A APP S NO A NO A NO A NO A NO A NO A NO

  • Imac G5 Play Dvd but Not Cd

    I have a Imac G5 with a superdrive and if will play DVD but not CD. Anyway i can fix this?