JAXB Problem in Oracle9ias(9.0.3)

Hi,
I am getting following exception when i try to use JAXB in Oracle9ias(9.0.3).I have placed all latest JAXP and JAXB jars in j2ee\home also.
Please help me to rectify this.
Regds,
Srini.
PS:Stack trace is .....
javax.xml.bind.JAXBException: Provider com.sun.xml.bind.ContextFactory could not be instantiated: java.lang.IncompatibleClassChangeError: Implementing class
- with linked exception:
[java.lang.IncompatibleClassChangeError: Implementing class]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:118)
at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:233)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:153)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
at ezcommerce.ezjumpins._srini._ezJaxb._jspService(_ezJaxb.java:50)
[SRC:/EzCommerce/EzJumpins/Srini/ezJaxb.jsp:4]
at com.orionserver[Oracle9iAS (9.0.3.0.0) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:560)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
at java.lang.Thread.run(Thread.java:479)

Unfortunately you are in a grey area here ... by replacing jars in the OC4J/Oracle9iAS distribution you may get a working configuration but typically this is not supported by Oracle Support - they only support certified configurations. Support typically wants a vanilla distribution if there are any problems or some
sort of backport testing done by the engineering team.
You may have seen that some folks on the list got a JAXB replacement to work with 9iAS 9.0.2 ... if you want to explore this see:
JAXB Problem with App Server 9.0.2
The one issue with the above response is the jaxp jar included in the OC4J distribution is set up to work with the Oracle XML parser so replacing this will likely break other aspects of the installation despite the poster above finding that it worked in his situation.
Lastly, bear in mind in the Oracle XDK we are now shipping early versions of JAXB and plan to have a JAXB 1.0 implementation around JavaOne in the XML kit that is distributed with OC4J. This will eliminate the need to replace jar files. See:
http://otn.oracle.com/tech/xml/xdk/content.html
Hope this helps.
Mike.

