JAXB example with marshalling first?

We have a java object (with objects and objects ...) whose instance data we would like to convert into XML files. Once we've created the XML we'd like to recreate the instances from the class files and XML files.
All the the JAXB examples (that we have come across) start with unmarshalling (DTD files and Schemas), then validate and marshall. We have only java classes (and their objects) and don't want to need to rewrite all our existing classes into DTD and schema files (or at least not by hand).
Where could we find a good JAXB example or tutorial that starts with java objects, marshals them and then unmarshals the XML? Or is there no example because it's just not possible?
Thanks in advance.
Morten

First, I would recommend not using JAXB yet. I believe it will be a VERY useful API when complete, but as it is only early release and the next version of the API may not be "API-level compatible" (quote from http://java.sun.com/xml/jaxb/index.html), I would not use it.
Now, to answer your question. I do not believe there is a tool to do what you are asking. I know the current version allows you to take an existing DTD, create a binding schema and get Java Classes from that. I am almost certain there is nothing to create a DTD from a Java Class.
I believe the intent was to be something like the IDL tools. As a DTD defines the rules for an XML doc, which itself is totally platform independent, a DTD is nothing more than a platform independent way to define a data structure. JAXB is a tool that takes that one step further and gives you a Java Bean guarenteed to be a normal bean, but also go from/to XML.

Similar Messages

  • Building J2EE examples with Ant 1.3 on WinXP

    I just installed J2EE 1.3.1 and set all environment variables according to J2EE/Ant documentation. I am trying to build the examples with Ant 1.3 and just before it tries to compile the first example, I get a "NTVDM.EXE Error while setting up environment" error window. This occurs every time I try this examples build. After I close this error window, the compiles fail mostly because the javax.ejb package classes cannot be found.
    Have I overlooked something here? Can anyone shed some insight on this problem?
    -Ryan

    Didn't think I'd be replying to so many of my own messages :-) ..., but anyway the problem with the NTVDM.EXE error message does not go away. I found that it's happens when Ant reads the system environment in the "property" task in build.xml under examples directory:
    <property environment="myenv" />
    <!--
    references to ${myenv.J2EE_HOME} and so on
    -->
    So I replaced occurences of ${myenv.<J2EE_HOME>} with the literal value, in my case, "C:\j2sdkee1.3.1" and now it works. Hope this helps.
    Cheers,
    Lakshmi.

  • Call tranasaction with skip first screen in ecc6

    Hi,
    We are doing upgrade from 4.7 to ecc 6. We are getting an error while running a report( The addition "AND SKIP FIRST SCREEN" can't be used with "CALL TRANSACTION .. USING".  ) in ecc6. This is not showing error in 4.7. Call transaction with skip first screen is fine in 4.7. But it is throwing an error in ecc6.
    Could anybody provide me the pointers to rectify this error.
    Regards,
    Ramesh

    Hi
    Did you pass all the mandatory field values to the calling transaction , Because when you use this addition you need to pass all the mandatory field values then only it works fine. Check out whether you are passing all the mandatory field values.
    Regards
    Pavan

  • I created one apple I'd when I started using the iPad.  After some days, I had to create a new apple I'd as there was some problem with the first one. Now at some places still my old apple I'd is appearing.  Pls adv how I change this to my new apple Id.

    I created one apple I'd when I started using the iPad.  After some days, I had to create a new apple id
    as there was some problem with the first one. Now at some places still my old apple Id is appearing.  Pls adv how I change this to my new apple Id.

    Anything you downloaded with the first Apple Id will forever be tied to it, and will always require it to update.
    The question here is, why did you think you needed to create a new Apple ID? What was the problem with the first one?
    To get rid of th old one, you'll need to delete everything you downloaded with it, and then sign out of the ID in several places around the iPad. 
    Go to Settings->iTunes & App Stores->Apple ID->Sign out.
    Repeat the process, for Facetime, Messages, Mail and any other App you need to sign out of.

  • How can i change the apple ID in my 2nd hand macbook air, i have no more contact with the first owner. thanks

    how can i change the apple ID in my 2nd hand macbook air, i have no more contact with the first owner. thanks
    i already have an apple ID, but it seems that the original ID is locked to the first owner.

    Perform the steps the first owner should have done for you as listed here:
    http://support.apple.com/kb/HT5189

  • Webdynpro ABAP & JAVA step by step example with screen shots

    hi experts,
    i am new in webdynpro. i want to learn webdynpro so any one plz help me how to create,how to install,connect,and how to execute plz send any documents for webdynpro ABAP & JAVA step by step examples with screen shots.it's really helpful for my carrier.
    thanks and regards,
    sapbbm.

    hi bala,
      check out this URL you have 41 sample codes and PDF of Webdynpro for JAVA.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
    Thanks
    Gopi

  • How do I sort by date with oldest first in icon view in Finder?

    In Finder, when I view "As Icons", and "Keep Arranged" by "Date Created", it sorts them in reverse date order with the most recent first. But if I try to check the "Date Created" option again over this already checked option, it doesn't ever sort in ascending date order with the oldest first. Is there any way to sort with oldest first?

    If you ever find the answer, I'd love to know as well. How odd is it that you can do this. I tried several searches for this in software hacks, and applications that let you alter icon views and the like. Can't believe the limited interest in correcting it either.
    I was looking for a way to display screen shots of various jpeg elements with files names that double as instructions in a tutorial. Icon view allowed me to see pictures in a large enough size to use as instructions with the corresponding file names. All I would have had to do was screen shots assembled into a PDF and I would have been done. Having to retype every instruction along with copy, and pasting into a new document and so forth is more than double the work for any set of pictorial instructions.
    Maybe Garage Band or some other application is the workaround until then. I'll let you know if I ever find a better workaround, or the solution.

  • If I select multiple images to apply a change to all Aperture it does so only with the first selected. Why?

    If I select multiple images to apply a change to all openings it does so only with the first selected. Why?

    You probably have Primary Selection only on.
    Aperture identifies the images you’ve selected by displaying them with a white border. When you select a group of images, the actively selected image, called the primary selection, appears with a thick white border and the rest of the selected images appear with thin white borders.
    Primary Only button: Click this button to make changes to the primary image selection only.

  • HT4623 I have purchased a Epson Workforce 435, can't AirPrint, will this work with the first gen iPad?

    I have purchased a Epson Workforce 435, can't AirPrint, will this work with the first gen iPad?

    Also i forgot to add after a night of searching how to turn the Epson Workforce 435 printer into Airprint friendly and not iPrint (which are 2 completely different things) i donwloaded a program called (AirPrint Activator) from HandyPrint. The link is below to download the software. Once i installed the application i set my printer to be shared over my Home Network (Wi-Fi Network). Once you have done that, open the AirPrint Activator application you have just downloaded, swtich it ON from OFF mode, and then you should easily see your printer name in my case EPSON Workforce 435 and then just close the application. Then go to your IOS Device like your iphone/ipad/ipod touch select a picture that you want to test print or even an attached PDF from your email, and select Print in the share button. You will then be prompted to select your printer. Your printer you automatically be recongised then just select print. And now you have a complete AirPrint ready printer with a Printer that doesnt even support the function. Im sure you can do this to all Wireless Printers, even if they came out before Apple AirPrint service launch.
    And also if you still need guidance and a video to follow from just click the Youtube link below
    http://www.youtube.com/watch?v=9r75m_VUr0E
    Download AirPrint Activator Link
    http://netputing.com/handyprint/
    I hope that this helps your question and enjoy your day
    Kind Regards
    Ahmed

  • A grid (2*2 for example) with a circle in a selected place

    Dear Forum members,
    Please tell me how to make (in swing , but NOT applet) a grid (2*2 for example) with a circle in a selected place (in one or more of the 4 cells). I want to be able to turn on and off (circle or no circle) any cell in the grid.
    Thanks
    Eran

    Doubleposted,
    http://forum.java.sun.com/thread.jsp?forum=54&thread=477343&tstart=0&trange=15

  • Content area should be a white area/page with the first/default role

    Hi All,
    Pealse help me
    When user logs in to the Portal, content area should be a white area/page with the first/default role
    Thanks,
    Jyothi.

    hi,
    simple way, create a static HTML page with your company logo (or empty page) and upload to KM, assign it to existing Home role as a KM document iview that loads first.(make entry point - yes).
    assign the role to everyone group with property -sort priority 10 for role (low compared to all other roles)
    regards,
    mahesh.

  • Error running A Simple MDB example with oc4j

    Hi All,
    I am new to OC4J, I am trying the example for MDB from OTN's site, A Simple MDB example with OC4J. When I start my OC4J on the command line > java -jar oc4j.jar
    I get the following exception:
    Error deploying file:/C:/unzipped/mdb_hello_world/build/mdb/mdb.jar homes: No lo
    cation set for Topic resource MessageDrivenBean MDB
    Error in application mdb: Error loading package at file:/C:/unzipped/mdb_hello_w
    orld/build/mdb/mdb.jar, Error deploying file:/C:/unzipped/mdb_hello_world/build/
    mdb/mdb.jar homes: No location set for Topic resource MessageDrivenBean MDB
    04/07/09 15:21:40 Error instantiating application 'mdb' at file:/C:/unzipped/mdb
    helloworld/build/mdb.ear: Error initializing ejb-module; Exception Error in ap
    plication mdb: Error loading package at file:/C:/unzipped/mdb_hello_world/build/
    mdb/mdb.jar, Error deploying file:/C:/unzipped/mdb_hello_world/build/mdb/mdb.jar
    homes: No location set for Topic resource MessageDrivenBean MDB
    04/07/09 15:21:41 Error starting HTTP-Server: Address already in use: JVM_Bind
    04/07/09 15:21:41 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
    initialized
    I have just followed all the steps provided to run the example exactly as given.
    I did add my Topic and TopicConnectionFatory entries in my jms.xml -
    <topic name="The Topic" location="jms/theTopic">
    <description>A MDB topic</description>
    </topic>
    <topic-connection-factory location="jms/theTopicConnectionFactory" />
    Here is the ejb-jar.xml given in the example:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar>
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <description>My message driven bean</description>
    <ejb-name>MDB</ejb-name>
    <ejb-class>MDB</ejb-class>
    <transaction-type>Container</transaction-type>
    <message-driven-destination>
    <destination-type>javax.jms.Topic</destination-type>
    <subscription-durability>NonDurable</subscription-durability>
    </message-driven-destination>
    <resource-ref>
    <description>The log topic where log events are broadcasted...</description>
    <res-ref-name>jms/theTopic</res-ref-name>
    <res-type>javax.jms.Topic</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <resource-ref>
    <description>The Factory used to produce connections to the log topic...</description>
    <res-ref-name>jms/theTopicConnectionFactory</res-ref-name>
    <res-type>javax.jms.TopicConnectionFactory</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>MDB</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Supports</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    Here is my orion-ejb-jar.xml:
    <?xml version="1.0"?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
    <orion-ejb-jar deployment-version="1.0.2.2" deployment-time="e7f5a3f42d">
    <enterprise-beans>
    <message-driven-deployment name="MDB" destination-location="jms/theTopic" connection-factory-location="jms/theTopicConnectionFactory">
    <resource-ref-mapping name="jms/theTopic" />
    <resource-ref-mapping name="jms/theTopicConnectionFactory" />
    </message-driven-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping name="&lt;default-ejb-caller-role&gt;" impliesAll="true" />
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>
    I don't know what is wrong. Please help me.
    Rohini

    Hello,
    I guess that you didn't define the Topic and/or TopicConnectionFactory on your OC4J
    Inside $J2EE_HOME/config (see: subfolders .../j2ee/home/config e.g.)folder are several xml files appropriate for OC4J configuration. There's also jms.xml. Please, verify this one, it should have some entries for your settings.
    Just like in an example below:
    <topic-connection-factory name="TopicConnectionFactory" location="jms/TopicConnectionFactory"/>
    <topic name="theTopic" location="jms/theTopic"/>
    The names should be the same like in your MDB deployment descriptors. It works of course after next OC4J server restart.
    I hope helped you
    Krzysztof

  • Help with my first PKGBUILD script [solved]

    Hi There
    I am trying to write my first PKGBUILD script and I am landing in a bit of trouble.  The script is short and is:
    #Contributor: iKevin <kellwood-at-ameritech.net>
    pkgname=fpm
    pkgver=0.60
    pkgrel=1
    pkgdesc="A password manager for gnome"
    url="http://fpm.sourceforge.net"
    license="GPL"
    depends=('xorg' 'gtk' 'glibc' 'libgnome' 'libxml2' 'glib')
    source=(http://heanet.dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
    md5sums=(be7655d300c306c8f962f6aad0a60cc5)
    build() {
    cd $startdir/src/$pkgname-$pkgver
    ./configure --prefix=/usr
    make || return 1
    mkdir -p $startdir/pkg/usr/bin
    make prefix=$startdir/pkg/usr install
    I haven't reach the point where it compiles.  It failes to download the file.  Oddly, when I type:
    wget http://heanet.dl.sourceforge.net/source … .60.tar.gz
    it downloads fine.  When running makepkg, the contents of ./src/fpm-0.60.tar.gz is some kind of web page.
    I have eyeballed this PKGBUILD script for a while and I can't see any problems.  Is there something special about sourceforge files?  I feel that I must have a typo because makepkg is using wget, which works by hand.
    Thanks
    Kev

    Well,
    I installed kedpm with my first working PKGBUILD script.  I was able to import my "fpm" password file.  Once I get my gnucash stuff transfered into grisbi, I will be able to switch my main machine completely to archlinux.
    I know it is trivial for you guys, but here is my script -- it might save you some typing.
    Kev
    pkgname=kedpm
    pkgver=0.4.0
    pkgrel=1
    pkgdesc="Ked Password Manager helps to manage large amounts of passwords and related information"
    url="http://kedpm.sourceforge.net/"
    depends=(python pygtk pycrypto)
    makedepends=()
    conflicts=()
    replaces=()
    backup=()
    install=
    source=(http://dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
    md5sums=('6b83a646873f8ea00af9c6403aa259bc')
    build() {
    cd $startdir
    mkdir -p pkg/usr
    cd $startdir/src/$pkgname-$pkgver
    python setup.py install --prefix=$startdir/pkg/usr

  • On a Mac v10.6.6 Firefox v3.6.13 Right click on Google Map does not bring up the drop down box, with the first item being directions from here, the right click does work on Google map when using Safari

    On a Mac v10.6.6 Firefox v3.6.13 Right click on Google Map does not bring up the drop down box, with the first item being "directions from here", the right click does work on Google map when using Safari

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 9.0 r999
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    In Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In present in Java 6 U10 and later (Linux: libnpjp2.so; Windows: npjp2.dll).
    http://java.com/en/download/faq/firefox_newplugin.xml
    See also http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html

  • Where I can find examples with OLAP DML to update the cube cells?

    Hi,
    Where I can find examples with OLAP DML to update/calculate the cube measure/cells?
    I would like to insert data into the cube by OLAP DML.
    Regards,
    TomB

    Not sure about examples but this is how you should proceed
    1. Limit all your dimension to the leaf level values.
    lmt financialperiod to '200901'
    lmt geography to 'XYZ'
    lmt product to 'LAPTOP'
    2. Limit your measure variable to one measure(this is applicable if you have more than one stored measure in the cube).
    for 10g
    lmt <cube name>prtmeasdim to '<MEASURE NAME>'
    for 11g
    lmt <cube name>measuredim to '<MEASURE NAME>'
    3. Write into the variable.
    for 10g
    <cube name>prttopvar = 100 -- this variable is created for a compressed & partitioned cube. for uncompressed cube the variable name is <cube name>_stored.
    Thanks
    Brijesh

Maybe you are looking for

  • Best practice? Loading text with XML or AS?

    I am developing some instructional material that will include some practice questions. I know of 2 ways to handle the dynamic text, but am not sure what is considered best practice in the Flash community. Is XML the best, fastest or more efficient th

  • Sapscript - box not works

    Hi, I have a Sapscript and I use box to make borders. I´m printing in a Laser printer and it´s works but in Epson LQ-1070 it doesn´t. This problem was solved once by basis but now there no basis here to help me. I tryed some configurations on SPAD an

  • The latest update has been running for 16 hours. Is that normal.

    The small window has been showing for 16 hours. It says downloading the update, and connecting to the server and it has the bar running across. How don I know when it is complete.

  • Can u help me my dvd drive not working

    Product Windows7 HP 2000 NOT BOOK PC PRODUCT NO   A7A84UA#ABA SYSTEM BIOS -F.43   can u send me i can insttal my cd & dvd hard drive

  • AD join in 802.1X envoronment

                       Hi, I'm trying to deply 802.1X on AD envorenment. when the Client gets their PC at first time, they cannot join until they authenticate on 802.1X, after they change their workgroup to our company's domain, they have to reboot. when