JAXB source

Downloaded the 1.5 WSDP code. Am I missing something? In all the jars are the class files but I don't see source code, which makes debugging difficult. Is there a separate download to get source files, or are those not available in this reference implementation?

A reply to my own message with an update just in case anyone is watching. The topic should be "ClearCase won't accept JAXB Generated Classes". The problem occurs when the generated code contains a line that is more than 8000 characters long. The static schemaFragment variable is initilized from a serialized object with a huge string value. This value can exceed 8000 characters. Rational insists that this is not a bug in their code, and offered two suggestions.
1. Edit the code to break long lines to less than 8000 characters
2. Change the file type in clear case from text to binary
Option 1. involves editing generated code :(
Option 2. involves scripting CC commands :(
On the "it would be nice side", a configuration option for xjc that requested lines no longer that x would... well... be nice.
Mike
<>

Similar Messages

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

  • JAXB, JAXB_FORMATTED_OUTPUT property, levels of indentation

    Is it possible to provide greater control over formatted output, especially indentation, than appears to be possible with the JAXB_FORMATTED_OUTPUT property?
    Currently, when I reach the 10th level of indentation, the formatted output shifts back to the left margin and restarts indentation. For a large data file, this can be disconcerting, and is definitely not what is desired.
    I cannot find any way of turning off this behavior. I found, on the web, references to a property called "com.sun.xml.bind.indentString", but when I try to set this to, for example, two spaces rather than four, it throws a PropertyException, and the Marshaller documentation does not list this as a supported property.
    Can anyone tell me if I can turn off this behavior, or change the number of levels of indentation before the left-shift-back-to-margin is triggered?
    Thanks.
    ¦{Þ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Ok, here is an SSCE to show my problem.
    First, the schema. This is a simple schema that just creates a new level of indentation for each type.
    // In this example, this schema is named testIndentationDepthSchema.xsd
    <xsd:schema
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="qualified"
      attributeFormDefault="unqualified"
      >
      <xsd:element
        name = "levelO" type = "Level0Type"
        />
      <xsd:complexType name = "Level0Type">
        <xsd:sequence>
          <xsd:element
            name = "level1"
            type = "Level1Type"
            />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name = "Level1Type">
        <xsd:sequence>
          <xsd:element
            name = "level2"
            type = "Level2Type"
            />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name = "Level2Type">
        <xsd:sequence>
          <xsd:element
            name = "level3"
            type = "Level3Type"
            />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name = "Level3Type">
        <xsd:sequence>
          <xsd:element
            name = "level4"
            type = "Level4Type"
            />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name = "Level4Type">
        <xsd:sequence>
          <xsd:element
            name = "level5"
            type = "Level5Type"
            />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name = "Level5Type">
        <xsd:sequence>
          <xsd:element
            name = "level6"
            type = "Level6Type"
            />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name = "Level6Type">
        <xsd:sequence>
          <xsd:element
            name = "level7"
            type = "Level7Type"
            />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name = "Level7Type">
        <xsd:sequence>
          <xsd:element
            name = "level8"
            type = "Level8Type"
            />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name = "Level8Type">
        <xsd:sequence>
          <xsd:element
            name = "level9"
            type = "Level9Type"
            />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name = "Level9Type">
        <xsd:sequence>
          <xsd:element
            name = "level10"
            type = "xsd:string"
            />
        </xsd:sequence>
      </xsd:complexType>
    </xsd:schema>Next, the marshalling test code.
    package jaxbIndentationTest;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.JAXBElement;
    import javax.xml.bind.JAXBException;
    import javax.xml.bind.Marshaller;
    import javax.xml.bind.Unmarshaller;
    public class JaxbIndentationTest
      public static void main( String args[] )
        Level0Type l0 = new Level0Type();
        Level1Type l1 = new Level1Type();
        Level2Type l2 = new Level2Type();
        Level3Type l3 = new Level3Type();
        Level4Type l4 = new Level4Type();
        Level5Type l5 = new Level5Type();
        Level6Type l6 = new Level6Type();
        Level7Type l7 = new Level7Type();
        Level8Type l8 = new Level8Type();
        Level9Type l9 = new Level9Type();
        l0.setLevel1( l1 );
        l1.setLevel2( l2 );
        l2.setLevel3( l3 );
        l3.setLevel4( l4 );
        l4.setLevel5( l5 );
        l5.setLevel6( l6 );
        l6.setLevel7( l7 );
        l7.setLevel8( l8 );
        l8.setLevel9( l9 );
        l9.setLevel10( "Final level" );
        try
          JAXBContext jaxbContext =
            JAXBContext.newInstance( "jaxbIndentationTest" );
          Marshaller m = jaxbContext.createMarshaller();
          System.out.println( "Marshaller class == " + m.getClass().getName() );
          m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
    //      m.setProperty( "com.sun.xml.bin.indentString", "  " );
          OutputStream os = new FileOutputStream( new File( "./exportData.xml" ) );
          JAXBElement<Level0Type> l0Element
            = (new ObjectFactory()).createLevelO( l0 );
           m.marshal( l0Element, os );
        catch (JAXBException e)
          System.out.println
            "JaxbIndentationTest::main(): " + e.getMessage()
        catch ( IOException e )
          System.out.println
            "JaxbIndentationTest::main(): " + e.getMessage()
    }The directory structure I used was as follows:
    test
      |
      +-classes (destination directory for class files)
      |
      +-src (contains schema)
          |
          +-jaxbIndentationTest (contains test code)The compiler used to run this test was jdk1.6.0_30_windows_64bit (specified by current project sw docs).
    In the test/src directory, I execute the following command to generate the jaxb source code:
    xjc -d . -p jaxbIndentationTest testIndentationDepthSchema.xsdThis generates the jaxb source code in the test/src/jaxbIndentationTest directory.
    Then, in the test directory, I execute the following commands:
    javac -d classes src/jaxbIndentationTest/*.java
    java -cp classes jaxbIndentationTest.JaxbIndentationTestThis creates the file exportData.xml in the test directory. Examining this file in a text editor with word wrap off, you will see that between tags *<level7>* and *<level8>*, the indentation returns to the left margin, and subsequent levels are indented based on the level of indentation of the previous tag.
    To show that this is in the file itself, I ran the (cygwin) command od -c exportData.xml with the following result:
    0000000   <   ?   x   m   l       v   e   r   s   i   o   n   =   "   1
    0000020   .   0   "       e   n   c   o   d   i   n   g   =   "   U   T
    0000040   F   -   8   "       s   t   a   n   d   a   l   o   n   e   =
    0000060   "   y   e   s   "   ?   >  \n   <   l   e   v   e   l   O   >
    0000100  \n                   <   l   e   v   e   l   1   >  \n
    0000120                           <   l   e   v   e   l   2   >  \n
    0000140                                               <   l   e   v   e
    0000160   l   3   >  \n
    0000200                   <   l   e   v   e   l   4   >  \n
    0000220
    0000240       <   l   e   v   e   l   5   >  \n
    0000260
    0000300           <   l   e   v   e   l   6   >  \n
    0000320
    0000340                               <   l   e   v   e   l   7   >  \n
    0000360   <   l   e   v   e   l   8   >  \n                   <   l   e
    0000400   v   e   l   9   >  \n                                   <   l
    0000420   e   v   e   l   1   0   >   F   i   n   a   l       l   e   v
    0000440   e   l   <   /   l   e   v   e   l   1   0   >  \n
    0000460       <   /   l   e   v   e   l   9   >  \n   <   /   l   e   v
    0000500   e   l   8   >  \n
    0000520
    0000540       <   /   l   e   v   e   l   7   >  \n
    0000560
    0000600               <   /   l   e   v   e   l   6   >  \n
    0000620
    0000640       <   /   l   e   v   e   l   5   >  \n
    0000660                                               <   /   l   e   v
    0000700   e   l   4   >  \n
    0000720       <   /   l   e   v   e   l   3   >  \n
    0000740               <   /   l   e   v   e   l   2   >  \n
    0000760       <   /   l   e   v   e   l   1   >  \n   <   /   l   e   v
    0001000   e   l   O   >  \n
    0001005You can clearly see that between the *<level7>* and *<level8>* tags, there are no spaces. That is, the indentation level is reset to 0 after 8 levels of indentation.
    I would appreciate any help anyone can give me in turning off this behavior, so that the indentation level does not reset.
    Thanks.
    ¦{Þ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 10g preview SerialVersionUID

    I am devloping an app using JAXB in jdev 10g. I added the JAXB libraries from JWSDP-1.3 to my project along with some jaxb source code I compiled with JWSDP. I am using JWSDP so I can use the xjc serializable extension to be able to store my classes as cmp fields.
    When I use the embedded oc4j that comes with jdev 10g preview the app works fine. When I deploy to a standalone version of the same oc4j along with the same added libraries, it also works as expected. But when I deploy to the standalone 10g oc4j preview, along with the same added libraries, using this type of code:
    ObjectFactory objFactory = new ObjectFactory();
    MyObjectType myObject = objFactory.createMyObjectType();
    I am getting an error saying:
    java.lang.InternalError: com.sun.msv.datatype.xsd.XSDatatypeImpl; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = 48001797565480860 at com.sun.xml.bind.unmarshaller.DatatypeDeserializer.deserialize(DatatypeDeserialer.java:30)
    Strangely it does not happen on most of the jaxb classes I try to invoke, only a few. I believe the error means that there is a different version some JAXB implementation classes in the OC4J preview than I added to the default embedded oc4j. Can anyone point me in the right direction on how to fix this?

    I have a little more information. The problem was being caused by a custom datatype which used the <union/> tag. I'm still a little puzzled why it works in jwsdp-1.3 and the embedded version, but not the 10g preview. Does anyone know what libraries I can move from JWSDP-1.3 into oc4j 10g preview to get the union tag to work?

  • Generating and compiling jaxb 1.0 source with jaxb 2.0 binaries

    Hi
    Does anyone know if v 2.13 is backwards compatible in terms of generating the source files for version 1 and also compiling and deploying the code?
    I am developing a project that needs to use jaxb 1.0 and jaxb 2.0 for legacy reasons. I have downloaded 2.1.3 an managed to use xjc to generate the new code (2.1) but when I try and generate the 1.0 classes I get this error
    Couldn't load Resource 1.0/com/sun/xml/bind/JAXBAssertionError.class
    java.lang.NoClassDefFoundError: com/sun/xml/bind/JAXBAssertionError
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultEx
    cutor.java:40)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
    at org.apache.tools.ant.Main.runBuild(Main.java:668)
    at org.apache.tools.ant.Main.startAnt(Main.java:187)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
    Caused by: java.lang.NoClassDefFoundError: com/sun/xml/bind/JAXBAssertionError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at com.sun.tools.xjc.Options.class$(Options.java:154)
    at com.sun.tools.xjc.Options.findServices(Options.java:482)
    at com.sun.tools.xjc.Options.<clinit>(Options.java:154)
    at com.sun.tools.xjc.XJCTask.<init>(XJCTask.java:49)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruc
    orAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegating
    onstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:49)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    at org.apache.tools.ant.Task.perform(Task.java:364)
    at org.apache.tools.ant.Target.execute(Target.java:341)
    at org.apache.tools.ant.Target.performTasks(Target.java:369)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
    And this is the ant build file
    <?xml version="1.0" encoding="windows-1252"?>
    <project name="jaxb" default="compile" basedir=".">
    <path id="classpath">
    <pathelement location="activation.jar"/>
    <pathelement location="jaxb-api.jar"/>
    <pathelement location="jaxb-impl.jar"/>
    <pathelement location="jaxb1-impl.jar"/>
    <pathelement location="jaxb-xjc.jar"/>
    <pathelement location="jsr173_1.0_api.jar"/>
    </path>
    <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
    <classpath refid="classpath"/>
    </taskdef>
    <target name="compile">
    <xjc schema="import.xsd" destdir="generated"
    package=".jaxb.importxsd" source="1.0" target="1.0" />
    </target>
    </project>
    I have checked the classpath and there is nothing untoward there and
    all the jars are in the same folder as the ant file. I thought jaxb
    2.1 is meant to be backwards compatible?
    Many thanks for your help.
    With the version of the JAXB binaries installed with the web services pack I get this error message instead
    Class com.sun.tools.xjc.XJCTask$AntElement loaded from ant loader (parentFirst)
    ResourceStream for 1.0/com/sun/tools/xjc/XJCTask$AngProgressCodeWriter.class loaded from ant loader
    BUILD FAILED
    java.lang.IncompatibleClassChangeError: Implementing class
    It seems to want to load the 1.0/com...version of xjc but has loaded the 2.0 version already.

    Hi,
    Can you please check your classpath incase there are still jaxb-ea jars in it.
    We have had such problems reported to us because of this reason.
    If the problem still persists can you pls provide more information like the stack trace the schema files etc.
    Thanks,
    Bhakti Mehta
    Sun Microsystems Inc.

  • How to marshal List Source using JAXB and xjc?

    Hi all,
    I'm having problems to marshal objects of xjc generated java classes to xml output. In detail I am facing problems to use a list of sources (List<javax.xml.transform.Source>) that's been generated.
    The schema I am using is:
    <xs:complexType name="tTestAttachment">
    <xs:sequence>
    <xs:element name="textXML" type="xs:base64Binary" xmime:expectedContentTypes="text/xml" maxOccurs="unbounded" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="TestAttachment" type="tTestAttachment" />
    ...By using xjc the java classes are generated without problems. The expectedContentTypes="text/xml" results the generation of a List<Source> parameter for the class.
    public class TTestAttachment {
    @XmlMimeType("text/xml")
    protected List<Source> textXML;
    ...Now I want to test the generated classes and marshal an object I created by the following code
    StreamSource ssrc = new StreamSource("file:D:/temp/test.xml");
    attachment.getTextXML().add(ssrc);
    attachment.getTextXML().add(ssrc);
    ObjectFactory objFactory = new ObjectFactory();
    JAXBContext jc = JAXBContext.newInstance(TTestAttachment.class);
    Marshaller marshaller = jc.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
    JAXBElement<TTestAttachment> jaxbelem = objFactory.createTestAttachment(attachment);
    marshaller.marshal(jaxbelem, new PrintWriter(System.out));
    ...But as return I just receive an error message, that StreamSource is not known to the context:
    javax.xml.bind.MarshalException
    - with linked exception:
    [javax.xml.bind.JAXBException: class javax.xml.transform.stream.StreamSource nor any of its super class is known to this context.]
    ...So now I made it known to the JAXBContext by adding it as parameter:
    JAXBContext jc = JAXBContext.newInstance(TTestAttachment.class);With the result, that I get an output but not as expected with content of the source inline but with the link to it.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ns2:TestAttachment xmlns:ns2="http://www.example.com/schema01">
    <ns2:textXML xsi:type="streamSource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <systemId>file:D:/temp/test.xml</systemId>
    </ns2:textXML>
    <ns2:textXML xsi:type="streamSource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <systemId>file:D:/temp/test.xml</systemId>
    </ns2:textXML>
    </ns2:TestAttachment>A second idea was to leave the JAXBContext as it is and add the annotation @XmlList to the attribute of the generated java class. But that also does not lead to the expected result. It included the content of the source now but whitespace separated and not as single objects. The expected result should look some like this:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <TestAttachment xmlns="http://www.example.com/schema01">
    <textXML>PD94...sbzwvbWVzc2FnZT4=</textXML>
    <textXML>PD94...sbzwvbWVzc2FnZT4=</textXML>
    </TestAttachment>By the way - when I'm using a single "text/xml" mime type element (maxOccurs="1") in the based schema everything works fine. xjc generates a single attribute of type javax.transform.Source and the marshalling works out the expected way.
    Any suggestions on how to marshal the objects correctly?
    - Thanks in advance

    Hope this link help you -
    http://chakkaradeep.com/index.php/autohosted-sharepoint-apps-deep-dive-part-2/
    Also check this link, About Autohosted Apps Preview program
    http://blogs.msdn.com/b/calvarro/archive/2014/05/20/about-autohosted-apps-preview-program.aspx
    For production, it is recommended to convert Auto Hosted to Provider Hosted App, so better prepared for it now.
    http://msdn.microsoft.com/EN-US/library/office/dn722449(v=office.15).aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • Problem validating xml file - jaxb

    hi people, I'm working with jaxb to generate Java source classes from the .xsd schemas that I have. I work with 17 schemas that, a priori, I can't modify. In those schemas there are a lot of types and structures that I can use when creating an .xml file. I've read other threads with the problem of namespaces but as a solution they provide a modification on the schemas. The generation of java source is ok, I've done custoization classes and no problem, but when I try to unmarshal an input xml file I get an error of validation:
    DefaultValidationEventHandler: [ERROR]: Probably namespace URI of tag "XFFile" is wrong (correct one is "http://ww........
    A possible xml file is :
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE XFFile><XFFile xmlns:rp210Elements="http://www.smpte-ra.org/schemes/434/200X/multiplex/S377M/2004" xmlns:s377mGroups="http://www.smpte-ra.org/schemes/434/200X/groups/S377M/2004" xmlns:s377mMux="http://www.smpte-ra.org/schemes/434/200X/multiplex/S377M/2004" xmlns:s377mTypes="http://www.smpte-ra.org/schemes/434/200X/types/S377M/2004" xmlns:s380mGroups="http://www.smpte-ra.org/schemes/434/200X/groups/S380M/2004" xmlns:s381mGroups="http://www.smpte-ra.org/schemes/434/200X/groups/S381M/200X" xmlns:s382mGroups="http://www.smpte-ra.org/schemes/434/200X/groups/S382M/200X" xmlns:s385mGroups="http://www.smpte-ra.org/schemes/434/200X/groups/S385M/2004" xmlns:s422mGroups="http://www.smpte-ra.org/schemes/434/200X/groups/S422M/200X" xmlns:s422mTypes="http://www.smpte-ra.org/schemes/434/200X/types/S422M/200X" xmlns:s423mGroups="http://www.smpte-ra.org/schemes/434/200X/groups/S423M/200X">
         <s380mGroups:ClipFramework rp210Elements:InstanceID="a6.67.7a.47.19.2f.4b.10.8f.ee.1e.59.6d.4c.f1.70" rp210Elements:LinkedGenerationID="0e.10.a8.9c.96.1c.4c.11.b1.fb.0a.a9.40.22.a4.e2">
              <rp210Elements:ClipCreationDateTime>
                   <rp210Elements:Year>2006</rp210Elements:Year>
                   <rp210Elements:Month>4</rp210Elements:Month>
                   <rp210Elements:Day>18</rp210Elements:Day>
                   <rp210Elements:Hour>12</rp210Elements:Hour>
                   <rp210Elements:Minute>0</rp210Elements:Minute>
                   <rp210Elements:Second>0</rp210Elements:Second>
                   <rp210Elements:mSec4>0</rp210Elements:mSec4></rp210Elements:ClipCreationDateTime>
              <rp210Elements:FrameworkExtendedTextLanguageCode>fr</rp210Elements:FrameworkExtendedTextLanguageCode>
         </s380mGroups:ClipFramework>
    </XFFile>
    I think it's ok because someone has provided it to my company but I can't validate it because it takes elements from many schemas (am I wrong and I can?)
    i can't post the schemas because of the copyrights (damn it). I'm not asking for a solution but if someone has an idea or has had a similar problema.. I'll appreciate all comments, thanks
    Jordi
    Message was edited by:
    WuWei

    In the schema root element xs:schema add namespace declaration.
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    In the XML document root element add xmlns:xsi and xsi:noNamespaceSchemaLocation attributes.
    <root_element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://c:/testing.xsd">

  • JAXB compiler problem in handling xsd:any and nillble = "true"

    Dear all,
    i am using jdeveloper 10.1.3.1 production release version.
    i am designing a xml schema that contain element of attribute nillable="true", for extensible, contain tag <xsd:any>.
    but i encounter 2 problem:
    1. for xml schema element with attribute nillable="true", no corresponding isNil(), setNil
    method is generated (refer to jaxb 1.0 spec. 5.7.1)
    2. cannot handle tag <xs:any> that generate incorrect java source code (cannot compile) [refer to jaxb 1.0 spec 5.9.5)
    *** i have add jaxb customization tag inside the <xs:any> tag
    ***   <xs:annotation><xs:appinfo>
    ***               <jaxb:property name="Extension"/>
    ***</xs:appinfo></xs:annotation>
    Does oracle's JAXB implementation conform to the JAXB 1.0 spec?
    Is it a known bug?
    Could anybody help me?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Refer to section
    E.2 Not Required XML Schema
    concepts
    "A JAXB implementation is not required to support the following XML Schema
    concepts for this version of the specification. A JAXB implementation may
    choose to support these features in an implementation dependent manner."
    E.2.2 Not supported while manipulating the XML
    content
    Schema component: wildcard
    (any)
    how can i know if an xml element with xsi:nil="true" (unmarshal)
    and set xsi:nil="true" for an element (marshal) ?
    According to the JAXB 1.0 specification:
    If {nillable} is "true", the methods setNil() and isNil() are
    generated.

  • How to install and run a JAXB example

    I have given a work to install and run an example of JAXB. I didn't have any idea about it.
    What is the procedure and the necessary fiels are needed to download, so that JAXB program can run.....
    Please some one help me out.
    Thanks

    At first I used an xjc.bat command to generate JAXB Java classes from the source XML Schema
    C:\jwsdp-1.3\jaxb\bin\xjc.bat po.xsd -p primer.po
    It works, and created the Java files. But when i try to compile it like this
    C:\jwsdp-1.3\jaxb\bin\javac Main.java primer\po\*.java primer\po\impl\*.java
    it genertaes 100 errors and prompting that package java.xml.bind does not exist.
    package com.sun.msv.verifier does not exist.
    I am not getting where is the problem,
    Please help me out ...
    Thanks

  • Unable to compile the JAXB generated java files

    Hi
    I am using JAXB 2.0 API for binding process.
    I have products.xml file as
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE PRODUCTDATA SYSTEM "products.dtd">
    <PRODUCTDATA>
    <PRODUCT PRODID="P001" CATEGORY="Books">
    <PRODUCTNAME>Gone with the wind</PRODUCTNAME>
    <DESCRIPTION>This is abt American Civil War</DESCRIPTION>
    <PRICE>25.00</PRICE>
    <QUANTITY>3</QUANTITY>
    </PRODUCT>
    </PRODUCTDATA>
    and products.xsd(Schema file) as
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="PRODUCTDATA" type="prdt"/>
    <xsd:complexType name="prdt">
    <xsd:sequence>
    <xsd:element name="PRODUCT" type="prd" maxOccurs="unbounded" />
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="prd">
    <xsd:sequence>
    <xsd:element name="PRODUCTNAME" type="xsd:string"/>
    <xsd:element name="DESCRIPTION" type="xsd:string"/>
    <xsd:element name="PRICE" type="xsd:positiveInteger"/>
    <xsd:element name="QUANTITY" type="xsd:nonNegativeInteger"/>
    </xsd:sequence>
    <xsd:attribute name="PRODID" type="pid" use="required"/>
    <xsd:attribute name="CATEGORY" type="xsd:string" use="optional"/>
    </xsd:complexType>
    <xsd:simpleType name="pid">
    <xsd:restriction base="xsd:string">
    <xsd:pattern value="[p]{1}/d{3}"/>
    <xsd:length value="4"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:schema>
    I am converting these schema file to java files by using binding compiler xjc.
    So that three java files are genearated automatically.
    1) ObjectFactory.java
    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
    // See http://java.sun.com/xml/jaxb
    // Any modifications to this file will be lost upon recompilation of the source schema.
    // Generated on: 2008.06.23 at 04:09:25 PM IST
    package testing.jaxb;
    import javax.xml.bind.JAXBElement;
    import javax.xml.bind.annotation.XmlElementDecl;
    import javax.xml.bind.annotation.XmlRegistry;
    import javax.xml.namespace.QName;
    * This object contains factory methods for each
    * Java content interface and Java element interface
    * generated in the testing.jaxb package.
    * <p>An ObjectFactory allows you to programatically
    * construct new instances of the Java representation
    * for XML content. The Java representation of XML
    * content can consist of schema derived interfaces
    * and classes representing the binding of schema
    * type definitions, element declarations and model
    * groups. Factory methods for each of these are
    * provided in this class.
    @XmlRegistry
    public class ObjectFactory {
    private final static QName PRODUCTDATAQNAME = new QName("", "PRODUCTDATA");
    * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: testing.jaxb
    public ObjectFactory() {
    * Create an instance of {@link Prd }
    public Prd createPrd() {
    return new Prd();
    * Create an instance of {@link Prdt }
    public Prdt createPrdt() {
    return new Prdt();
    * Create an instance of {@link JAXBElement }{@code <}{@link Prdt }{@code >}}
    @XmlElementDecl(namespace = "", name = "PRODUCTDATA")
    public JAXBElement<Prdt> createPRODUCTDATA(Prdt value) {
    return new JAXBElement<Prdt>(_PRODUCTDATA_QNAME, Prdt.class, null, value);
    2)Prdt.java
    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
    // See http://java.sun.com/xml/jaxb
    // Any modifications to this file will be lost upon recompilation of the source schema.
    // Generated on: 2008.06.23 at 04:09:25 PM IST
    package testing.jaxb;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlType;
    * <p>Java class for prdt complex type.
    * <p>The following schema fragment specifies the expected content contained within this class.
    * <pre>
    * <complexType name="prdt">
    * <complexContent>
    * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    * <sequence>
    * <element name="PRODUCT" type="{}prd" maxOccurs="unbounded"/>
    * </sequence>
    * </restriction>
    * </complexContent>
    * </complexType>
    * </pre>
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "prdt", propOrder = {
    "product"
    public class Prdt {
    @XmlElement(name = "PRODUCT", required = true)
    protected List<Prd> product;
    * Gets the value of the product property.
    * <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 product property.
    * <p>
    * For example, to add a new item, do as follows:
    * <pre>
    * getPRODUCT().add(newItem);
    * </pre>
    * <p>
    * Objects of the following type(s) are allowed in the list
    * {@link Prd }
    public List<Prd> getPRODUCT() {
    if (product == null) {
    product = new ArrayList<Prd>();
    return this.product;
    3) Prd.java
    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
    // See http://java.sun.com/xml/jaxb
    // Any modifications to this file will be lost upon recompilation of the source schema.
    // Generated on: 2008.06.23 at 04:09:25 PM IST
    package testing.jaxb;
    import java.math.BigInteger;
    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlAttribute;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlType;
    * <p>Java class for prd complex type.
    * <p>The following schema fragment specifies the expected content contained within this class.
    * <pre>
    * <complexType name="prd">
    * <complexContent>
    * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    * <sequence>
    * <element name="PRODUCTNAME" type="{http://www.w3.org/2001/XMLSchema}string"/>
    * <element name="DESCRIPTION" type="{http://www.w3.org/2001/XMLSchema}string"/>
    * <element name="PRICE" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
    * <element name="QUANTITY" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger"/>
    * </sequence>
    * <attribute name="CATEGORY" type="{http://www.w3.org/2001/XMLSchema}string" />
    * <attribute name="PRODID" use="required" type="{}pid" />
    * </restriction>
    * </complexContent>
    * </complexType>
    * </pre>
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "prd", propOrder = {
    "productname",
    "description",
    "price",
    "quantity"
    public class Prd {
    @XmlElement(name = "PRODUCTNAME", required = true)
    protected String productname;
    @XmlElement(name = "DESCRIPTION", required = true)
    protected String description;
    @XmlElement(name = "PRICE", required = true)
    protected BigInteger price;
    @XmlElement(name = "QUANTITY", required = true)
    protected BigInteger quantity;
    @XmlAttribute(name = "CATEGORY")
    protected String category;
    @XmlAttribute(name = "PRODID", required = true)
    protected String prodid;
    * Gets the value of the productname property.
    * @return
    * possible object is
    * {@link String }
    public String getPRODUCTNAME() {
    return productname;
    * Sets the value of the productname property.
    * @param value
    * allowed object is
    * {@link String }
    public void setPRODUCTNAME(String value) {
    this.productname = value;
    * Gets the value of the description property.
    * @return
    * possible object is
    * {@link String }
    public String getDESCRIPTION() {
    return description;
    * Sets the value of the description property.
    * @param value
    * allowed object is
    * {@link String }
    public void setDESCRIPTION(String value) {
    this.description = value;
    * Gets the value of the price property.
    * @return
    * possible object is
    * {@link BigInteger }
    public BigInteger getPRICE() {
    return price;
    * Sets the value of the price property.
    * @param value
    * allowed object is
    * {@link BigInteger }
    public void setPRICE(BigInteger value) {
    this.price = value;
    * Gets the value of the quantity property.
    * @return
    * possible object is
    * {@link BigInteger }
    public BigInteger getQUANTITY() {
    return quantity;
    * Sets the value of the quantity property.
    * @param value
    * allowed object is
    * {@link BigInteger }
    public void setQUANTITY(BigInteger value) {
    this.quantity = value;
    * Gets the value of the category property.
    * @return
    * possible object is
    * {@link String }
    public String getCATEGORY() {
    return category;
    * Sets the value of the category property.
    * @param value
    * allowed object is
    * {@link String }
    public void setCATEGORY(String value) {
    this.category = value;
    * Gets the value of the prodid property.
    * @return
    * possible object is
    * {@link String }
    public String getPRODID() {
    return prodid;
    * Sets the value of the prodid property.
    * @param value
    * allowed object is
    * {@link String }
    public void setPRODID(String value) {
    this.prodid = value;
    Next step is to compile these three files
    So I am compiling these three files it gives me compiler error as:
    testing/jaxb/ObjectFactory.java:31: illegal character: \64
    @XmlRegistry
    ^
    testing/jaxb/ObjectFactory.java:63: illegal character: \64
    @XmlElementDecl(namespace = "", name = "PRODUCTDATA")
    ^
    testing/jaxb/ObjectFactory.java:65: <identifier> expected
    return new JAXBElement<Prdt>(_PRODUCTDATA_QNAME, Prdt.class, null, value
    ^
    testing/jaxb/ObjectFactory.java:65: <identifier> expected
    return new JAXBElement<Prdt>(_PRODUCTDATA_QNAME, Prdt.class, null, value
    ^
    testing/jaxb/ObjectFactory.java:65: '{' expected
    return new JAXBElement<Prdt>(_PRODUCTDATA_QNAME, Prdt.class, null, value
    ^
    testing/jaxb/Prdt.java:38: illegal character: \64
    @XmlAccessorType(XmlAccessType.FIELD)
    ^
    testing/jaxb/Prdt.java:39: illegal character: \64
    @XmlType(name = "prdt", propOrder = {
    ^
    testing/jaxb/Prdt.java:44: illegal character: \64
    @XmlElement(name = "PRODUCT", required = true)
    ^
    testing/jaxb/Prdt.java:45: <identifier> expected
    protected List<Prd> product;
    ^
    testing/jaxb/Prdt.java:69: <identifier> expected
    public List<Prd> getPRODUCT() {
    ^
    testing/jaxb/Prdt.java:75: ';' expected
    ^
    testing/jaxb/Prd.java:43: illegal character: \64
    @XmlAccessorType(XmlAccessType.FIELD)
    ^
    testing/jaxb/Prd.java:44: illegal character: \64
    @XmlType(name = "prd", propOrder = {
    ^
    testing/jaxb/Prd.java:52: illegal character: \64
    @XmlElement(name = "PRODUCTNAME", required = true)
    ^
    testing/jaxb/Prd.java:53: <identifier> expected
    protected String productname;
    ^
    testing/jaxb/Prd.java:54: illegal character: \64
    @XmlElement(name = "DESCRIPTION", required = true)
    ^
    testing/jaxb/Prd.java:55: <identifier> expected
    protected String description;
    ^
    testing/jaxb/Prd.java:56: illegal character: \64
    @XmlElement(name = "PRICE", required = true)
    ^
    testing/jaxb/Prd.java:57: <identifier> expected
    protected BigInteger price;
    ^
    testing/jaxb/Prd.java:58: illegal character: \64
    @XmlElement(name = "QUANTITY", required = true)
    ^
    testing/jaxb/Prd.java:59: <identifier> expected
    protected BigInteger quantity;
    ^
    testing/jaxb/Prd.java:60: illegal character: \64
    @XmlAttribute(name = "CATEGORY")
    ^
    testing/jaxb/Prd.java:61: <identifier> expected
    protected String category;
    ^
    testing/jaxb/Prd.java:62: illegal character: \64
    @XmlAttribute(name = "PRODID", required = true)
    ^
    testing/jaxb/Prd.java:63: <identifier> expected
    protected String prodid;
    ^
    25 errors
    I want all three files to compiled successfully.If it is compiled only then I will continue on Unmarshalling process

    I suspect you are trying to compile the files one by one. You may also be trying to compile them disregarding the package structure.
    From your post, I gather these files are in the package: com.geindustrial.sqms
    Therefore, if they are not so already, put them under a directory structure:
    com/geindustrial/sqms
    and then compile with:
    javac com/geindustrial/sqms/AddCtq.java com/geindustrial/sqms/Ctq.java com/geindustrial/sqms/VariableData.java
    (The above is all on one line.)
    HTH,
    Manuel Amago.

  • JAXB Implemetation

    Hi All,
    I have a few doubts related to the above mentioned topic. Any help would be greatly appreciated.
    Doubt 1
    We are trying to use JAXB to implement Mapping Program in Java. I was wondering as to how and where should we put those files in the XI server.
    To explain it further :
    We have extracted all JAXB related and Mapping Application related files into a single folder and imported that folder as an archive into the XI Framework within the Software Component Version Namespace in the Integration Builder (Design). But, the message mapping in the SXMB_MONI is showing the following stack:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:ErrorHeader xmlns:SAP="http://sap.com/exchange/MessageFormat">
      <SAP:Context />
      <SAP:Code p1="Error during mapping" p2="--- Creating Java mapping com/wk/sapcl/mf/translator/source/SourceTranslator --- Using MappingResolver with context URL /sapmnt/XD1/global/xi/mapping/ATOSTOSAP/666d2600d4e811d8c989d1fc143c3524/ --- Loaded class com.wk.sapcl.mf.translator.source.SourceTranslator --- Using MappingResolver with context URL /sapmnt/XD1/global/xi/mapping/ATOSTOSAP/666d2600d4e811d8c989d1fc143c3524/ --- Load of javax/xml/bind/UnmarshalException.class from /sapmnt/XD1/global/xi/mapping/ATOSTOSAP/666d2600d4e811d8c989d1fc143c3524/ failed. --- Class not found: javax.xml.bind.UnmarshalException --- LinkageError at RUMappingJava.instantiate(): Could not instantiate class: com/wk/sapcl/mf/translator/source/SourceTranslator javax/xml/bind/UnmarshalException --- com.sap.aii.ibrun.server.map.MappingRuntimeException: at com.sap.aii.ibrun.server.map.MappingRuntimeException.code_STYLESHEET_OR_CLASS_NOT_FOUND(MappingRuntimeException.java:91) at com.sap.aii.ibrun.server.map.RUMappingJava.instantiate(RUMappingJava.java:158) at com.sap.aii.ibrun.server.map.RUMappingJava.execute(RUMappingJava.java:41) at com.sap.aii.ibrun.server.map.RURunner.run(RURunner.java:58) at com.sap.aii.ibrun.server.map.RUManager.run(RUManager.java:66) at com.sap.aii.ibrun.sbeans.map.MappingRequestHandler.handleRequest(MappingRequestHandler.java:67) at com.sap.aii.ibrun.sbeans.map.MappingServiceImpl.processFunction(MappingServiceImpl.java:83) at com.sap.aii.ibrun.sbeans.map.XMappingServiceObjectImpl0.processFunction(XMappingServiceObjectImpl0.java:24) at com.sap.aii.ibrun.sbeans.map.MappingServiceKey.processFunction(MappingServiceKey.java:10) at java.lang.reflect.Method.invoke(Native Method) at com.inqmy.services.rfcengine.RFCDefaultRequestHandler.invokeBean(RFCDefaultRequestHandler.java:83) at com.inqmy.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:50) at com.inqmy.services.rfcengine.RFCJCOServer.handleRequest(RFCJCOServer.java:69) at com.sap.mw.jco.JCO$Server.dispatchRequest(Unknown Source) at com.sap.mw.jco.rfc.MiddlewareRFC$Server.nativeListen(Native Method) at com.sap.mw.jco.rfc.MiddlewareRFC$Server.listen(Unknown Source) at com.sap.mw.jco.JCO$Server.listen(Unknown Source) at com.sap.mw.jco.JCO$Server.run(Unknown Source) at java.lang.Thread.run(Thread.java:513) ---" p3="" p4="">MAPPING.GENERIC</SAP:Code>
      <SAP:Text language="EN">Error during mapping</SAP:Text>
      </SAP:ErrorHeader>
    SourceTranslator is the mapping program. The UnmarshalException class is available in the archive.
    Can you please suggest that whether:
    1) JAXB related files should be available in the same archive or they should be in the Global Namespace ?
    2) Any clarifications that you may be reaching seeing the above dump?
    3) Any opinions on whether to go for JAXB, DOM, SAX for the mapping programs where IDoc's are involved?
    Doubt 2
    For the JAXB environment we exported the Target XSD for FIDCCP02 IDoc Type from the Integration Builder. The segment E1FIKPF has a MaxOccurs and MinOccurs defined as 1. Now these are the following issues:
    The IDoc segment can be replicated into the message mapping editor provided by XI. Thus, there can be multiple header level segments for E1FIKPF in a single IDoc. Then does that mean that XI does not validates the resultant OutputStream from the Mapping Program against the available XSD?
    If XI validates that against the output XSD how exactly are multiple segments allowed? I have cross checked the XSD after duplicating the segment and activating that mapping (taking the XSD from the Mapping Itself) for the multiple E1FIKPF, but,  there was only a single occurrence of that segment found and that too was with MaxOccurs, MinOccurs = 1?
    To make my JAXB libraries produce the similar output(with multiple header segments in a single IDoc) as is being done in the mapping editor, I need to modify the maxOccurs for that segment(E1FIKPF) as Unbounded. Now,
    1.     Can I somehow import this modified XSD into the XI environment ? ( I doubt that we can do that???)
    2.     If we cannot import this XSD, then with the validation occurring against this XSD how would XI take care of that?
    Doubt 3
    The XSD that is generated in XI environment refers to the namespace under which the IDoc definition was imported as a default namespace. The JAXB generated XML which is based on the XSD definition is expecting the XML to be in namespace of Integration Builder.
    But the input stream (XML) coming to the JAXB classes at the time of running is containing xmlns="atostosap" in the root element. This is the namespace name for which the code is being developed. Thus it results in Unmarhsall exception indicating the expected elements should be
    [{IB Namespace}Header_element_for_datatype].
    Any information on above would be of great help....
    Thanks in Advance
    Ashish Mittal

    Also, JAXB 2.0 Compilation with Tools>JAXB Compilation would be suitable.

  • JAXB question

    DB Structure
    Parent Table - Incident --> Child Table - IncidentCharges --> Child Table of IncidentCharges --> IncidentChargeWeapons
    Container
    Oracle Containers for JAVA(OC4J)
    We have a schema (Incident.xsd) which comprises of our entire database structure. We unmarshalled the schema using JAXB to Java classes and interfaces .
    It created 2 .java classes and 2 .java interfaces for each high level tag . for eg for our Incident tag it created a Incident interface and a IncidentType Interface
    and also it created 2 classes IncidentImpl and IncidentTypeImpl . The IncidentTypeImpl has all the get and set properties we require eg. getIncidentType,
    setIncidentType,getIncidentNumber,setIncidentNumber,getOccuranceDate,setOccuranceDate etc.
    Our objective is to create a JSP page which has form fields to enter data which use these JAXB generated classes get and set properties. In other words
    we want to bind the JSP form fields to these JAXB generated classes. And once these JAXB objects are populated we want to marshal it and create a XML file with the data from those JAXB . Our database would then consume the generated XML. We tried creating a simple incident form with just 3 fields IncidentType,Occurance date and Incident Number and tried to bind these fields with the properties from IncidentTypeImpl classes using the <jsp:usebean> tag . When we deployed it to our container and tried to load the Incident.jsp page , it would not load up . Only when we cleared all the bindings it loaded up .
    Then we tried another workaround (just to get it working. Not a preferred approach) . We created another simple JAVA bean(not JAXB generated beans) which has set and get properties for the form fields and bound the form fields to it.
    On submitting the JSP page we called a servlet which takes data from our created bean and transfers it to the JAXB generated IncidentTypeImpl bean. When we deployed this the jsp page loads up and also our bean is filled with data . But the servlet bombs with this error below.
    500 Internal Server Error
    java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
    at Servlets.IncidentServlet.doPost(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)
    We have 2 questions .
    1. Can a JSP page be bound directly to this JAXB generated bean in pretty much the same way as we bind it to our own bean ? (We would like to do this so that we dont have to create duplicate classes which mirror the JAXB generated classes.)
    2. Is there something special we have to do to deploy this application to recognize the JAXB classes. Do we have to deploy some jar file for it to recognize those classes ?

    Nevermind, I have then answer to my question - use this flag - use-runtime <pkg> : suppress the generation of the impl.runtime package and simply

  • JSP and JAXB

    DB Structure
    Parent Table - Incident --> Child Table - IncidentCharges --> Child Table of IncidentCharges --> IncidentChargeWeapons
    Container
    Oracle Containers for JAVA(OC4J)
    We have a schema (Incident.xsd) which comprises of our entire database structure. We unmarshalled the schema using JAXB to Java classes and interfaces .
    It created 2 .java classes and 2 .java interfaces for each high level tag . for eg for our Incident tag it created a Incident interface and a IncidentType Interface
    and also it created 2 classes IncidentImpl and IncidentTypeImpl . The IncidentTypeImpl has all the get and set properties we require eg. getIncidentType,
    setIncidentType,getIncidentNumber,setIncidentNumber,getOccuranceDate,setOccuranceDate etc.
    Our objective is to create a JSP page which has form fields to enter data which use these JAXB generated classes get and set properties. In other words
    we want to bind the JSP form fields to these JAXB generated classes. And once these JAXB objects are populated we want to marshal it and create a XML file with the data from those JAXB . Our database would then consume the generated XML. We tried creating a simple incident form with just 3 fields IncidentType,Occurance date and Incident Number and tried to bind these fields with the properties from IncidentTypeImpl classes using the <jsp:usebean> tag . When we deployed it to our container and tried to load the Incident.jsp page , it would not load up . Only when we cleared all the bindings it loaded up .
    Then we tried another workaround (just to get it working. Not a preferred approach) . We created another simple JAVA bean(not JAXB generated beans) which has set and get properties for the form fields and bound the form fields to it.
    On submitting the JSP page we called a servlet which takes data from our created bean and transfers it to the JAXB generated IncidentTypeImpl bean. When we deployed this the jsp page loads up and also our bean is filled with data . But the servlet bombs with this error below.
    500 Internal Server Error
    java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
    at Servlets.IncidentServlet.doPost(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)
    We have 2 questions .
    1. Can a JSP page be bound directly to this JAXB generated bean in pretty much the same way as we bind it to our own bean ? (We would like to do this so that we dont have to create duplicate classes which mirror the JAXB generated classes.)
    2. Is there something special we have to do to deploy this application to recognize the JAXB classes. Do we have to deploy some jar file for it to recognize those classes ?

    I've used oracle's xdk to generate both the interfaces and the implementation classes. Next i've implemented a service class with some methods to return java classes as generated by oracle's jaxb. The return types of these service methods are interfaces, not the implementation classes.
    I can generate an adf data control for this service class, but the data control palette doesn't show the attributes for the jaxb generated classes (i have changed the bean class property in the data control description xml file).
    It's not possible to ignore the interfaces and just use the implementation classes, as the implementation classes specify their return types in interfaces. I don't want to rewrite all the generated code.

  • Jaxb is giving NullPointerException  at com.sun.xml.bind.v2.model.impl.Prop

    Hi,
    I am getting null pointer exception , i dont whether it is due to jar mismatch or what ???
    I have a stand alone application which created java classes from one schema file and , i construct xml file by
    inputting some values. It works fine in my machine. But when i deploy it our product which has tomcat6 it
    gives the following exception.
    ava.lang.NullPointerException
         at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.calcXmlName(PropertyInfoImpl.java:287)
         at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.calcXmlName(PropertyInfoImpl.java:260)
         at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl.getTypes(ElementPropertyInfoImpl.java:100)
         at com.sun.xml.bind.v2.model.impl.RuntimeElementPropertyInfoImpl.getTypes(RuntimeElementPropertyInfoImpl.java:50)
         at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.size(ElementPropertyInfoImpl.java:42)
         at java.util.AbstractList$Itr.hasNext(AbstractList.java:341)
         at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:139)
         at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)
         at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)
         at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
         at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:204)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl$1.run(JAXBContextImpl.java:343)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl$1.run(JAXBContextImpl.java:340)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:340)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:204)
         at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
         at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:589)
         at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
         at javax.xml.bind.ContextFinder.find(ContextFinder.java:381)
         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
         at com.facetime.rtgsm.extractor.GenerateXml.GenerateXmlForSkypeManagementOnly(Unknown Source)
         at com.facetime.rtgsm.extractor.JDBCToXML.getXmlStringForModalities(Unknown Source)
         at com.facetime.rtgsm.publisher.MessagePublisherClient.sendMessage(Unknown Source)
         at com.facetime.rtgsm.publisher.MessagePublisherJob.execute(Unknown Source)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
    Any help would be be grately appreciated :)

    Check whether jaxb-ri.jar is there in your class path

  • JAXB v1.0.2 and Webstart

    Hi,
    I'm trying to use JAXB within an app that is started via JNLP and WebStart.
    If i add all the JAXP jars to the JNLP file the app fails to start when JAXB calls into some xerces code that tries to access java.home.
    java.security.AccessControlException: access denied (java.util.PropertyPermission java.home read)
    /* stack trace */
         at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:95)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.getXMLReader(AbstractUnmarshallerImpl.java:80)
    If i dont put in the JAXP jars then i get the following:
    Caused by: java.lang.RuntimeException: Installation Problem??? Couldn't load messages: Can't find bundle for base name org.apache.xerces.impl.xpath.regex.message, locale en_US
         at com.sun.msv.datatype.xsd.regex.RegexParser.setLocale(RegexParser.java:132)
         at com.sun.msv.datatype.xsd.regex.RegexParser.<init>(RegexParser.java:122)
    If i put the jaxp jars in jre/lib/endorsed, then everything works - except that isnt going to work for a remote client.
    So, question is why does xerces require access to java.home ?

    I am getting essentially the same exception when running my app from command line:
    java.lang.RuntimeException: Installation Problem??? Couldn't load messages: Can't find bundle for base name org.apache.xerces.impl.xpath.rege
    x.message, locale en_US
    at com.sun.msv.datatype.xsd.regex.RegexParser.setLocale(RegexParser.java:132)
    at com.sun.msv.datatype.xsd.regex.RegexParser.<init>(RegexParser.java:122)
    at com.sun.msv.datatype.xsd.regex.ParserForXMLSchema.<init>(ParserForXMLSchema.java:71)
    [ snip ]
    The same code works find when running inside a webapp on Tomcat 5.
    Did you ever find the source of your problem, and indeed a solution?

Maybe you are looking for

  • Parent child hierarchy and measure using lookup

    Hi, I'm using OBIEE 11.1.1.5 and I have an issue with a parent child hierarchy, which is setup like case 4 in this example . When I create a simple analysis using the hierarchy and a simple measure, it works fine. But when I try to use a calculated m

  • PC Suite, no action on icons.

    Win XP Pro SP2 PC Suite: 6.82.22.0 Haveing a problem with Nokia PC Suite, I can't click on some of the icons, like "Connect to the Internet", "Manage Connections" etc. Some of them work, like the file manager, messages and contacts. Another computer

  • ITunes 7 stops playing...

    Not sure why but for some reason IT7 just stops playing. Well... It shows the song is still playing but no sound. If I pause and un-pause it comes back on. It does this constantly. Any ideas why? Any help would be appreciated.

  • Exclamation Point and Folder

    Gen 4 I believe- 20 GB click wheel When the iPod is turned on I get the logo for a second then the message "www.apple.com/support/ipod" The battery is charged. I tried to restore, after several tries it appeared to complete but no change. The update

  • Simple Function Question

    I've just followed this tutorial that scrolls horizontally through a sequences of images and works beautifully for me. (View Tutorial) However, the tutorial has 5 navigation buttons and I would only like to have 2 – a forward and back button. How can