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" >

Similar Messages

  • Error Message: Can not generate mask for the LMB peripherals

    I've added a bunch of  perhipherals to my microblaze project and used the Generate Addresses button.  I get the below error messges when I try to generate a net list. ERROR:EDK:3193 - issued from TCL procedure
       "::hw_lmb_bram_if_cntlr_v2_10_b::update_syslevel_mask" line 88
        C_MASK (IPNAME:lmb_bram_if_cntlr, INSTANCE:ilmb_cntlr) - Can not generate
       mask for the LMB peripherals! An address decode mask is assigned to all LMB
       peripherals connected to the MicroBlaze processor. The address decode mask is
       based on a set of decode bits that distinguish the LMB address space from the
       OPB/PLB address space. The error message indicates that a set of decode bits
       can not be found to generate a mask. Please modify the address map of the
       slaves connected to OPB/PLB to use a common address bit.
    ERROR:EDK:1585 - IPNAME:lmb_bram_if_cntlr INSTANCE:ilmb_cntlr -
       E:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\lmb_bram_if_cntlr_v2_10_b\d
       ata\lmb_bram_if_cntlr_v2_1_0.mpd line 77 - error computing override value for
       C_MASK using tcl
    ERROR:EDK:3193 - issued from TCL procedure
       "::hw_lmb_bram_if_cntlr_v2_10_b::update_syslevel_mask" line 88
        C_MASK (IPNAME:lmb_bram_if_cntlr, INSTANCE:dlmb_cntlr) - Can not generate
       mask for the LMB peripherals! An address decode mask is assigned to all LMB
       peripherals connected to the MicroBlaze processor. The address decode mask is
       based on a set of decode bits that distinguish the LMB address space from the
       OPB/PLB address space. The error message indicates that a set of decode bits
       can not be found to generate a mask. Please modify the address map of the
       slaves connected to OPB/PLB to use a common address bit.
    ERROR:EDK:1585 - IPNAME:lmb_bram_if_cntlr INSTANCE:dlmb_cntlr -
       E:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\lmb_bram_if_cntlr_v2_10_b\d
       ata\lmb_bram_if_cntlr_v2_1_0.mpd line 77 - error computing override value for
       C_MASK using tcl I understand its complaining about the mask values, but I'm not exactly sure why.  Here is the address map it shows:Address Map for Processor microblaze_0
      (0000000000-0x00003fff) dlmb_cntlr    dlmb
      (0000000000-0x00003fff) ilmb_cntlr    ilmb
      (0x81800000-0x8180ffff) xps_intc_0    mb_plb
      (0x81c00000-0x81c0ffff) xps_ll_temac_0    mb_plb
      (0x83400000-0x8340ffff) Generic_SPI    mb_plb
      (0x83c00000-0x83c0ffff) xps_timer_0    mb_plb
      (0x84000000-0x8400ffff) RS232    mb_plb
      (0x84400000-0x8440ffff) mdm_0    mb_plb
      (0x8c000000-0x8fffffff) mpmc_0    mb_plb
      (0xfffff000-0xffffffff) xps_gpio_0    mb_plb Any thoughts?  I was unable to find another instance of this error message.

    Version 11.3 I actually figured it out, its rather odd that the generate addresses button doesn't do this automatically. It appears that the mask was set to trigger use of the cache on a single bit.  0x00800000.  I had enough devices added where automatic address generation was using the most significant bit meaning that bit was falling within other address spaces. I changed it to 0xFFFFC000.  (Basically telling it to match addresses if all address signals above 16KB are zero).  I don't know if that is the proper way to do it, but it accepted it.  Now I'm fighting with some stuff regarding an FSL bus I added that apparently isn't quite properly setup, so I haven't found out yet if the processor likes that address mask.   But the tools appear to like it.

  • Can I generate documentation for a JAR ?

    HI,
    I have the sources in a jar. Can I generate JavaDoc for the package without first extracting the jar ?
    If yes, could you provide the command line syntax ?
    Thank you,
    Vlad Grama.

    From the JDiff (http://www.jdiff.org) docs:
    JDiff also includes a script to use the classdoc application from
    http://classdoc.sourceforge.net or http://www.jensgulden.de, by Jens Gulden,
    [email protected], to call a doclet such as jdiff on a .jar file rather than on source.
    ~Matt

  • Is there any way I can create a form for Muse that will integrate with their Python backend system?

    Attention Anyone that my be able to help PLEASE
    I have a client that I am building a website for in Muse and they have a backend system thru "Python" that I am guessing runs their information. So basically im asking is there any way I can create a form for Muse that will integrate with their Python backend system? Have any ideas? I really need a large form that will work with "Python"
    Thanks A Bunch!!! Dan

    ITBobbyP hi again,
    Excel formats are not backward compatible, you need to use the proper driver.
    Arthur
    MyBlog
    Twitter

  • Generating HashCodes for Array of Doubles

    I have an arraylist of double values, say like this
    attr1 attr2 attr3 attr4
    1.0 2.0 3.0 2.5
    2.0 3.0 1.0 2.5
    I want to generate different hashcodes , so that I can insert in this hashtabe using the hashcode.
    Thanks,
    kalyan

    Ideally , I want to be able to bin the attribute values,
    say attribute1 into say 32 bins ,
    ,then again attribute2 into 32 bins
    and for the rest of attributes and t
    hen design a hash function which can map from all these bins into a hashtable with a correct index.
    I hope this is clear.
    -kalyan

  • Can RH8 generate a "running header" on all topics, with graphics?

    Can RH8 generate a "running header" on all topics? Does that use the "master page" feature? If so, can said running header also contain a graphic? My output is HTML Help, if that affects your answer.

    Hi there
    Yes, Yes and Yes!
    Yes, you may configure a header. And Yes you use the Master Page to do it. And yes the header may contain an image.
    Cheers... Rick
    Begin learning RoboHelp HTML 7 within the day - $24.95!
    Click here for Adobe Certified Captivate and RoboHelp HTML Training
    Click here for the SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • Can I be billed for my membership and pay with a check?

    My employer pays for Adobe Creative Cloud.  There will be a change in leadership shortly.  As a result our credit card will cancelled.  Can we be invoiced and send a check in?

    Unfortunately, you can only pay for your Creative Cloud membership with a valid credit card. You can either pay month-to-month without a contract at $74.99 per month, or you can enter an annual contract at $49.99 per month.

  • Sort an array of Application Class with respect to property

    class MyClass
    property string myProgram;
    property string myType;
    property string Description;
    end-class;
    Local array of MyClass &myProgArray;
    &myProgArray.Sort("D");
    I want to sort the Array in descending Order with respect to "myType".
    How to provide "myType" parameter to sort method ?
    Edited by: Mohsin on Oct 11, 2012 3:28 PM

    If you add myType to the array then you can sort on that, assuming you have different values for myType.
    According to PeopleBooks (8.51), API documentation;
    Sort(order)
    Note. This method works with arrays that have only one or two dimensions. You receive a runtime error if you try to use this method with an array that has more than two dimensions.

  • Error while generating an XML Document from XML Schema with JAXB

    Hi,
    I am following this OTN tutorial to generate the XML document from Java classes got from the XSD document.
    http://www.oracle.com/technology/pub/notes/technote_jaxb.html
    I am able to generate all the Java classes but getting error on compiling the XMLConstructor.java class which is use for generating the XML document :
    I am using JDK 1.5 and
    Oracle 10g XML Developer's Kit (XDK) Production for Java. xdk_nt_10_1_0_2_0_production
    (though these are warnings I am not able to run it.)
    Error
    C:\Prototype\classes\jaxbderived\catalog>javac -Xlint XMLConstructor.java
    warning: [path] bad path element "%CLASSPATH%": no such file or directory
    XMLConstructor.java:42: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
    journalList.add(journal);
    ^
    XMLConstructor.java:46: warning: [unchecked] unchecked call to add(E) as a membe
    r of the raw type java.util.List
    articleList.add(article);
    Thanks
    Sanjeev ([email protected])

    Use JDK 1.4.

  • 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/

  • How can I generate a component array using JBuilder?

    Now I'm using JBuilder to design my program's GUI. I wanted a JTextField array like this:nums[0]~nums[2].So I draged three JTextFields into the container at JBuilder's design view. But when I set the names of them as nums[x](x=0,1,2). I got a Error Message. It told me that I used a illegal name. How should I do, please?
    thank you a million!

    The DIO ports on a MIO will not satisfy your needs (unless you move to LV RT).
    They do not support buffered outputs.
    Your update rate (how often you can set the port and clear it) is going to be limited by how fast (a-hem slow) windows will let you iterate,
    and,
    be non-determinstic.
    You could use,
    1) LV RT with the existing board, or
    2) FieldPoint PWM module, or
    3) Arbitrary waveform generators, or
    4) HS DIO board, or
    5) use the analog output of your baord where you que-up a 0 -5V waveform of the proper shape (i.e. make sure that the duty cylce fraction of the update values are high, the rest low).
    This is just to get a PWM signal out.
    Now there is another issue. Determinism. How often do you plan on reading your inputs and making a change to you
    r PWM? If you plan on doing more often that 10/second, write your code to handle windows going out to la-la land when you expect it to be working.
    Can you tell I like LV-RT.
    I hope my ramblings have helped.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Can we generate code for Oracle 10g Release2

    hi,
    We have ODM Java Code Generator for model build using Oracle 10g Release1. Do we have ODM Code genrator for model build on Oracle10g Release2 using Oracle Data Miner 10.2. What version of JDeveloper will be required.

    Hi,
    We will be releasing a code generator in the early Summer.
    Instead of Java though, we will be generating PL/SQL packages.
    You will still be able to invoke the package via JDBC so it does not exclude Java integration.
    You will be able to generate the code from either JDeveloper (current release), SQLDeveloper or ODMr.
    More info on this as we get closer to our release.
    Thanks, Mark

  • Can I generate pdf document that has Acrojs functionality with the sdk?

    Hi, I was wondering if I can create a pdf document with Acrojs functionality in it from the sdk. I'm looking to see if I can create an application in C# that generates a pdf document with a form scripted with Acrojs. Is this possible? Thank you guys for your attention.

    >Until now, I could see the TOC on my PDF.
    Nothing has changed.
    Remember, iBA is not a PDF authoring tool.

  • I can't sign up for a game center account with my apple id email!

    I have seen one entry about this already, but it didn't give an answer. I just got an iPhone and can use my apple ID to get apps just fine. But I can't create a Game Center account. In the other thread I saw about this, someone suggested to make sure your birth year is entered in your information. I've done that but it doesn't help.
    Anyone know how I can fix this issue?

    I feel your pain. I am working on a free e-book project to raise awareness for ALS and running into the same difficulty. We have some big name celebrities lending their Names to the book and are now being forced to explore alternate distribution networks. You are not alone!

  • Can i use iCloud for connecting a mac mini with a macbook?

    I want to know if the connection between mac mini and a macbook is possible.
    Or do i have to use an i phone as well?

    Welcome to the Apple Community.
    You can sync calendars, contacts and mail between computers.
    Documents requires mobile versions of iWork to work, but If you want to upload documents that aren't for use with iOS devices this User Tip might be of interest.

Maybe you are looking for

  • I have bought pages through iTunes on my mac but now realise it was for iPad which I don't have.  How do I get pages on to my mac?

    I have bought Pages through itunes on my mac but now realise it was for ipad, which I don't have.  How do I get the app onto my Mac?

  • I can't find how to open a simple white NEW  document?

    I use Photoshop at home for designing/drawing  (usually with a Wacom Tablet) (and eventually printing) and I can see Touch has all the usual tools hanging around in very mind-bending mysterious ways but no way to OPEN NEW white document with appropri

  • ITunes Radio Access

    On my wish list for the new software update is access to iTunes Radio on my Apple TV ...AND... a "black screen" screen saver for my TV. This is a cheap and easy "throw-in" that costs them nothing. Adds a lot of value to me though.

  • Paging a Table

    Could someone help me with the code to maintain the data when paging the table. I populated the table based on the role that the user selected in a drop down. Here is my existing code. Protected Sub ddkRolesList_Select(ByVal sender As System.Object,

  • [SOLVED] PS/2 mouse not working

    I've just installed arch on 2 PCs. After upgrade, both of my PS/2 mouse doesn't work. Here's pice of my xorg: Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "ExplorerPS/2" # "Auto" Option "Device" "/dev/input/mice" # "/dev