XmJDK7 - compliancy with JAXB spec 2.2

It's really a small doubt:
in JAXB spec 2.2, it says: ”The mapping of existing Java interfaces to schema constructs is not supported. Since an existing class can implement multiple interfaces, there is no obvious mapping of existing interfaces to XML schema constructs.”
But with JDK 7, it allows the binding of XML elements to a generic list of interface.
public interface MyInterface {
Properties getAnothernameproperties();
void setAnothernameproperties(Properties anothernameproperties);
public class Root {
@XmlElements(value = {
@XmlElement(name = "myObject", type = MyObject.class),
@XmlElement(name = "otherObject", type = MyOtherObject.class) })
protected List<MyInterface> myList = new ArrayList<MyInterface>();
Is the JDK7 implementation spec compliant or not?
Edited by: 1004198 on May 15, 2013 8:19 PM

Hello,
About WSIF, we are currently working on a WSIF-EJB30 binding that will allow you to direclty annotate the session ben and get the EJB exposed as SOAP and WSIF binding out of the box.
This will be available in OracleAS 10.1.3.1 production.
Regards
Tugdual Grall

Similar Messages

  • Web services with JAXB

    Hi All,
    I am new to Web services with JAXB in ECLIPS.
    When I tried to unmarshal the XML file, I am getting the following exception.
    javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"order"). Expected elements are <{http://webservices/}read>,<{http://webservices/}readResponse>
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent
    xml , schema and java class are in follow.
    Please help me to solve this issue.
    Mohseni Rad.
    ----------------------------------po.xsd-----------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="order" type="OrderType"/>
    <xsd:complexType name="OrderType">
    <xsd:sequence>
    <xsd:element name="shipTo" type="xsd:string"/>
    <xsd:element name="billTo" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    ------------------------------------po.xml----------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <order>
    <shipTo>shipto</shipTo>
    <billTo>billto</billTo>
    </order>
    ------------------TestWS.java---------------------
    import java.io.FileInputStream;
    import java.io.IOException;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.JAXBElement;
    import javax.xml.bind.JAXBException;
    import javax.xml.bind.Unmarshaller;
    import wsclient.*;
    public class TestWs {
         public static void main(String[] args) {
              try{
                   SecondWebServices webService = new SecondWebServicesService
    .getSecondWebServicesPort();
                   JAXBContext jctx = JAXBContext.newInstance("wsclient");
                   Unmarshaller unmarshaller = jctx.createUnmarshaller();
                   FileInputStream fl = new FileInputStream( "etc//po.xml" );
         JAXBElement<?> order = (JAXBElement<?>)unmarshaller.unmarshal( fl );
                   OrderType orderType = (OrderType)order.getValue();
                   webService.read( orderType);
              }catch (JAXBException je) {
                   je.printStackTrace();
              catch (IOException ioe) {
                   ioe.printStackTrace();
    }

    Hi,
    When you are using JAX-WS, there is a tool wsimport, with which you are going to generate the artifacts required to implement the web service.
    When you pass the WSDL as a parameter to the wsimport tool, it will be create the required beans also(JAXB Objects).
    So need of any other external implementation of JAXB when you are working with JAXWS
    Thanks,

  • How to create a sequence with followoing specs....

    Hello all,
    I have to create a sequence with following specs:
    data type: number
    no. of digits: 6
    classification:
    1st digit starts from 5
    next 2 digits represent current year e.g. 06
    and next 3 digits = running serial (001 to 999)
    increament: 1
    example: 506001
    please help me
    regards/gulzar

    it is pre assumption that the running serial will not go beyond 999 in a year
    the ceiling is 500 per year
    yes its a y2.1k issue but we are not supposed to store a uniqe identifier for more than 100 years in the database.
    i m a novice, can you please suggest a code template for such a seq.?

  • Marshalling HashMap with JAXB 2.0 - empty tags & ill schema

    Hi all,
    I expected JAXB 2.0 to be capable to handle basic classes like HashMap, but it does not look so. I have two classes: SimpleNegotiationManager which has a property HashMap in which are stored the instances of SimpleInitiatedConversation:
    package xml;
    import javax.xml.bind.annotation.*;
    import java.util.HashMap;
    @XmlAccessorType(AccessType.FIELD)
    @XmlRootElement
    public class SimpleNegotiationManager {
        @XmlElement
        protected HashMap<String, SimpleInitiatedConversation> initiatedConversations;
        public SimpleNegotiationManager() {
        public HashMap<String, SimpleInitiatedConversation> getInitiatedConversations() {
            if (initiatedConversations == null) {
                initiatedConversations = new HashMap();
            return initiatedConversations;
        public void setInitiatedConversations(HashMap<String, SimpleInitiatedConversation> initiatedConversations) {
            this.initiatedConversations = initiatedConversations;
    }and
    package xml;
    import javax.xml.bind.annotation.*;
    import java.util.ArrayList;
    import java.util.List;
    @XmlAccessorType(AccessType.FIELD)
    @XmlType
    public class SimpleInitiatedConversation {
        @XmlElement
        protected List<String> messages;
        protected String conversationID;
        protected int protocolState;
        public SimpleInitiatedConversation() {
        public List<String> getMessages() {
            if (messages == null) {
                messages = new ArrayList();
            return messages;
        public void setMessages(List<String> messages) {
            this.messages = messages;
        public int getProtocolState() {
            return protocolState;
        public void setProtocolState(int protocolState) {
            this.protocolState = protocolState;
        public String getConversationID() {
            return conversationID;
        public void setConversationID(String conversationID) {
            this.conversationID = conversationID;
    }When I marshalled SimpleNegotiationManager while the HashMap was filled with several <String,SimpleInitiatedConversation> entries, in the output were empty tags initiatedConversations:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <simpleNegotiationManager>
      <initiatedConversations>
      </initiatedConversations>
    </simpleNegotiationManager>When I used schemagen to generate a schema, it produced:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType name="simpleInitiatedConversation">
        <xs:sequence>
          <xs:element name="messages" type="xs:string" maxOccurs="unbounded" minOccurs="0"/>
          <xs:element name="conversationID" type="xs:string" minOccurs="0"/>
          <xs:element name="protocolState" type="xs:int"/>
        </xs:sequence>
      </xs:complexType>
      <xs:element name="simpleNegotiationManager" type="simpleNegotiationManager"/>
      <xs:complexType name="simpleNegotiationManager">
        <xs:sequence>
          <xs:element name="initiatedConversations" type="hashMap" minOccurs="0"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="hashMap">
        <xs:complexContent>
          <xs:extension base="abstractMap">
            <xs:sequence/>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:complexType name="abstractMap" abstract="true"/>
    </xs:schema>Particularly the description of HashMap seems ill - there is not specified that the HashMap has keys String and values SimpleInitiatedConversation.
    Unfortunatelly, the j2s-xmlAdapter-field example available with JAXB 2.0 is more complicated than I need. I just need to store/load HashMap into/from XML and I do not care what it looks like. Is it possible to avoid extending XmlJavaTypeAdaptor for a simple storing a HashMap into XML? Perhaps I use improper annotations in the source code, but I cannot get it working. Any clue?

    Ok i figured out one way of doing this by using some classes from JAXP...
    SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema s = null;
    try{
        s = sf.newSchema(new File("Sources/schema/test.xsd"));                    
    }catch(Exception e){
        System.err.println("Exception e: " + e.getMessage());
    marshaller.setSchema(s);
    //MyValidationHandler class implements the ValidationEventHandler interface
    MyValidationHandler gv = new MyValidationHandler();
    marshaller.setEventHandler(gv);If anyone has something to add let me know!!

  • Can't generate setters for array or collection classes with JAXB

    I am trying to use JAXB to generate the required setters for Spring beans. Although according to the book Java & XML Data Binding
    Chapter 3 page 42 by Brett McLaughlin it was possible with DTD's using
    <?xml version="1.0"?>
    <xml-java-binding-schema version="1.0-ea">
    <options package="javajaxb.generated.movies" default-reference-collection-type="array" />
    <element name="movies" type="class" root="true"/>
    </xml-java-binding-schema>
    to generate an array as in
    public Movie[] getMovie( ) {
    // implementation
    public void setMovie(Movie[] _Movie) {
    it doesn't look like that capability exists with JAXB 2.0 and XML Schemas. In their wisdom they just generate getters on Lists and tell you:
    <p>
    * This accessor method returns a reference to the live list,
    * not a snapshot. Therefore any modification you make to the
    * returned list will be present inside the JAXB object.
    * This is why there is not a <CODE>set</CODE> method for the filingForm property.
    * <p>
    * For example, to add a new item, do as follows:
    * <pre>
    * getFilingForm().add(newItem);
    * </pre>
    Of course this doesn't work for Spring injection where setters are needed.
    Does anyone know different or is there a way of getting around this ?
    I've tried constructor injection in Spring but it's not as convenient and involves extensive coding of generated code (not nice).
    Edited by: user3806112 on Mar 15, 2011 11:13 AM

    Oh I found it on this post
    http://cxf.547215.n5.nabble.com/NPE-in-generated-setter-method-when-collectionType-quot-indexed-quot-and-a-null-array-is-used-td3323012.html
    collectionType="indexed" in the globalBindings-tag
    it works in schema internal global bindings as well
    <jaxb:globalBindings collectionType="indexed" >

  • How to handle "xsd:anyAttributes" with jaxb

    Need help for how to handling "xsd:anyAttribute" with jaxb!
    Here is part of my xml schema.
    <xsd:attributeGroup name="DataAttributes">
    <xsd:anyAttribute namespace="##local" processContents="lax"/>
    </xsd:attributeGroup>
    <xsd:element name="Data">
    <xsd:complexType>
         <xsd:attributeGroup ref="DataAttributes"/>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="MA_Verify">
    <xsd:complexType>
         <xsd:sequence>
         <xsd:element ref="Data" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
         <xsd:attributeGroup ref="verifyAttributes"/>
    </xsd:complexType>
    </xsd:element>
    I have an application which only knows the attribute names and values at runtime. (Thest attributes are string.) Therefore, I cannot define attribute names in the schema and have to use xsd:anyAttribute.
    I was able to generate all jaxb code. However, the interfaces generated for Data and DataType are basically all empty. The impl classes are empty too, since no get or set methods exist for the attribute.
    Some thoughts for handling this case, but do not know if it will work.
    (1) write some derive classes on top of the generated jaxb classes.
    (2) write customized method to handle the 'Data' element level and its attributes. Similar to parseMethod or printMethod for the javaType.
    (if there is a way)
    Can anyone give me suggestions, directions or an laternate way to handle the situation?
    Your help will be greatly appreciated.
    Ruth

    xsd:anyAttribute is not supported by JAXB.
    http://java.sun.com/xml/jaxb/users-guide/jaxb-works.html#unsupported

  • XML (un)marshalling with JAXB and "any" blocks

    I have 2 very simple XSD schema's.
    SchemaA.xsd:
    [request]-------[element_A] is xs:string
    |__(ANY)
    SchemaB.xsd:
    [body]--------[element_B] is xs:string
    The any block says that there can follow any type of xml after the element_a.
    In the xsd it is coded as: <xs:any />
    I compiled both schema's with jaxb, using this command line:
    xjc SchemaA.xsd -p test.request
    xjc SchemaB.xsd -p test.body -use-runtime test.request.impl.runtime
    I created the following code :
    test.request.ObjectFactory of1 = new test.request.ObjectFactory();
    test.body.ObjectFactory of2 = new test.body.ObjectFactory();
    Request r = of1.createRequest();
    r.setElementA("testing, element one");
    Body b = of2.createBody();
    b.setElementB("testing, element two");
    r.setAny(b);
    Marshaller m = of1.createMarshaller();
    m.marshal(r,System.out);
    And the result is what I expected:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <request><element_a>testing, element one</element_a><body><element_b>testing, element two</element_b></body></request>
    JAXB added the xml from the second schema to the first.
    Ok, so far so good. Now I'm trying to do it the other way around, I want to unmarshall that XML to objects again:
    String xml <- contains the outputted xml from the marshall (as pasted a few lines above)
    Unmarshaller um = of1.createUnmarshaller();
    Request r2 = (Request)um.unmarshal(new ByteArrayInputStream(xml.getBytes()));
    System.err.println(r2.getElementA());
    System.err.println(r2.getAny());
    The output:
    testing, element one
    null
    now, the first message is good. The second is not however...why is the "getAny" null ? I can't figure this one out. In the best possible case it should return an object that can be cast to "Body" .
    In the worst case it should just return the "<Body> ...." xml as string. But not null ...
    Any help on this is appreciated !

    JAXB does not support xs:any

  • Parsing (skipping) unknown tags with JAXB...

    Does anybody know how can I skip unrecognised tags, during unmarshalling an XML document with JAXB?
    For example : the schema-compliant document is :
    <document>
    <Version>3.20</Version>
    <Account>Account</Account>
    <Password>Password</Password>
    </document>
    and a possible modification would be :
    <document>
    <Version>3.21</Version>
    <unknowntag>aaaabbbb</unknowntag>
    <Account>Account</Account>
    <Password>Password</Password>
    </document>
    (a new unknown tag was introduced).
    so : the document is well-formed anyway (not strictly valid), but the second time a new unknown tag was introduced. I couldn't map it to a Java object (of course, because my data model could not foresee it), but I would like JAXB to skip it and have the program flow behaving exactly as the first case... ignoring this new unknown tag.
    Thanks for any answer anybody could ever give me...
    Emilio.

    Finally I found a workaround to this problem :
    I used an XSL transformation from the incoming document into itself, according to the pattern matching provided by an xsl stylesheet, before giving it to JAXB. Definitely an XSL specular preprocessor (wow! sound cool!).
    That is :
    having an incoming XML document, I write an XSL stylesheet that transforms the original XML document into another XML having the same tags (that is... itself).
    In this way, I can then give to JAXB a resulting XML document that contains ONLY those tags that I was expecting it to elaborate, since all the others (the unknown ones) were discarded by the xsl preprocessor.
    And... that's it.
    In this way I finally wrote an application able to skip unrecognized tags and elaborating by JAXB only the know ones. And that's what I was looking for :-)
    Hope it could help you.
    Bye,
    emils.

  • [ERROR] javaType customization in this context must be nested (JAXB spec

    Hi All,
    when i was trying to generate java classes from schema xjc is giving the below error.
    parsing a schema...
    [ERROR] <javaType> customization in this context must be nested (JAXB spec
    <property>
    <baseType>
    <javaType ...>
    </baseType>
    </property>
    Failed to parse a schema.
    my annotation goes like this for an attribute.
    <xs:attribute name="content_id" type="xs:string">
    <xs:annotation>
    <xs:appinfo>
         <jxb:javaType name="java.lang.Long"
    prseMethod= "javax.xml.bind.DatatypeConverter.parseLong"
    printMethod="javax.xml.bind.DatatypeConverter.printLong" />
    </xs:appinfo>
    </xs:annotation>
    </xs:attribute>
    please help me to resolve this problem
    thanks in advance
    Amar

    Hi All,
    when i was trying to generate java classes from schema xjc is giving the below error.
    parsing a schema...
    [ERROR] <javaType> customization in this context must be nested (JAXB spec
    <property>
    <baseType>
    <javaType ...>
    </baseType>
    </property>
    Failed to parse a schema.
    my annotation goes like this for an attribute.
    <xs:attribute name="content_id" type="xs:string">
    <xs:annotation>
    <xs:appinfo>
         <jxb:javaType name="java.lang.Long"
    prseMethod= "javax.xml.bind.DatatypeConverter.parseLong"
    printMethod="javax.xml.bind.DatatypeConverter.printLong" />
    </xs:appinfo>
    </xs:annotation>
    </xs:attribute>
    please help me to resolve this problem
    thanks in advance
    Amar

  • Problems generating classes with JAXB

    Does anyone know where there might be a list of known problems with generating classes from an xsd with JAXB? I have a very deep and pretty complicated xsd, and it seems some elements get generated correctly and some don't. It's very hard to find any pattern of why. Is there a limit to the number of levels deep it will go?

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

  • Alienware Gaming Computers with incomplete specs

    The new Alienware gaming computers (AA-2343CSB & A51-2443CSB) show dual graphics cards on the back image but make no mention of that on the specs.  They also make no mention of the power supply wattage which is entremely important if you ever plan to upgrade the graphics card(s). 
    Why does Bestbuy always fail with the “gaming” computers?  There is no way I would spend $2400 when I have no idea what I am getting.

    I just spent about 30 minutes talking to a customer service rep about this, and a few other questions.
    1) Power supply?  Rep told me 1100W, but was not certain.  Seems kinda important for future-proofing.
    2) Why two graphics cards on picture, but only one (ATI Radeon 5870) listed?
    3) Radeon 5870 has an HDMI output, but specs on Best Buy say no HDMI output.  Also says no S-video output, which is in line with listed specs, but not with picture, which shows 2 S-video outputs.
    4) RAM is DDR3 and ships with 6GB, but what speed?
    5) Picture appears to show dedicated audio card, but specs list integrated 7.1 support.  Is there an optical out?
    6) What are DVD drive speeds?
    Rep said he would get back to me.  Most logical explanation is that picture is just wrong, and some of the specs as well.
    As to the only reason why someone would purchase this rig here and not at Dell, Dell only offers 12 months interest-free financing and Best Buy offers 18 months with approval.

  • Automatic Vendor Evaluation - Compliance with Shipping Instructions

    Hi Gurus,
    Can anybody help me for "Compliance with Shipping Instructions".
    I have maintained the shipping instructions but i need to know where the receiving person needs to enter score for Vendor's compliance for shipping instructions before posting the GR inorder to do Vendor Evaluation.
    Thanks

    hi
    u find out what is main criteria
    if  Sub criteria is Compliance with shipping instr
    u need to find out which scoring method ur foloowing
    if it is automatic u need to maintain points score for sub criteria then system automatically will do.
    for that u need maintain Compliance with shipping  at the time of GR
                      in WHERE tab page in item .
    ok
    nani

  • Error "Please select an instance of compliance with shipping instructions "

    Dear All,
    Please provide a non manual solution to the issue ......
    Error "Please select an instance of compliance with shipping instructions "
    Regards,
    Vikas

    Done Manually .............

  • ADA Compliance with basic phones

    It looks like Verizon is out of compliance with the ADA as far as basic phones are concerned.  By requiring a data plan to use a phone with a larger screen (4" and up) they are limiting people with impaired vision to obtain a usable phone.  I am bringing this issue up with my congressmen and the ADA office as well as the ACLU to see if we can get better phones for people with visual impairment.  Verizon must comply if they provide contracts to any federal government entities.

    and vzw will say they have alternatives
    you wont win
    they have teams of lawyers
    i dont think the ada says they have to provide large screen cell phones with no data
    do they have other alternatives?
    maybe smaller screeens that have bigger text? i bet yes
    look into a jitterbug, text is huge
    why not go after the manufacturers and force them to create the phone you want?

  • Researching PC laptops that will run Premiere Pro CC. I am unfamiliar with tech specs. Please help!

    I am an independent filmmaker who is looking to invest in a better and faster laptop to accommodate Premiere Pro CC. I'm a current PC user and love it, and I am trying to stay with the PC OS. I'm not familiar with tech specs, but in my extensive research, this ASUS laptop seems to match almost all of the Adobe System Requirements for Premiere Pro CC (2014). Though, some are not mentioned, so I wasn't sure if it matches up completely.
    https://www.insight.com/insightweb/product/ASUS-X750JA-DB71-17.3%22-Core-i7-4700HQ-Windows -8-64-bit-8-GB-RAM-1-TB-HDD/X750JA-DB71/true/search
    I don't want to spend a big chunk of money on a new piece of technology if it won't be able to do what I need it to do. Please help!

    ...I totally second Bill's suggestion and information.....I did the EXACT SAME thing as he did, when my previous i7 laptop was hit by lightning and KILLED !! My "refurbished " Asus G750JW only cost $850 at the time, and arrived in a "like new" condition, with all the plastic film still on everything......it has been FLAWLESS in operation. It edits 1080p EASILY with multiple video tracks and GPU accelerated effects on the timeline.
    It is AMAZING how in just one year how much advancement has occurred in these "gaming" laptops, which can be used for video editing. However, you MUST be aware that these laptops MUST be plugged in while editing as they are "throttled" on battery power...no matter HOW you make the "power settings". Some newer models offer multiple mSATA slots, where you can create a high speed storage RAID 0 array....a Crucial mSATA 256GB SSD is only $89 right now at the "Egg".....2 or 3 of these in an MSI Dominator would provide a very fast place for your media and project files. The other, standard 2.5" SATA III port would be for your OS drive...again, a Crucial 256GB 550 SSD would be good there.
    Like Bill said....look for a refurbished, open box, or, maybe even slightly used machine that is "user upgradeable" to get the biggest bang for the buck. You will have to research VERY CAREFULLY however to insure EXACTLY which memory slots are already filled and if you have access to only SOME of the slots, or, ALL of the slots. Also, you must determine EXACTLY how the drive bays are configured. For example : one version of the MSI laptop that is a CHEAPER version still has the space for 3 separate mSATA drives,BUT, does NOT include necessary "adapters" to actually connect your OWN mSATA drives in that bay. I DID find a small RESELLER on the internet, ( in Pennsylvania, if I remember correctly) who will MODIFY a BASE model of the MSI for a VERY reasonable cost.....even LESS than it would cost to SELF upgrade !! He would add the memory to 32GB AND max out the potential for the storage configuration FOR you. With the proper "homework" you CAN find a very good machine without getting RAPED...it just takes patience, reading, and learning before pulling the trigger.
    Good Luck !!

Maybe you are looking for

  • Minetest translation does not work on my machine.

    Hey there. After trying my luck in the official Minetest forums a week ago and got nothing more than the initial “try this-and-that” thing as response in the German discussion section and no reply at all in the regular discussion section I decided to

  • Changes in Report builder 6i to 10g

    Hi all, I am currently struggling with one issue while migrating form from 6i to 10g. In 6i we were calling custom logic from block level WHEN-NEW-FORM-INSTANCE trigger and it was working fine, but when I migrated same form from 6i to 10g block level

  • Logic Pro 9 Compressor and Soundtrack Pro

    Hi, I have recently installed Mackeeper in my iMac. After everything I opened Logic Pro and it couldn't open. So I thought it could be an issue from Mackeeper, I requested a help from them and they asked me to send my report and I sent to them. Later

  • Playing movies on ipod w/ 30gb

    I got the iPod video with 30 GB yesturday and I downloaded the movie "10 things I hate about you" onto it. When I went to watch it I heard the sound but I didn't see the images that are kind of necessary to watch a movie you know?! All I saw was the

  • Jax-ws deployment

    I want to create simple (extremly simple) webservice with jax-ws, but there is no good tutorial on internet. JEE tutorial uses ant with not enough explanation. Can some body explian me step by step jaxws webservice deployment (on tomcat is better) wi