JAXB 1.0 and JAXB 2.0 APIs

Hi, Folks.
I've just inherited a test application that was written using JAXB 1.0. The application it tested has since moved onto JAXB 2.0 but the test application has lain dormant for the last 12 months. I now have the task of bringing the test application up to date and as you might expect, I am seeing lots of errors. I need to figure out how to convert the old to the new but all my searches for a JAXB 1.0 javadoc API document have failed. Does someone know where I can find this please?
Thanks, Max

Maybee here
http://java.sun.com/webservices/docs/1.4/api/index.html

Similar Messages

  • Bgm.ser and jaxb.properties not created

    Is there a particular reason to why the bgm.ser and jaxb.properties files are not created when a schema only consists of a simpletype and I run the binding compiler???
    The two files seem to be created when I include a 'dummy' complextype in the schema. Is a complextype needed in order for the files to be created?
    Cheers.
    Anders
    <simpleType name="Values">
        <restriction base="string">
            <enumeration value="ValueOne"/>
            <enumeration value="ValueTwo"/>
            <enumeration value="ValueThree"/>
            <enumeration value="ValueFour"/>
        </restriction>
    </simpleType>

    I've had the same exact problem! I had the property file in my JAR file properly, but the JAXBContext.newInstance( "package.name" ) call was failing - while at the same time I could load the property file via the ClassLoader just fine, by hand.
    I played around with source for the jaxb beta a bit and I think I found the problem. I recompiled the JAR file after changing the "fileSep" variable in the "searchforcontextPath" method from "file.separatorChar" to "/".
    This seemed to fix the problem. Well, the problem of it not finding the properties file that is... now I've got some kinda non-marshalable exception (but I haven't even spent 3 minutes on that problem yet, as opposed to the hours wasted on this bug).
    I'm not sure if this bug only cropped up when running under a Windows env or not (my test was running under JBoss on XP... though I was building/compiling under Linux).
    Anyway... to fix this just change that variable.. it's on line 228 (i think... i might have added some debug lines of my own in the code) of the javax/xml/bind/ContextFinder.java file. Then just re-jar it over the old JAR -- oh yeah, you'll need a few Message.property files from the jaxb-api.jar file for the new jar file to work (so make sure you unjar the old file 1st or back it up or whatnot).

  • XML and JAXB

    Hi All,
    I am planning to use Oracle XML DB 10g for persistence of XML documents and JAXB for XML-Java conversions. I would like to know
    <ul><li>     Whether this is a good approach or any better approch exists. The aim is to allow manipulation of the XML documents in XML DB tables from Java layer. </li>
    <li>What is the best way to retrieve the XMLTYPE columns using the JDBC APIs for THIN driver?</li>
    </ul>
    Thanks,
    Ramesh

    It's a bit cumbersome, but I guess as a hack , after generating your xml file, you could try just reading the input file using a regular FileReader, then writing out just the lines that start with <!doctype & <? xml > (they should be at the top right, so you know the location in the output file). Of course the efficiency for this is terrible--you're reading & writing the file all over!
    That's an interesting analogy, heh. One of the surprising things I found about JAXB is that it doesn't validate enumerations (as far as I know).

  • JAXB, element order and optional elements

    Hi,
    I am trying to write a program that depends on JAXB and I am encountering a number of problems. The first is that the party from which we get our XML data from is capable of sending the elements in a given element in any order and JAXB is very stringent about order, is there any way to override this behaviour? The next, is if an element, that has children, is marked as optional in the DTD, JAXB will treat it as mandatory which also creates problems for us as some of these type of elements are optional.
    Does anyone know when JAXB ea2 is due?

    To your second topic, this is a known bug in the EA, see
    http://developer.java.sun.com/developer/bugParade/bugs/4497267.html
    To the first topic: If you define the DTD in a way, that the element order is not fixed, then JAXB should accept that. E.g. instead of<!ELEMENT foo (a,b,c)>you could write<!ELEMENT foo ((a|b|c)*)>Of course, this is even looser, as it does not prevent you from sending multiple instances of a, b and c, and the generated code does not contain a getA, getB and getC method, but just a getContent returning a List.

  • JAXB 1.0, JAXB 2.0 and Java 6

    Hi,
    we have been using JAXB 1.0 with Java 6 and now want to introduce JAXB 2.0 side by side with JAXB 1.0.
    We were trying to replace the JAXB 1.0 libs with the JAXB 2.0 and compile our schema using the Ant xjc task with the source="1.0" option. This failed with "java.lang.NoClassDefFoundError: com/sun/xml/bind/JAXBAssertionError".
    Compiling with Java 5 worked fine, though.
    We've noted that the jaxb-xjc.jar is in fact delegating the task execution to a "1.0" subfolder, using a ParallelWorldClassLoader. It seems as though with java 6, classes outside of the jaxb-xjc.jar are not found (JAXBAssertionError lives in jaxb1-impl.jar).
    Creating a custom jaxb-xjc.jar with all content from jaxb1-impl.jar and jaxb-impl.jar included fixed the problem under java 6.
    We don't want to go that road in the long run, though...
    Does anyone have an idea what's going on? ClassLoader gurus wanted!

    I forgot to mention that when putting the impl classes into the jaxb-xjc.jar we place them below the jar's internal "1.0" folder. The "1.0" folder duplicates part of the package hierarchy and the ParallelWorldClassLoader takes care of loading the right one.
    We've also tried placing things below a "1.0" folder in the file system, which didn't work either.
    I actually do agree that we probably don't set up the classpath right (that's why we've posted the problem, after all...), the question is:
    If it works with sdk5 and we merely change to sdk6, what makes it fail? sdk6 has got the jaxb-machinery included, but in the unofficial guide (https://jaxb.dev.java.net/guide/Migrating_JAXB_2_0_applications_to_JavaSE_6.html) it says "Therefore, if you develop an application that uses JAXB 2.0 for JavaSE 5 today, the easiest way to upgrade to JavaSE 6 is to do nothing".
    In our case that statement doesn't seem to hold for the additional tweak of setting the JAXB source level to 1.0.

  • JAXM and JAXB

    How can I use JAXM and JAXB togather to build an web service application?
    Actually, I don't know how to use XML exported by Marshaller method marshal() for JAXM.
    Can you give some sample code?
    Thanks.

    There's a huge tutorial (19 chapters and 7 appendices) with the JavaTM Web Services Developer Pack 1.1 - it includes masses of samples applications.
    All the best,
    Fergus.

  • JAXB 1.0 Final: jaxb.properties not found when using custom classloader

    JDK 1.3.1 is being used.
    The scenario:
    1) jaxb jar files, jaxb generated files and application files loaded in default class loader works, however
    2) jaxb jar files, jaxb generated files and application files loaded in a custom class loader generate the following exception:
    javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package XXX
    To demonstrate here are two sample applications: a Launcher app whose job it is to start apps and a sample App1 application who needs JAXB.
    If launch is placed into a jar file named launch.jar and App1 is placed into a jar file named app1.jar (with a JAXB generated package), and both jar files are placed in a directory containing all the JAXB 1.0 jar files (dom, sax, namespace, etc) and the system is started with the following:
    jre\bin\java -cp launch.jar; testLaunch.launch
    the exception occurs.
    By way of comparison, if App1 is started directly with the following:
    jre\bin\java -cp app1.jar;jax-qname.jar;jaxb-xjc.jar;jaxb-ri.jar;jaxb-libs.jar;jaxb-api.jar;dom.jar;sax.jar;jaxp-api.jar;xercesImpl.jar;namespace.jar;ant.jar;xalan.jar testApp.app1
    the exception does not occur.
    Any help would be greatly appreciated.
    package testLaunch;
    import java.net.*;
    import java.io.*;
    public class launch extends javax.swing.JFrame
        private static URLClassLoader app1ClassLoader_; 
        private static Class  app1EntryClass_ = null;
        private static final String app1MainClassName_ = "testApp.app1";
        private Object appObj_ = null;
         static public void main(String args[])
              try {
                System.out.println("Launch Main");               
                new launch();          
                  System.exit(0);
              catch (Throwable t) {
                   t.printStackTrace();
                   System.exit(1);
         public launch()
            if (app1ClassLoader_== null)
                loadAppClassLoader();
            try{
                if (app1EntryClass_ == null)
                    app1EntryClass_ = app1ClassLoader_.loadClass(app1MainClassName_);
                if (app1EntryClass_ == null)
                    System.out.println(app1MainClassName_ + " was not found");
                else
                    appObj_ = app1EntryClass_.newInstance();
            catch(ClassNotFoundException x){
                x.printStackTrace();
            catch(Exception x){
                x.printStackTrace();
        private static void loadAppClassLoader()
            String jarPath = jarPath = System.getProperty("user.dir");
            System.out.println("jar path is: " + jarPath);
            try{
                File jarfile1 = new File(jarPath+File.separator+"app1.jar");
                File jarfile2 = new File(jarPath+File.separator+"dom.jar");
                File jarfile3 = new File(jarPath+File.separator+"jaxp-api.jar");
                File jarfile4 = new File(jarPath+File.separator+"jaxb-api.jar");
                File jarfile5 = new File(jarPath+File.separator+"jaxb-xjc.jar");
                File jarfile6 = new File(jarPath+File.separator+"jaxb-ri.jar");
                File jarfile7 = new File(jarPath+File.separator+"jaxb-libs.jar");
                File jarfile8 = new File(jarPath+File.separator+"jax-qname.jar");
                File jarfile9 = new File(jarPath+File.separator+"sax.jar");
                File jarfile10 = new File(jarPath+File.separator+"xercesImpl.jar");
                File jarfile11 = new File(jarPath+File.separator+"namespace.jar");
                File jarfile12 = new File(jarPath+File.separator+"xalan.jar");
                File jarfile13 = new File(jarPath+File.separator+"ant.jar");
                if (!jarfile1.exists())
                    System.out.println("**ERROR " + jarfile1 + " does not exist!");
                app1ClassLoader_ = new URLClassLoader( new URL[]{jarfile1.toURL(),
                                                                jarfile2.toURL(),
                                                                jarfile3.toURL(),
                                                                jarfile4.toURL(),
                                                                jarfile5.toURL(),
                                                                jarfile6.toURL(),
                                                                jarfile7.toURL(),
                                                                jarfile8.toURL(),
                                                                jarfile9.toURL(),
                                                                jarfile10.toURL(),
                                                                jarfile11.toURL(),
                                                                jarfile12.toURL(),
                                                                jarfile13.toURL()} );
            catch(Exception x){
                x.printStackTrace();
                return;
    package testApp;
    import javax.xml.bind.*; // JAXB classes
    import myGeneratedJAXBFiles;
    public class app1 extends javax.swing.JFrame
         static public void main(String args[])
              try {
                System.out.println("App1 Main");               
                new app1();           
                  System.exit(0);
              catch (Throwable t) {
                   t.printStackTrace();
                   System.exit(1);
         public app1()
            try
                JAXBContext jc_ = JAXBContext.newInstance( "myGeneratedJAXBFiles" );
                System.out.println("Successfully loaded JAXB Context");          
            catch (JAXBException jbe)
                jbe.printStackTrace();

    I'm doing something very similar. In fact my launcher is also stored in launcher.jar. It will start any application on the classpath and load dependencies jars located in the specified directory.
    The first thing you must do is specify the classloader when constructing the jaxb context:
    JAXBContext jc = JAXBContext.newInstance(xmlPackage, getClass().getClassLoader());
    After this I was still raning into the "jaxb.properties not found" exception in some situations. Basically if the class using the jaxb files is located in the same jar as jaxb.properties everything worked fine. However if the class using the jaxb objects was located in a different jar it did not work.
    I had to add the following early in the execution of the application that load the plugins to get things working correctly:
    Thread.currentThread().setContextClassLoader(jarDirClassLoader);
    As far as I can tell JAXB using the Context class loader to find the jaxb.properties file.
    I'm using JAXB 1.1
    I hope this helps!

  • Unable to capture user comments and responder in RESPOND API

    We are building a custom application that uses Oracle Workflow underneath. The application users and responsibilities have been integrated into Workflow. Notifications are acknowledged and responded to directly from the application using the PL/SQL Notification APIs.
    When using the wf_notification.respond API with the appropriate user and comment information filled in, we are still unable to capture the responder information as well as the reponders comments. In other words, the RESPONDER and USER_COMMENT fields in the WF_NOTIFICATION is blank. However, the response does seem to go through otherwise. Do we need to set some kind of user context outside of just setting the response attributes and calling the respond API? Following is the code....
    owf_mgr.wf_notification.setattrtext(p_nid,
                   'RESULT'          ,
                   'APPROVED');
    -- This procedure then caused the WF to advance to next step
    -- Respond to notification, depends on RESULT setattrtext above
    owf_mgr.wf_notification.respond(     p_nid, -- notification id     
         p_respond_comment,     -- response_comment
    p_responder     );     --responder role
    Any help is greatly appreciated.
    Thanks,
    Raj

    If you are on 11.5.10 or greater or standalone 2.6.4 if you pass the responder value to wf_notification.respond API it should be updated in wf_notifications.responder column. The comments is now updated in wf_comments table against the notification id and not wf_notifications.user_comment column.
    Thanks, Vijay

  • What are the values and meaning of PaymentStatusID and statusTypeId from the API

    What are the values of PaymentStatusID and statusTypeId from the API?
    The WSDL just list the fact tht these exists but not the values and meaning.

    Found more info on the BC site, figured I'd include it all.
    PaymentMethodType
    CreditCard = 1
    Cheque = 2
    Cash = 3
    EFT = 4
    PayPal = 5
    HostedCreditCard = 7 - like google checkout etc.
    DirectDebit = 8
    GiftVoucher = 9
    Free = 10
    PaymentStatusID
    Unknown = -1
    Succeeded = 0
    Failed = 1
    Pending = 2
    Denied = 3
    AddressTypeId  - AddressType
    Home Address = 1
    Work Addres = 2
    PO Box = 3
    Not Used = 4
    Shipping Address = 5
    Pickup Address = 6
    Storage Address = 7
    Billing Address = 8
    OrderType
    Quote = 1
    Invoiced = 2

  • Creating and Updating POs through API instead of PDOI in 11.5.10

    Hi All,
    We are doing a 11.5.10 implementation where we need to interface POs from an external system on a daily basis and have a few questions. Basically the client wants to have all the processing done using APIs (private/public) rather than using concurrent programs (standard interface programs) .
    (1) In order to create a Standard PO, should we always use the PDOI Interface program? There is no standard/public/private APIs available to CREATE POs?
    (2) There can be many times where a PO needs to be updated. During which , there can be a existing line which can be updated and there can be a new line which can be added. For adding new lines for an Existing PO, should we use the PDOI interface program in UPDATE mode and there is no APIs available to update POs (update PO as in adding new line to an existing PO?). And for updating an existing line of a PO, I am using "po_change_api1_s.update_po" as per the interface manual and this seems to be not able to handle adding of new lines.
    Have anyone used the API approach for creating/updating POs? Please let me know.
    Many thanks in advance.
    Regards,
    Srini.

    Srini,
    As far as I know there is no other way other than document interface.
    I think using interface should work for you just like an API. Client does not need to know that.After populating the interface table you can call the package PO_DOCS_INTERFACE_SV5.process_po_headers_interface or use the SQL code that is behind the concurrent program. You can pass specific interface_header_id that belongs to a specific PO (going by your grouping logic). If the PO is created, interface gets purged automatically (based on your setting). If not you can delete it as you might be having the info in your custom table (ofcourse capturing the error so that you can correct it). It has a lot of capabilities including creating item and sourcing rules on the fly. Also the functionality you are looking for to add new lines is also there.This way you never have to use a concurrent program approach (or call it batch program approach).
    FYI, even autocreate uses the same interface but implicitly.
    Thanks
    Nagamohan

  • Want the link to open EAS IN WEb mode and also the Java API details needed

    Want the link to open EAS IN WEb mode and also the Java API details needed to get it up and running.
    Kindly provide the answer if knows.
    Thanks .

    Yes, you can have single sign on enabled on multiple essbase servers,
    It works like using single userid and password across mulple servers. you can configure essbase server to read from active directory.
    you can configure css.xml file in bin folder
    sample CSS FILE
    here is an example of a css.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <css xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <spi>
    <provider>
    <msad name="msad1"> <trusted>false</trusted>
    <url>ldap://ldapserver:389/dc=CompanyName,dc=com</url>
    <userDN>CN=#######,OU=Security Accounts,OU=IT,DC=CompanyName,DC=com</userDN>
    <password>########</password>
    <authType>simple</authType>
    <identityAttribute>dn</identityAttribute>
    <user>
    <loginAttribute>sAMAccountName</loginAttribute>
    <fnAttribute>givenname</fnAttribute>
    <snAttribute>sn</snAttribute>
    <emailAttribute>mail</emailAttribute>
    <objectclass>
    </objectclass>
    </user>
    <group>
    <url>cn=LostAndFound</url>
    </group>
    </msad>
    </provider>
    </spi>
    <searchOrder>
    <el>msad1</el>
    </searchOrder>
    <token>
    <timeout>60</timeout>
    </token>
    <logger>
    <priority>ERROR</priority>
    </logger>
    </css>

  • Pros and cons of jxl api and apache poi of manipulating the excel sheet.

    i want a list of pros and cons of jxl api and apache poi of manipulating the excel sheet.
    also i need to know which one is better jxl or apache poi.

    Hi Ricardo_Lorenzo,
    Whether to go for Multiserver instances or Single server, is totally a user requirement based decison. If a user has Single website, or multiple websites (of the same nature, in terms of functionality), usually the part of same domain, then they would go for Single sever installation. One single instance will handle the requests from all the websites (if there are multiple). There would not be a clustering/failover setup within ColdFusion and can use the ColdFusion Standard or Enterprise version.
    On the other hand, if a user has multiple websites, all with different functionality and have multiple applications (may or may not) running, then they can go for Multiserver installation. Each website can be configured with individual instances. Clustering can be done within ColdFusion if needed. One would need an Enterprise license of ColdFusion for the same.
    Hope this helps.
    Regards,
    Anit Kumar

  • JAX-WS and JAXB 2.0 for ComplexTypes

    I have a simple web service method that returns a string. I want to enhance this method to return a Java object. Do I have to explicitly use JAXB and have the web service method return the marshalled data string? And then unmarshall on the client side? Or does JAX-WS handle this implicitly?
    For complex return types, what is the best practice when using JAX-WS? Are there any books out there for beginners?
    Thanks

    Maybee here
    http://java.sun.com/webservices/docs/1.4/api/index.html

  • XMLBeans and JAXB

    Can someone from BEA explain the relationship and/or differences between the proposed
    Java standard API for XML binding, JAXB, and XMLBeans? Obviously XMLBeans offers
    additional APIs, such as cursors and XQuery support (which is neat), but it seems
    to be non-standard and BEA-specific.
    In this context, are there any clear statements from BEA product marketing how
    the technology will be productized? Without that, it seems a bit dangerous to
    use...
    Thanks,
    PM

    XMLBeans and JAX-B are complementary technologies. JAX-B is a good technology
    for loading XML documents into Java objects – in constructing XMLBeans, we have
    attempted to be compatible with JAX-B naming conventions. However, JAX-B cannot
    necessarily preserve the full fidelity of XML documents, nor does it support 100%
    of schema. This is where XMLBeans is complementary - document preservation and
    support for extensibility are explicit goals of XMLBeans. Though JAX-B does not
    make this possible today, it is conceivable that XMLBeans will be an implementation
    of a future JAX-B spec as both technologies may converge together.
    Given the above statement, one may ask then why is that preserving full fidelity
    of the original XML document may be important? Consider the following advantages:
    (1) Sequencing and interleaving information is not lost in XMLBeans. There are
    schemas where you care whether <input> comes before <output> or <buy> comes before
    <sell> or the other way around. If you just give people a Java .getBuy() and
    a .getSell(), they've lost the ability to tell which came first. In XMLBeans,
    after the .get you always have the ability to grab an XML cursor on the <buy>
    and another one on the <sell> and ask which one came first.
    (2) Information that comes into wildcards are not lost in XMLBeans. Consider
    the regularly used <xsd:any> and <xsd:anyAttribute> features of schema that allow
    any data to appear in the document. With JAX-B, for example, the specification
    does not specify how an implementation handle content that it does not know how
    to map to a Java representation. But with XMLBeans, you can see where and how
    your document has been extended at the wildcards, and change or manipulate the
    wildcarded data. Furthermore, something cool is that if you have compiled schemas
    for the wildcarded data you can even coerce the wildcards to strongly-typed XMLBeans
    and keep on drilling in conveniently. A common use case for this is processing
    WSDLs: the w3c schema for WSDL uses wildcards for nearly every interesting piece
    of data in a WSDL.
    (3) Loading, modifying, and saving an XML document using XMLBeans, you won't lose
    all the "other stuff" that human beings don't want to lose on human-readable XML
    files, namely comments and all that extra pretty white space between things.
    (Unless you want to lose it; XMLBeans can be put in a mode where it is used to
    strip extra white space too.)
    (4) The architecture is set up so that 100% of schema types can correspond one-to-one
    with a Java type. This is perhaps a subtle benefit, but it is powerful because
    it means that there are "no regrets" and "no dead-ends" later. You never run
    into a schema type that can't be subclassed because of Java problems, or some
    extension that has some data that can't be accessed from Java.
    I hope this helps shed some light on the complementary relationship between XMLBeans
    and JAX-B.
    Regards,
    Samir
    "Peter Meyer" <[email protected]> wrote:
    >
    Can someone from BEA explain the relationship and/or differences between
    the proposed
    Java standard API for XML binding, JAXB, and XMLBeans? Obviously XMLBeans
    offers
    additional APIs, such as cursors and XQuery support (which is neat),
    but it seems
    to be non-standard and BEA-specific.
    In this context, are there any clear statements from BEA product marketing
    how
    the technology will be productized? Without that, it seems a bit dangerous
    to
    use...
    Thanks,
    PM

  • MyContentHandler and JAXB

    Hi folks
    I working with JAXB but need my own Parser/ContentHandler. So I set up my SAX2 parser and get the accordant XMLReader.
    final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"
    final String JAXP_SCHEMA_LOCATION = "http://java.sun.com/xml/jaxp/properties/schemaSource";
    final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"
    System.setProperty( "javax.xml.parsers.SAXParserFactory",
                                    "org.apache.xerces.jaxp.SAXParserFactoryImpl" );
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(true);
    spf.setValidating(true);
    SAXParser saxParser = spf.newSAXParser();
    try {
               saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
               saxParser.setProperty(
                         JAXP_SCHEMA_LOCATION,
                         getClass().getResource("pilotmodel.xsd").toExternalForm());
    } catch (SAXNotRecognizedException x) {
               // exception handling omitted
    XMLReader xmlReader = saxParser.getXMLReader();
    PilotmodelXMLHandler handler = new PilotmodelXMLHandler();
    xmlReader.setContentHandler(handler);
    SAXSource source = new SAXSource( xmlReader, new InputSource(in));
    JAXBContext jc = JAXBContext.newInstance("pilotmodel");
    Unmarshaller un = jc.createUnmarshaller();Parsing works fine but my ContentHandler isn't called. What am I doing wrong?
    Cheers

    Maybee here
    http://java.sun.com/webservices/docs/1.4/api/index.html

Maybe you are looking for