Similar Messages

  • JAXB Problem: xjc gives an error

    Hello everyone,
    I would like to use JAXB to extract various information from a class of XML documents that conform to a schema. After tweaking the schema so that I avoid namespace conflicts with xjc, I settled the namespace conflicts, but I got the following error. Even if you don't have an answer, could you give me some pointers so that I can at least begin tackling the problem?
    Thank you very much!
    Here is the output of the command I ran:
    C:\Documents and Settings\Berk Kapicioglu\Desktop>xjc -p test.jaxb ownership4ADocument.xsd.xml -d work
    parsing a schema...
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
    Caused by: java.util.MissingResourceException: Can't find resource for bundle ja
    va.util.PropertyResourceBundle, key parser.cc.8
    at java.util.ResourceBundle.getObject(ResourceBundle.java:314)
    at java.util.ResourceBundle.getString(ResourceBundle.java:274)
    at com.sun.msv.datatype.xsd.regex.RegexParser.ex(RegexParser.java:138)
    at com.sun.msv.datatype.xsd.regex.ParserForXMLSchema.parseCharacterClass
    (ParserForXMLSchema.java:291)
    at com.sun.msv.datatype.xsd.regex.RegexParser.parseAtom(RegexParser.java
    :736)
    at com.sun.msv.datatype.xsd.regex.RegexParser.parseFactor(RegexParser.ja
    va:638)
    at com.sun.msv.datatype.xsd.regex.RegexParser.parseTerm(RegexParser.java
    :342)
    at com.sun.msv.datatype.xsd.regex.RegexParser.parseRegex(RegexParser.jav
    a:320)
    at com.sun.msv.datatype.xsd.regex.RegexParser.parse(RegexParser.java:158
    at com.sun.msv.datatype.xsd.regex.RegularExpression.setPattern(RegularEx
    pression.java:3040)
    at com.sun.msv.datatype.xsd.regex.RegularExpression.setPattern(RegularEx
    pression.java:3051)
    at com.sun.msv.datatype.xsd.regex.RegularExpression.<init>(RegularExpres
    sion.java:3017)
    at com.sun.msv.datatype.xsd.PatternFacet.compileRegExps(PatternFacet.jav
    a:79)
    at com.sun.msv.datatype.xsd.PatternFacet.<init>(PatternFacet.java:67)
    at com.sun.msv.datatype.xsd.TypeIncubator.derive(TypeIncubator.java:261)
    at com.sun.tools.xjc.reader.xmlschema.DatatypeBuilder.restrictionSimpleT
    ype(DatatypeBuilder.java:82)
    at com.sun.xml.xsom.impl.RestrictionSimpleTypeImpl.apply(RestrictionSimp
    leTypeImpl.java:66)
    at com.sun.tools.xjc.reader.xmlschema.DatatypeBuilder.build(DatatypeBuil
    der.java:65)
    at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder.buildPrimitiveTy
    pe(SimpleTypeBuilder.java:161)
    at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder.access$100(Simpl
    eTypeBuilder.java:50)
    at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder$Functor.checkCon
    version(SimpleTypeBuilder.java:201)
    at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder$Functor.restrict
    ionSimpleType(SimpleTypeBuilder.java:276)
    at com.sun.xml.xsom.impl.RestrictionSimpleTypeImpl.apply(RestrictionSimp
    leTypeImpl.java:66)
    at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder.build(SimpleType
    Builder.java:93)
    at com.sun.tools.xjc.reader.xmlschema.cs.DefaultClassBinder.simpleType(D
    efaultClassBinder.java:130)
    at com.sun.xml.xsom.impl.SimpleTypeImpl.apply(SimpleTypeImpl.java:89)
    at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector._bindToClass(Clas
    sSelector.java:212)
    at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector.bindToType(ClassS
    elector.java:177)
    at com.sun.tools.xjc.reader.xmlschema.TypeBuilder.elementDeclFlat(TypeBu
    ilder.java:213)
    at com.sun.tools.xjc.reader.xmlschema.FieldBuilder.elementDecl(FieldBuil
    der.java:384)
    at com.sun.xml.xsom.impl.ElementDecl.apply(ElementDecl.java:174)
    at com.sun.tools.xjc.reader.xmlschema.FieldBuilder.build(FieldBuilder.ja
    va:76)
    at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.part
    icle(DefaultParticleBinder.java:399)
    at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.applyRecursively(BGMBui
    lder.java:490)
    at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.mode
    lGroup(DefaultParticleBinder.java:462)
    at com.sun.xml.xsom.impl.ModelGroupImpl.apply(ModelGroupImpl.java:80)
    at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.buil
    d(DefaultParticleBinder.java:368)
    at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.part
    icle(DefaultParticleBinder.java:433)
    at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.buil
    d(DefaultParticleBinder.java:371)
    at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder.build(Defaul
    tParticleBinder.java:70)
    at com.sun.tools.xjc.reader.xmlschema.ct.FreshComplexTypeBuilder$1.parti
    cle(FreshComplexTypeBuilder.java:48)
    at com.sun.xml.xsom.impl.ParticleImpl.apply(ParticleImpl.java:68)
    at com.sun.tools.xjc.reader.xmlschema.ct.FreshComplexTypeBuilder.build(F
    reshComplexTypeBuilder.java:35)
    at com.sun.tools.xjc.reader.xmlschema.ct.ComplexTypeFieldBuilder.build(C
    omplexTypeFieldBuilder.java:56)
    at com.sun.tools.xjc.reader.xmlschema.FieldBuilder.complexType(FieldBuil
    der.java:228)
    at com.sun.xml.xsom.impl.ComplexTypeImpl.apply(ComplexTypeImpl.java:194)
    at com.sun.tools.xjc.reader.xmlschema.FieldBuilder.build(FieldBuilder.ja
    va:76)
    at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector.build(ClassSelect
    or.java:340)
    at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector.access$000(ClassS
    elector.java:54)
    at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector$Binding.build(Cla
    ssSelector.java:107)
    at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector.executeTasks(Clas
    sSelector.java:240)
    at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:
    118)
    at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:8
    0)
    at com.sun.tools.xjc.GrammarLoader.annotateXMLSchema(GrammarLoader.java:
    424)
    at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:130)
    at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:79)
    at com.sun.tools.xjc.Driver.run(Driver.java:177)
    at com.sun.tools.xjc.Driver._main(Driver.java:80)
    at com.sun.tools.xjc.Driver.access$000(Driver.java:46)
    at com.sun.tools.xjc.Driver$1.run(Driver.java:60)

    Hi,
    A similar error occur to me twice.
    One because pattern specification error (The pattern was incorrectly written)
    The other one was because I had in the directory JAVA_HOME\jre\lib\endorsed the files that come from JWSDP_HOME\jaxb\lib.
    This files (jaxb-api.jar, jaxb-impl.jar, jaxb-libs.jar, jaxb-xjc.jar) should only be in the directory where they come from JWSDP_HOME\jaxb\lib
    If you have them in the JAVA_HOME\jre\lib\endorsed directory try removing them from there.
    Hope I help you.

  • Problem in Oracle9iAS Installation

    I have 2 questions :
    1. I have problem in installing Oracle9iAS rel. 1.0.2.2.2.
    The Database Cache was not installed properly (tnsnames.ora was not detected).
    Is there any rules (step by step rule) on how to install the Oracle9iAS? Can I get informed?
    2. After I installed the Oracle9iAS, I found that the Oracle Forms Services version was 6i, is it true? Or actually it should be version 9i?
    Thanks for your concern in answering my questions.

    2. After I installed the Oracle9iAS, I found that the Oracle Forms Services version was 6i, is it true? Or actually it should be version 9i?The v1.x Release probably should have stayed "8i AS", and Forms and Reports is 6i. From v9.x the 9i AS is a completely different beast.
    Hth,
    Fredrik

  • JAXB problem generating java classes

    I'm doing some integration and have received a schema from the vendor the other day. When I try to generate java classes with the jaxb compiler I get this output
    parsing a schema...
    [ERROR] Property "Value" is already defined.
      line 14 of jar:file:/C:/win32app/Java/jdk6/lib/tools.jar!/com/sun/xml/internal/xsom/impl/parser/datatypes.xsd
    [ERROR] The following location is relevant to the above error
      line 384 of file:/C:/code/sca-ecr.xsd
    Failed to parse a schema.
        <xsd:complexType name="options">
            <xsd:sequence>
                <xsd:element name="option" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:simpleContent>
                            <xsd:extension base="xsd:string">
    (Line 384)                  <xsd:attribute name="value" type="xsd:string"/>
                            </xsd:extension>
                        </xsd:simpleContent>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>So, googling about this I came across these to articles that almost describes my problem.
    http://weblogs.java.net/blog/kohsuke/archive/2005/05/compiling_mathm_1.html
    https://jaxb.dev.java.net/guide/Dealing_with_errors.htmlAdding the this code did not help. Downloading JAXB 2.1.4 did not help, adding the -extension parameter still same result.
            <xsd:annotation>
              <xsd:appinfo>           
                <jaxb:property name="someAttribute" />
              </xsd:appinfo>
            </xsd:annotation>      Why is jaxb failing ? Could it be that and attribute is not allowed to be called "value" ?
    Any answers will do
    regards abq

    Well, after hours of digging I found a solution which actually was right in front of me the whole time.
    This is how I edited the schema.
        <xsd:complexType name="options">
            <xsd:sequence>
                <xsd:element name="option" maxOccurs="unbounded" >
                    <xsd:complexType>
                        <xsd:simpleContent>
                            <xsd:extension base="xsd:string">
                               <xsd:attribute name="value" type="xsd:string" >
                                  <xsd:annotation><xsd:appinfo>
                                    <jaxb:property name="realValue" />
                                  </xsd:appinfo></xsd:annotation>
                                 </xsd:attribute>
                            </xsd:extension>
                        </xsd:simpleContent>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>Before, I placed the <xsd:annotation> tag efter the first line but inside the <xsd:attribute> made much better if you would like it to work.
    When marshling an @XmlRoot object will produce valid xml code. So even though that the server have a different xml schema, they will be able to talk to each other.
    abq

  • JAXB, problems trying to run a program

    Hi!
    I made a program similar to the create marshal example from the Java Web Services Tutorial. It compiled ok, but when I try:
    java Main
    I get the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    Do you know what might be causing this problem?
    Thanks!

    I've got this problem before,
    as time limited,
    I simply extract and copy the <jwsdp_home>\jaxb\lib\jaxb_api.jar to the folder containing the Main.java.

  • JAXB: Problem generating java enums

    Hi
    I'm having som problems configuring JAXB to generate type safe enums. The schema I'm using has several structures similar to this simplified example:
        <xs:element name="Car">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="CarTypeEnumInComplexType">
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="Truck"/>
                                <xs:enumeration value="Jeep"/>
                                <xs:enumeration value="SUV"/>
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                </xs:sequence>
            </xs:complexType>
        </xs:element>In the resulting Java code CarTypeEnumInComplexType is just generated as a String value in the Car Interface.
    What I really want is a separate Java class for "CarTypeEnumInComplexType" - with constants for each enumeration value.
    However, I do not want to change the schema - as this is maintained by another company.
    For a moment I thought I'd found the solution: By setting the global binding setting "typesafeEnumBase" to "xs:string" I made JAXB generate this kind of enumeration classes in cases like this:
    <xs:simpleType name="CarTypeEnum">
            <xs:restriction base="xs:string">
                <xs:enumeration value="Truck"/>
                <xs:enumeration value="Jeep"/>
                <xs:enumeration value="SUV"/>
            </xs:restriction>
        </xs:simpleType>However, I still can't make this work for enumerations nested within a complex type as illustrated in the first example.
    I'm new to XML schemas and JAXB - so I may be missing something obvious here...
    Is there any way to make JAXB generate an enum class for "CarTypeEnumInComplexType" in my first example without altering the schema structure?
    Vidar

    Well I couldnt really find any clear documentation to this , however with this post I was able to get going in the right direction I thought I would post the solution here.
    This assumes you have some control of your schema , it doesnt solve the problem where you cant touch the schema at all.
    So first my bindings.xjb file looks like:
    <?xml version="1.0"?>
    <jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jxb:extensionBindingPrefixes="xjc">
         <jxb:bindings schemaLocation="CMSOSS.xsd" node="/xs:schema">
              <jxb:globalBindings typesafeEnumBase ="xs:string">
                   <xjc:serializable uid="12343"/>
              </jxb:globalBindings>
              <jxb:schemaBindings>
                   <jxb:package name="com.cms.oss"/>
                   <jxb:nameXmlTransform>
                        <jxb:elementName suffix="Element"/>
                   </jxb:nameXmlTransform>
              </jxb:schemaBindings>
         </jxb:bindings>
    </jxb:bindings>
    First its necessary to have the enum type defined outside of the complex type:
    <xs:simpleType name="serviceTypeEnum">
              <xs:annotation>
                   <xs:documentation>Type of service being added (RES, BUS, FAX, POTS)</xs:documentation>
              </xs:annotation>
              <xs:restriction base="xs:string">
                   <xs:enumeration value="RES"/>
                   <xs:enumeration value="BUS"/>
                   <xs:enumeration value="FAX"/>
                   <xs:enumeration value="POTS"/>
              </xs:restriction>
         </xs:simpleType>
    Then you can use the enum in your complex type in the following manner
         <xs:element name="service">
              <xs:annotation>
                   <xs:documentation>Create a service tag for each new line of service</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="phone"/>
                        <xs:element name="type" type="serviceTypeEnum">
                             <xs:annotation>
                                  <xs:documentation>Type of service being added (RES, BUS, FAX, POTS)
                                  </xs:documentation>
                             </xs:annotation>
                        </xs:element>
                        <xs:element ref="lineDevice"/>
                        <xs:element ref="LNP" minOccurs="0"/>
                        <xs:element ref="VMPIN"/>
                        <xs:element ref="location"/>
                        <xs:element name="userService" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    Some better documentation on this would sure help ... however I dont think this solves completely the original problem...
    I would think that type safe enums should be built into the specification without all this custom binding stuff.
    R
    S

  • JAXB problems unmarshalling

    I used xjc to generate a set of elements from the schema shown below:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema targetNamespace="http://www.doc.state.nc.us/doccodes" xmlns="http://www.doc.state.nc.us/doccodes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xsd:element name="codeTable" type="CodeTable"/>
         <xsd:element name="codeRequest" type="CodeRequest"/>
         <xsd:complexType name="CodeTable">
              <xsd:sequence>
                   <xsd:element name="codename" type="xsd:string"/>
                   <xsd:element name="codes" type="Codes"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="Codes">
              <xsd:sequence>
              <xsd:element name="code" type="Code" minOccurs="1" maxOccurs="unbounded"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="Code">
              <xsd:sequence>
                        <xsd:element name="identifier" type="xsd:string"/>
                        <xsd:element name="description" type="xsd:string"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="CodeRequest">
              <xsd:sequence>
                   <xsd:element name="application" type="xsd:string"/>
                   <xsd:element name="token" type="xsd:string"/>
                   <xsd:element name="codename" type="xsd:string"/>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:schema>
    I have successfully been able to marshall an xml file using the following code:
    jc = JAXBContext.newInstance( "nc.doc.nexus.code.jaxb.model");
    CodeTable codeTable = new CodeTable();
    Codes facilityCodes = new Codes();
    List<Code> codeList = facilityCodes.getCode();
    codeList.addAll(persistables); // where persistables is an ArrayList of Code objects
    codeTable.setCodes(facilityCodes);
    codeTable.setCodename("facilityCode");
    JAXBElement<CodeTable> codeTableElement = (new ObjectFactory()).createCodeTable(codeTable);
    Marshaller m = jc.createMarshaller();
    m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
    m.marshal(codeTableElement, System.out);
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    DocumentBuilder db;
    try {
    db = dbf.newDocumentBuilder();
    Document doc = db.newDocument();
    m.marshal(codeTableElement, doc);
    return doc;
    catch (ParserConfigurationException e) {
    The marshalling works just fine, and results in the following xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:codeTable xmlns="http://www.doc.state.nc.us/doccodes" xmlns:ns1="http://www.doc.state.nc.us/doccodes">
    <ns1:codename>
    facilityCode </ns1:codename>
    <ns1:codes>
    <ns1:code>
    <ns1:identifier>
    X001 </ns1:identifier>
    <ns1:description>
    DHO DISTRICT 1 </ns1:description>
    </ns1:code>
    <ns1:code>
    <ns1:identifier>
    X002 </ns1:identifier>
    <ns1:description>
    DHO DISTRICT 2 </ns1:description>
    </ns1:code>
    <ns1:code>
    <ns1:identifier>
    X003 </ns1:identifier>
    <ns1:description>
    DHO DISTRICT 3 </ns1:description>
    </ns1:code>
    </ns1:codes>
    </ns1:codeTable>
    My code to unmarshall this xml document is as follows:
    JAXBContext jc;
    try {
    jc = JAXBContext.newInstance( "nc.doc.nexus.code.jaxb.model");
    Unmarshaller unmarshaller = jc.createUnmarshaller();
    JAXBElement<CodeTable> codeTableElement =
    (JAXBElement<CodeTable>)unmarshaller.unmarshal(aDocument);
    catch (JAXBException e) {
         throw new DeserializerException(e);
    Now the problem. When I attempt to unmarshall this xml, I get the following UnmarshalException:
    unexpected element (uri:"", local:"ns1:codeTable"). Expected elements are <{http://www.doc.state.nc.us/doccodes}codeRequest>,<{http://www.doc.state.nc.us/doccodes}codeTable>
    I've made countless attempts to alter the unmarshal code in an attempt to determine if I had just coded it wrong, or whether jaxb is not able to interpret namespaces or schemas correctly. I have to assume the latter at this point. Can anybody shed any light on this?
    By the way, below is the xjc generated class CodeTable:
    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b26-ea3
    // See http://java.sun.com/xml/jaxb
    // Any modifications to this file will be lost upon recompilation of the source schema.
    // Generated on: 2007.08.22 at 10:42:51 AM EDT
    package nc.doc.nexus.code.jaxb.model;
    import javax.xml.bind.annotation.AccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlType;
    import nc.doc.nexus.code.jaxb.model.CodeTable;
    import nc.doc.nexus.code.jaxb.model.Codes;
    * <p>Java class for CodeTable complex type.
    * <p>The following schema fragment specifies the expected content contained within this class.
    * <pre>
    * <complexType name="CodeTable">
    * <complexContent>
    * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    * <sequence>
    * <element name="codename" type="{http://www.w3.org/2001/XMLSchema}string"/>
    * <element name="codes" type="{http://www.doc.state.nc.us/doccodes}Codes"/>
    * </sequence>
    * </restriction>
    * </complexContent>
    * </complexType>
    * </pre>
    @XmlAccessorType(AccessType.FIELD)
    @XmlType(name = "CodeTable", propOrder = {
    "codename",
    "codes"
    public class CodeTable {
    @XmlElement(namespace = "http://www.doc.state.nc.us/doccodes")
    protected String codename;
    @XmlElement(namespace = "http://www.doc.state.nc.us/doccodes")
    protected Codes codes;
    * Gets the value of the codename property.
    * @return
    * possible object is
    * {@link String }
    public String getCodename() {
    return codename;
    * Sets the value of the codename property.
    * @param value
    * allowed object is
    * {@link String }
    public void setCodename(String value) {
    this.codename = value;
    * Gets the value of the codes property.
    * @return
    * possible object is
    * {@link Codes }
    public Codes getCodes() {
    return codes;
    * Sets the value of the codes property.
    * @param value
    * allowed object is
    * {@link Codes }
    public void setCodes(Codes value) {
    this.codes = value;
    }

    UPDATE: I changed the unmarshal code to unmarshal a File instead of a DOM Document, and it works. This is the revelation I was hoping not to come to. I really don't want to have to serialize my Document to a file and then unmarshal that file from disk. This would not be an acceptable solution for a large J2EE application with many web services servicing 10000 clients. Does anybody know why the unmarshal method that accepts a DOM Document does not work?

  • Problems with Oracle9iAS Containers for J2EE - Developer Preview!

    Guys,
    Trying to RE-deploy an EJB CMP 2.o from JDeveloper (that used to work) to the new version of OC4J returns the following errors:
    java.io.UTFDataFormatException: Invalid UTF8 encoding.
    Wrote EJB .jar file to D:\Oracle\JDeveloper\Rehder\CommOSS\Locations\locations.jar
    Wrote EAR file to D:\Oracle\JDeveloper\Rehder\CommOSS\Locations\locations.ear
    Invoking Oracle9iAS admin tool...
    C:\JDeveloperRC2\jdk\jre\bin\javaw.exe -jar D:\Oracle\Products\O9iAS\Install\oc4jxtnd\j2ee\home\admin.jar ormi://sandro/ admin **** -deploy -file D:\Oracle\JDeveloper\Rehder\CommOSS\Locations\locations.ear -deploymentName locations
    Fatal Error: Failure to initialize EJBQL descriptors: com.sun.enterprise.deployment.xml.ParseException: Invalid UTF8 encoding.
    Auto-unpacking D:\Oracle\Products\O9iAS\Install\oc4jxtnd\j2ee\home\applications\__locations.ear... done.
    Copying default deployment descriptor from archive at D:\Oracle\Products\O9iAS\Install\oc4jxtnd\j2ee\home\applications\__locations/META-INF/orion-application.xml to deployment directory D:\Oracle\Products\O9iAS\Install\oc4jxtnd\j2ee\home\application-deployments\locations...
    Auto-deploying locations (New server version detected)...
    java.io.UTFDataFormatException: Invalid UTF8 encoding.
         int oracle.xml.parser.v2.XMLUTF8Reader.readUTF8Char(int, int)
         void oracle.xml.parser.v2.XMLUTF8Reader.fillBuffer()
         int oracle.xml.parser.v2.XMLByteReader.saveBuffer(int)
         boolean oracle.xml.parser.v2.XMLReader.fillBuffer()
         boolean oracle.xml.parser.v2.XMLReader.tryRead(char[], int, int)
         void oracle.xml.parser.v2.XMLReader.scanXMLDecl()
         void oracle.xml.parser.v2.XMLReader.pushXMLReader(java.io.InputStream, java.lang.String, java.lang.String)
         void oracle.xml.parser.v2.XMLReader.pushXMLReader(org.xml.sax.InputSource)
         void oracle.xml.parser.v2.XMLParser.parse(org.xml.sax.InputSource)
         java.util.Vector com.sun.enterprise.deployment.xml.XMLUtils.getNodesByType(java.lang.Class, java.util.Dictionary, java.io.InputStream)
         java.util.Vector com.sun.enterprise.deployment.xml.EjbBundleNode.readEjbBundleNodes(java.io.InputStream)
         com.sun.enterprise.deployment.xml.EjbBundleNode com.sun.enterprise.deployment.xml.EjbBundleNode.read(java.io.InputStream)
         com.sun.enterprise.deployment.EjbBundleDescriptor com.sun.enterprise.deployment.EjbBundleDescriptorFactory.makeEjbBundleDescriptor(java.io.InputStream, java.lang.ClassLoader, boolean)
         void com.evermind.server.ejb.deployment.EJBPackage.init(byte[], int, int, boolean)
         void com.evermind.server.ServerComponent.init()
         com.evermind.server.ejb.deployment.EJBPackage com.evermind.server.ejb.EJBPackageDeployment.getPackage()
         java.util.Map com.evermind.server.administration.ServerApplicationInstallation.finish(java.util.Map)
         java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
         void com.evermind.server.rmi.RMICallHandler.run(java.lang.Thread)
         void com.evermind.util.ThreadPoolThread.run()
    com.sun.enterprise.deployment.xml.ParseException: Invalid UTF8 encoding.
         java.util.Vector com.sun.enterprise.deployment.xml.EjbBundleNode.readEjbBundleNodes(java.io.InputStream)
         com.sun.enterprise.deployment.xml.EjbBundleNode com.sun.enterprise.deployment.xml.EjbBundleNode.read(java.io.InputStream)
         com.sun.enterprise.deployment.EjbBundleDescriptor com.sun.enterprise.deployment.EjbBundleDescriptorFactory.makeEjbBundleDescriptor(java.io.InputStream, java.lang.ClassLoader, boolean)
         void com.evermind.server.ejb.deployment.EJBPackage.init(byte[], int, int, boolean)
         void com.evermind.server.ServerComponent.init()
         com.evermind.server.ejb.deployment.EJBPackage com.evermind.server.ejb.EJBPackageDeployment.getPackage()
         java.util.Map com.evermind.server.administration.ServerApplicationInstallation.finish(java.util.Map)
         java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
         void com.evermind.server.rmi.RMICallHandler.run(java.lang.Thread)
         void com.evermind.util.ThreadPoolThread.run()
    java.lang.InstantiationException: Failure to initialize EJBQL descriptors: com.sun.enterprise.deployment.xml.ParseException: Invalid UTF8 encoding.
         void com.evermind.server.ejb.deployment.EJBPackage.init(byte[], int, int, boolean)
         void com.evermind.server.ServerComponent.init()
         com.evermind.server.ejb.deployment.EJBPackage com.evermind.server.ejb.EJBPackageDeployment.getPackage()
         java.util.Map com.evermind.server.administration.ServerApplicationInstallation.finish(java.util.Map)
         java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
         void com.evermind.server.rmi.RMICallHandler.run(java.lang.Thread)
         void com.evermind.util.ThreadPoolThread.run()
    Exit status of Oracle9iAS admin tool (-deploy): 0
    ---- Deployment finished. ---- 28/03/2002 23:43:10
    Any idea? What I should do? Wait for a more stable version of OC4J?
    Regards
    Sandro

    I am getting a similar error trying to deploy my 2.0 CMP beans. Any insight from anyone on this problem? The biggest issue is that there is no guidance on where the problem lies. I think my ejb-jar.xml file is fine, it deploys as is in Orion as well as WebLogic....

  • JAXB problem with DTD file

    Hi All,
    I just started to learn JAXB and I come to a point in which I need to run xjc on a dtd file and jxs file. The problem is that is gives me an ERROR :
    "parsing a schema...
    [ERROR] The markup in the document preceding the root element must be well-forme
    d.
    line 1 of checkbook.dtd
    This is my dtd file:
    <!ELEMENT checkbook ( transactions, balance ) >
    <!ELEMENT transactions ( deposit | check | withdrawal )* >
    <!ELEMENT deposit ( date, name, amount )>
    <!ATTLIST deposit category ( salary | interest-income | other ) #IMPLIED >
    <!ELEMENT check ( date, name, amount, ( pending | void | cleared ), memo? )>
    <!ATTLIST check number CDATA #REQUIRED category ( rent | groceries | other ) #IMPLIED >
    <!ELEMENT withdrawal ( date, amount ) >
    <!ELEMENT balance (#PCDATA) >
    <!ELEMENT date (#PCDATA ) >
    <!ELEMENT name (#PCDATA) >
    <!ELEMENT amount (#PCDATA) >
    <!ELEMENT memo (#PCDATA) >
    <!ELEMENT pending EMPTY >
    <!ELEMENT void EMPTY >
    <!ELEMENT cleared EMPTY >
    What is the problem with it?
    Need your help and THANKS in advance
    A.B

    Try adding dom4j.jar (http://www.dom4j.org/) to your classpath and compiling with the -dtd switch. E.g.:
    xjc -dtd foo.dtd
    -- Ed

  • Problem with Oracle9iAS SOAP EJB Sample

    I have tried testing the stateless/stateful EJB soap services sample in Oracle9iAS SOAP server.
    I have changed the provider.xml. Deployed that and the service.xml and put the sample.jar in the lib directory.
    when i run the testit.bat, I get the following error :
    Ouch, the call failed:
    Fault Code = SOAP-ENV:Server
    Fault String = Error in connecting to EJB [java.lang.SecurityException]
    Can anyone help me out in this ??
    Thanks in advance,
    Chhimi

    Chhimi, could you check the providers.xml you are using. Here is mine for a local OC4J:
    <deployedProviders>
    <isd:provider xmlns:isd="http://xmlns.oracle.com/soap/2001/04/deploy/provider"
    id="stateless-ejb-provider"
    class="oracle.soap.providers.ejbprov.StatelessEJBProvider">
    <isd:option key="ContextProviderURL" value="ormi://localhost:23791" />
    <isd:option key="SecurityPrincipal" value="admin" />
    <isd:option key="FullContextFactoryName" value="com.evermind.server.rmi.RMIInitialContextFactory" />
    <isd:option key="SecurityCredential" value="welcome" />
    </isd:provider>
    </deployedProviders>
    When deploying to Oracle9iAS you will likely have to change the RMI port, hostname and password. For example,
    a default 9iAS install has EJB's listening on RMI ports 3101 - 3200. For this to hook up you need to pick a port (e.g. 3102) with the appropriate host and password and it should hang together.
    What some people do is change the ports to not be dynamic and set it to a specific port as it is with the OC4J stand-alone instance. You can check out the opmnctl command in the <Oracle9iAS_home>\opmn\bin directory to reload the opmn.xml file located in the <Oracle9iAS_home>\opmn\conf directory to do this or more safely use Enterprise Manager to change the RMI ports for the OC4J instance you are using.
    Hope this helps. I have been offline for nearly a week but should be checking again regularly if you have problems.
    Mike.

  • Problem in oracle9ias

    In Hot deployment of EJBs
         If our Session beans/Entity beans use other java class files, where should these class files be stored?
         They cannot be stored along with Home/Remote classes because certain class files we use are common across all the beans and need to be placed in some common location so that all the beans can access them.
         We have placed all those common class files in WEB-INF/classes and the server does not recognize them when these class files are used in the Session beans.
         We are unable to deploy these beans as it gives 'NoClassDefFoundError' during startup.
    2. Class files accessing EJBs
    From our JSP we instantiate a class (present in WEB-INF/classes) and call a method of that class. This method accesses the Entity bean thru JNDI lookup. When we lookup for the bean HOME interface in the method, the execution stops and the no exception is caught in the catch block.

    Hi Badrinath,
    The following two links may provide you with information to help you
    solve your problem (if you haven't already "discovered" them).
    http://technet.oracle.com/products/ias/tech_tips/oc4jTech_tip_0218.html
    http://kb.atlassian.com/content/atlassian/howto/classloaders.jsp
    Hope this helps you.
    Good Luck,
    Avi.

  • JAXB problem to manage nested complex types

    Hi!
    I've defined a XSD schema to design a folder structure. So I created a complex type which contains a sequence of 'folder' type elements.
    The folder type element includes several elements and a final one which is another 'folder' type element.
    So it is easy to model a general folder structure, no matter the depth and length.
    When I compile it with JAXB to have an OO view I catch the following error:
    Nested type Folder hides an enclosing type
    The fragment of code which caused the error is:
    * Java content class for Folder complex type.
    * <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/C:/Progetti/folderschemaexample.xsd line 10)
    * <p>
    * <pre>
    * <complexType name="Folder">
    *   <complexContent>
    *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    *       <choice maxOccurs="unbounded" minOccurs="0">
    *         <element name="folder_name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    *         <element name="security" type="{}ACL"/>
    *         <element name="folder" type="{}Folder"/>
    *       </choice>
    *     </restriction>
    *   </complexContent>
    * </complexType>
    * </pre>
    */The error is raised when JAXB tries to compile a Folder interface as inner in another Folder interface (generated.Folder.Folder).
    Is any JAXB guru able to suggest me how to exit from this situation to create succesfully a JAXB compliant schema which models this folder structure?
    TIA

    Hi!
    I've defined a XSD schema to design a folder structure. So I created a complex type which contains a sequence of 'folder' type elements.
    The folder type element includes several elements and a final one which is another 'folder' type element.
    So it is easy to model a general folder structure, no matter the depth and length.
    When I compile it with JAXB to have an OO view I catch the following error:
    Nested type Folder hides an enclosing type
    The fragment of code which caused the error is:
    * Java content class for Folder complex type.
    * <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/C:/Progetti/folderschemaexample.xsd line 10)
    * <p>
    * <pre>
    * <complexType name="Folder">
    *   <complexContent>
    *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    *       <choice maxOccurs="unbounded" minOccurs="0">
    *         <element name="folder_name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    *         <element name="security" type="{}ACL"/>
    *         <element name="folder" type="{}Folder"/>
    *       </choice>
    *     </restriction>
    *   </complexContent>
    * </complexType>
    * </pre>
    */The error is raised when JAXB tries to compile a Folder interface as inner in another Folder interface (generated.Folder.Folder).
    Is any JAXB guru able to suggest me how to exit from this situation to create succesfully a JAXB compliant schema which models this folder structure?
    TIA

  • JAXB Problem

    Hi,
    Using JAXB, I need to handle some XML with a structure something like this:
    <root>
    <parent>
    <element1>A</element1>
    <element2>B</element2>
    <element3>C</element3>
    <element3>D</element4>
    </parent>
    </root>
    I can easily use JAXB to obtain an object representing the "parent" element, however to access the child elements of "parent", I seem to have to use the items() method on "parerent" which returns me a list, from which I can obtain an iterator to iterate through the elements. All the examples I have seen ot this then cast the child element to the appropriate type when getting it from the iterator, however, all the examples only ever seem to have one type of child element, so a cast can safely be used.
    I have many different possible types of child element of "parent", so I cannot cast, because I do not know which type of element I will be dealing with.
    Can anyone explain to me how this type of situation should be dealt with using JAXB?
    TIA
    Dave

    Give all the different node classes the same base class and reference them through that. This is the first thing that comes to mind.

  • Fetch error and jaxb problem in weblogic 12c

    Hi,
    I have a problem with running my webService in Weblogic 12c. The response of the webService is an entity which has an OneToMany relationship. After executing the service, its response could not be generated. I think there is a problem during MOXy’s unmarshalling operation of response entity (I haven’t had any problem in weblogic 11, because it don’t use MOXy ).
    What do you think about this problem and solution?
    Regards
    Edited by: Elham on May 27, 2012 12:51 AM

    Note that WebLogic 12c endorses JavaEE6.
    Look ups and how JNDI works is explained in the JavaEE6 tutorial: http://docs.oracle.com/javaee/6/tutorial/doc/gipjf.html

  • Need help on features of Oracle9iAS

    Dear All,
    I am new in this Forum. I am working as a Technical Consultant in Thailand. As of now, I am looking for a Application Server the will meet requirements of our prospected customer. Personally , I prefer to propose the Oracle9iAS, but I am not sure whethere it will meet these specifications or not. Would you please me help me ? Here are the specifications that I have problems whethere Oracle9iAS is currently support or not:
    1) be able to do "caching" by combining several connections into a single Thread
    2) have a security feature to control to usage/access of sessions that are used to enter the system
    3) support CORBA
    4) Securites features: Access Control List and User Authentication
    PLease help our company use and develop applications for our customers using Oracle RDBMS for a long time. Using "Oracle9iAS" may give us some more advantages compare to other "applications server". However, we need to meet these requirements as well. PLease excuse me , the specifiactions above might not be "Technically correct" since there are translated from Thai language. I hope someone of you could help me. Thank you very much in advance
    Regards,
    Pearapon S.

    Is there some software to verify if my graphics card is shotty?
    Techtool Pro has some testing, the AHT tests VRAM, but game benchmarks and stressing will tell you the most.
    Is re-seating the graphics card or memory worth trying?
    Absolutely. Just don't reinstall the graphics card until you clean it thoroughly.
    Cleaning the dust out of my machine?
    YES. A dust filled graphics card heatsink will cause the GPU to cook, and cause problems thet you describe.
    If I need a new graphics card, what are my options? Do I have to purchase it via Apple store? I would like to stick with an Nvidia card so am I stuck buying the same card I currently have or can I upgrade?
    You don't have to buy from Apple, but using with OS X limits your choices to Mac compatible or flashable PC versions.
    There is an awful lot of user input into this topic here:
    http://blog.macsales.com/602-testing-those-new-graphics-cards
    Card reviews can also help:
    http://www.anandtech.com/video/showdoc.aspx?i=3140&p=9
    http://www.tomshardware.com/reviews/radeon-hd-4870,1964.html

Maybe you are looking for