Generating NodeFactory Classes

Hi,
I've successfully used the NodeFactory mechanism to generate my
own (hand crafted) XMLElement sub-classes when parsing an XML
string. What I'd also like to do is to create an XMLDocument
explicitly within my code (ie. creating the XMLElement classes
and stitching them together into an in memory XMLDocument) using
the same NodeFactory generated sub-classes.
This is to accomodate a generic method of mine that takes an in-
memory XMLDocument, and I want to run this either from a parsed
XML string or from an in-memory XMLDocument that some other code
has created.
I can build up an in memory XMLDocument using the regular
XMLDocument.createElement method but this only creates the base
XMLElement classes, not my NodeFactory sub-classes. Is there any
way I can get the XMLDocument.createElement method to create my
NodeFactory sub-classes instead?
Yours,
Dave
null

Dave Barton (guest) wrote:
: Oracle XML Team wrote:
: : Dave Barton (guest) wrote:
: : : Hi,
: : : I've successfully used the NodeFactory mechanism to
generate
: : my
: : : own (hand crafted) XMLElement sub-classes when parsing an
: XML
: : : string. What I'd also like to do is to create an
XMLDocument
: : : explicitly within my code (ie. creating the XMLElement
: classes
: : : and stitching them together into an in memory XMLDocument)
: : using
: : : the same NodeFactory generated sub-classes.
: : : This is to accomodate a generic method of mine that takes
an
: : in-
: : : memory XMLDocument, and I want to run this either from a
: : parsed
: : : XML string or from an in-memory XMLDocument that some
other
: : code
: : : has created.
: : : I can build up an in memory XMLDocument using the regular
: : : XMLDocument.createElement method but this only creates the
: : base
: : : XMLElement classes, not my NodeFactory sub-classes. Is
there
: : any
: : : way I can get the XMLDocument.createElement method to
create
: : my
: : : NodeFactory sub-classes instead?
: : : Yours,
: : : Dave
: : Currently, we do not support generating NodeFactory
classes.
: : This has been recommended to our development team.
: : How important is this method to you?
: : Are any other Forum members interested?
: : Oracle XML Team
: : http://technet.oracle.com
: : Oracle Technology Network
: Thanks for the response. I can get around it by creating an
XML
: string and then parsing it, but this is obviously an extra
: performance hit that I could do without. I'd vote for being
able
: to create NodeFactory classes.
: The other thing in this area that struck me as being a "nice
to
: have" would be to get the Class Generator tool to generate
: NodeFactory compatible classes (ie. inherit from XMLElement
and
: perhaps generate methods that abstract away the attributes and
: elements, so if there was an attribute called "text" a method
: called "get_text" would be created which returns a string by
: getting the attribute using the base class "getAttribute"
method
: with the "text" attribute name). I'm currently doing this
stuff
: by hand.
: Dave
We have had that along with a document abstraction as a Class
Generator enhancement request which we are considering for a
future release.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null

Similar Messages

  • How to generate a class automatically in JDev

    Suppose from OS side, I create a new empty Java file in the src directory of a project in JDev. Then in JDev, I click on the "refresh"/reload button for that project. Now I see the new java file. Double click it to open it; it is blank. In this case, how can I generate a class using the file name as the class name, and a default constructor or even a main method etc.?
    Is there any convenient way of doing this, rather than going to the usual route, which is File menu, then new, java file, from that UI to give a class name, choose to include a main method etc..
    Thank you.

    Duncan Mills blogged about how to build your own templates http://blogs.oracle.com/groundside/entry/adventures_in_adf_logging_part1
    Not exactly your case, but you should get the idea.
    Timo

  • Best Practice for WSDL Generate Proxy Class for Web Service with Two Versions

    Dear All
    Thank you in advance for you help.
    I would like to generate proxy classes for same function but with two versions.
    Old version web service (v23.2) is used for stable modules in a project which is not going to modify.
    However, enhancement is added in new version web service (v24) and is going to use in any future modules.
    For example,
    wsdl.exe -o="TestProxy.cs" -l:CS -n:Test -sharetypes https://community.workday.com/custom/developer/API/Notification/v23.2/Notification.wsdl https://community.workday.com/custom/developer/API/Notification/v24.0/Notification.wsdl
    It generates similar classes with an '1' added at the end of the class name.
    ublic partial class Event_TargetObjectType {
    private Event_TargetObjectIDType[] idField;
    public partial class Event_TargetObjectType1 {
    private Event_TargetObjectIDType1[] idField; ...}
    Since the function inside some class is the same, is it possible for WSDL.exe to generate proxy classes automatically that if the class is the same, then generate one class only (sameFunction())  but if it detects the class is different, then add '1'
    to the end of class name (differentFunction() and differentFunction1())
    i.e.
    public class sameFunction()
    public class differentFunction()
    private int a;}
    public class differentFunction1()
    { private int b;
    Best Regards
    mintssoul

    Hi  mintssoul,
      As per this case, I have shared corresponding details below :
    1.As far as I know, WCF doesn’t support method overloading directly
    2.Because WSDL doesn’t support method overloading (not OOPs).
    3.WCF generates WSDL which specifies the location of the service and the operation or methods the service exposes.
    4.WCF use Document/Literal WSDL Style : Microsoft proposed this standard where the soap body element will contain the web method name.
    5.By default all the WCF services conform to the document literal standard where the soap body should include the method name.
    6.but you can differ the method in the same manually by using Name attribute like below 
    For example:
        [OperationContract(Name="Integers")]
        int Display(int a,int b)
        [OperationContract(Name="Doubles")]
    double Display(double a,double b)
    7. Or I suggest you that can use svcutil to map multiple namespaces for generating wcf service proxies .
        for more information about this, refer here :
    http://stackoverflow.com/questions/1103686/use-svcutil-to-map-multiple-namespaces-for-generating-wcf-service-proxies

  • Compilation Error for import classes not found in generated Proxy Class

    Hi,
    We are generating java classes for the COM dll using JCOM com2java compiler.
    We are getting a compilation error for import class not found when compiling the
    generated Proxy java source code. It can't find the com.bea.jcom.Dispatch class that
    the generated Proxy java source code extends. It also can't find com.bea.jcom.Variant
    or com.bea.jcom.Param. These are interfaces or data types or classes used by COM
    library.
    I added weblogic.jar to my class path and the only Dispatch class i found inside
    the weblogic.jar is com.linar.jintegra.Dispatch;
    We have com objects for which we want to develop an EJB client to interface with
    the COM object using JCOM with Native Mode disabled.
    Any help on the compilation error..I tried changing the extends for Dispatch to com.linar.jintegra.Dispatch
    but the other errors are still there.
    To begin with, I think the generated code should not refer to any of the COM data
    types.
    Any help please.
    Thank you in advance,
    Regards,
    Rahul Srivastava
    [email protected]

    Hi,
    I resolved the other errors by changing all references from com.bea.jcom.Variant
    etc to com.linar.jintegra.class name..all were present under the com.linar.jintegra
    package.
    Thank you all anyways,
    Regards,
    rahul
    "Rahul Srivastava" <[email protected]> wrote:
    >
    Hi,
    We are generating java classes for the COM dll using JCOM com2java compiler.
    We are getting a compilation error for import class not found when compiling
    the
    generated Proxy java source code. It can't find the com.bea.jcom.Dispatch
    class that
    the generated Proxy java source code extends. It also can't find com.bea.jcom.Variant
    or com.bea.jcom.Param. These are interfaces or data types or classes used
    by COM
    library.
    I added weblogic.jar to my class path and the only Dispatch class i found
    inside
    the weblogic.jar is com.linar.jintegra.Dispatch;
    We have com objects for which we want to develop an EJB client to interface
    with
    the COM object using JCOM with Native Mode disabled.
    Any help on the compilation error..I tried changing the extends for Dispatch
    to com.linar.jintegra.Dispatch
    but the other errors are still there.
    To begin with, I think the generated code should not refer to any of the
    COM data
    types.
    Any help please.
    Thank you in advance,
    Regards,
    Rahul Srivastava
    [email protected]

  • Can't fill ByteArray in EJB-Method with generated Model-Class from WD-Model

    Hello everybody,
    i try to call an ejb-method with data from an FileUpload-UI-Element in WD. The EJB-Method is receiving the byte-data to create a document in KM via a Web-Service.
    The ebj-methid has the following signature:
    public FObject putFileDataSimple (byte [] btContent, String fullFileName, String username, String password)
    After importing the Model and creating a context node i have the following structure:
    Request_X_putFileDataSimple
    +---btContent (Node)
          +-- item
    + fullFileName
    + username
    + password
    btContent is of the generated Type Byte_Item, which is itself a generated Model-Class of modelClassType ARRAY
    item is of Type byte
    But i simply have problems to fill the context node (or the binded model-object). i tried different ways and looked at thread [https://www.sdn.sap.com/irj/scn/thread?messageID=1954223] but i cant get it work.
    So my Method in WD looks like this to fill the structure and start the ejb-method:
    public boolean putKMDataSimple( com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource fin )  {
    try
      wdContext.currentRequest_X_putFileDataSimpleElement().setFullFileName("abc");
      wdContext.currentRequest_X_putFileDataSimpleElement().setUsername("def");
      wdContext.currentRequest_X_putFileDataSimpleElement().setPassword("xxx");
      byte[] buffer = new byte[1];
      InputStream in = fin.read(false);
      int i = 1;
      int j = 0;
      while (i!=-1)
         i = in.read(buffer);
         if (i!=-1)
           Byte_Item bi = new Byte_Item(mAlf);     // mAlf ist global defined Model-Class-Instance
           bi.setItem(buffer[0]);
            wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().addBtContent(bi);
      wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().execute();
    Doing this results in Error-Messages like:
    Model-Object is not a complex type for every byte added this way.
    And finally an IllegalArgumentException at java.lang.reflect.Array.set(Native Method)
    The second way i tried is:
    public boolean putKMDataSimple( com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource fin )  {
    try
      wdContext.currentRequest_X_putFileDataSimpleElement().setFullFileName("abc");
      wdContext.currentRequest_X_putFileDataSimpleElement().setUsername("def");
      wdContext.currentRequest_X_putFileDataSimpleElement().setPassword("xxx");
      byte[] buffer = new byte[1];
      ArrayList<Byte> btlist = new ArrayList<Byte>();
      InputStream in = fin.read(false);
      int i = 1;
      int j = 0;
      while (i!=-1)
         i = in.read(buffer);
         if (i!=-1)
              btList.add(buffer[0]);
      wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().setBtContent(btList);
      wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().execute();
    Trying so results in:
    java.lang.ClassCastException: class java.lang.Byte:null incompatible with interface com.sap.tc.cmi.model.ICMIModelClass:library:com.sap.tc.cmi(at-sign)[email protected]@alive
    whenn calling the setBtContent Method
    I don't what to do now to fill the context/model-object the right way.
    Any helpfull hints are very welcome
    Edited by: Matthias Hayk on Dec 1, 2008 5:51 PM
    Edited by: Matthias Hayk on Dec 2, 2008 10:56 AM

    Ok Vesselin and thanx for your idea,
    so i adapted the source in the way you told like the following:
                     ArrayList<Byte_Item> btlist = new ArrayList<Byte_Item>();
                     byte[] buffer = new byte[1];
                     InputStream in = fin.read(false);
                     int i = 1;
                     int j = 0;
                     while (i!=-1)
                          i = in.read(buffer);
                          if (i!=-1)
                               // Byte gelesen
                               Byte_Item bi = new Byte_Item(mAlf);
                               bi.setItem(buffer[0]);
                               btlist.add(bi);
                               j++;
                     wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().setBtContent(btlist);     
                     wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().execute();
    This results also in the following Exception when exceuting the WS-proxy:
    execute
    [EXCEPTION]
    java.lang.IllegalArgumentException
    at java.lang.reflect.Array.set(Native Method)
    at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.getInputParameters(EJBGenericModelClassExecutable.java:215)
    at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.execute(EJBGenericModelClassExecutable.java:112)

  • Errors generating Java classes from XML schema

    I received the following errors when generating Java classes from the schema located at: http://imsproject.org/xsd/ims_qti_rootv1p1.xsd and http://imsproject.org/xsd/ims_xml.xsd
    XML Spy v4 claims that the schema is well-formed and valid. Could this be a problem with the class generators, or is XML Spy not telling the truth?
    Thanks.
    D:\IMS_QTI\Java>java -classpath .;lib/xmlparserv2.jar;lib/xschema.jar;lib/classgen.jar oracle.xml.classgen.oracg -schema ims_qti_rootv1p1.xs
    d -outputDir src\com\icld\qti -package com.icld.qti -comment
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 235, Column 21>: XSD-2209: (Error) Duplicated definition for: 'attr.view'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 303, Column 21>: XSD-2209: (Error) Duplicated definition for: 'grp.labels'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 1834, Column -12236>: XSD-2209: (Error) Duplicated definition for: 'qtimetadatafield'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 1834, Column -9642>: XSD-2209: (Error) Duplicated definition for: 'typeofsolutionType'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 2252, Column -3019>: XSD-2026: (Error) Invalid attribute 'use' in element 'attribute'
    Error: Schema Class Generator failed to generate classes. oracle.xml.parser.schema.XSDException: Duplicated definition for: 'attr.view'

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jinyu Wang ([email protected]):
    Which version are you using? I can't reproduce the error with 9.0.2B version.<HR></BLOCKQUOTE>
    Thanks for having a look at the problem. I am using the 9.0.2.0B version with Java 2 Standard Edition Build 1.3.1-b24. The classgen -version option returns 9.0.2.0b-beta - and xmlparserv2.jar and xschema.jar are from the same distribution. Running the corresponding DTD from the same source work fine - I'm just havinf this problem with the XSD. Anything else I should look at?

  • How to omit xmlns from generated Java classes

    Hi,
    I'm using JAXB and xjc to generate Java classes from xsd fils. I've noticed that when marshalling these Java classes to XML string, there are few xmlns attributes that (as far as I concern :-))
    "waste" space on the generated xml (space is critical resource in our application). Is there a way to order the Marashaller to omit these xmlns attributes from the generated files?
    I tried to edit the generated xml string. I removed the xmlns attributes, but unmarshall it back to Java objects failed...
    Thanks for any help,
    Barak.

    If the xmlns is specified in the xsd, it is also required in the xml. If you do not want it, however you can remove it from your xsd and then generate your xml

  • Why does Flash generate invalid class names for library items?

    I imported a bunch of bitmaps (PNGs).  The library symbol names all included the full file name and its extension.  When I check "export for actionscript" it generates a class name based on the symbol name, and it includes the ".png", even though that's invalid in a class name.
    When I select multiple bitmaps and choose properties and export for actionscript, it has a note saying that classnames will be automatically generated for all items, but it does the same thing... including the ".png" in all the class names.  Is this a problem?  Wouldn't it save time if Flash would automatically strip the file extension from the instance name of bitmap library symbols when generating class names?

    Thank you Nipun.  That is exactly the behavior I would expect, and I can confirm that in the trial of Flash CC it generates valid class names by removing the file extension.  For example, a file named "3ball.test.png" will receive an auto-generated class name of "_3ball_test", so it really does ensure the class name is valid (meeting AS3 class name syntax)
    kglad, what I'm saying is that an image file name like "ball.png" is not a valid "class name", because it contains a period, which is reserved as a package delimiter.  I know the runtime can handle it as a valid "fully-qualified class name", but it's misleading because it's actually creating a class named "png" in package "ball", BUT it's understood that the auto-generated name is not supposed to be specifying any package, hence the misleading specification.  The class would have to be instantiated like this: "import ball.png; var bd:BitmapData = new png();" or "import ball.*; var bd:BitmapData = new png();"  You would also then have to import every single class individually and always use their fully qualified names, because you'd technically have a bunch of classes all named "png" inside a hundred different packages.  It's just not acceptable.
    The other problem that occurred in CS6 is if you loaded a bunch of files whose names started with numbers, then when you select them all, choose properties, and use the batch properties window to export them for actionscript, I noticed that such images would be auto-assigned generic names like "Class4" as it would realize the default auto-generated class name would be invalid.  This problem has been fixed beautifully in Flash CC.
    Nipun, it would actually be very helpful to have a little more control over the class naming conventions.  For example, if I wanted all my BitmapData classes to exist in an "images" folder or package, it would be helpful if in the batch properties window I could specify a package name for all the auto-generated class names.  When importing hundreds of images, it's very tedius to have to edit them individually and I don't always have time to write a JSFL script.  There's room in that window to add a text field for a package name.  Thanks!

  • Problem in generating Helper class

    Hi All,
    I have generated Helper classes using rmic -iiop tool of JDK 1.4. But the Helper class which is generating doesnot contain any bind method. So in my application, when i am trying to bind CORBA ORB with this helper class bind method, it is giving compilation error.
    When i was using Borland Server i was able to generate Helper class with bind method also using java2iiop and now i am not using Borland as we are migrating to JBoss. So i am using rmic -iiop tool.
    Can anybody suggest me what should i do for this.

    I don't think many of us could help you with such a limited description. Try to be more descriptive, and please include relevant source code if possible.

  • Web service ClassCastException in the generated Tie class

    I got the above exception when making a request from a client to an EJB webservice. The exception is in the generated tie class on the server side.
    I narrowed down the problem to this:
    In my function call in the tie class: (now call MyFunction):
    a function in the tie class is generated:
    private void invoke_MyFunction(StreamingHandlerState streaminghandlerstate) throws Exception{
    In this function, there's line:
    ((MyEJBInterfaceClass)getTarget()).MyFunction(...)
    Where MyEJBInterfaceClass is the name of the remote interface, which has MyFunction declaration in it.
    the getTarget() function is from TieBase class that the MyEJBInterfaceClass_Tie extended.
    The error is generated because getTarget() did not return an instance of MyEJBInterfaceClass.
    So, there must be some error in the generated code when I use the deploy tool to deploy my webservice.
    Could someone please shed some light?
    Sun, please fix your bugs. There are so many bugs that I found when using your server (App Server 8).
    From not releasing the context resource properly to not lookup properly using the context, to randomly generate bad client.jar file to this error.
    Very disappointed.

    Hello again
    I tried to reproduce your problem and could not so there must be something different than the following steps :
    1. Create the interface MyIntf.java
    package ejb;
    public interface MyIntf extends java.rmi.Remote {
    public String sayHello(String toWho)
    throws java.rmi.RemoteException;
    2. Create the EJB impl
    package ejb;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import java.rmi.RemoteException;
    public class MyEjb implements MyIntf, SessionBean {
    SessionContext sc = null;
    public MyEjb() { }
    public void ejbCreate() throws RemoteException {
    System.out.println("In MyEjb::ejbCreate !!");
    public void setSessionContext(SessionContext sc) {
    this.sc = sc;
    public void ejbRemove() throws RemoteException {}
    public void ejbActivate() {}
    public void ejbPassivate() {}
    public String sayHello(String toWho) {
    return "hello " + toWho;
    3. Create the config.xml (slightly modified from yours)
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <service
    name="MyEjbIntfService"
    targetNamespace="http://java.sun.com"
    typeNamespace="http://java.sun.com"
    packageName="ejb">
    <interface name="ejb.MyIntf"/>
    </service>
    </configuration>
    4. Invoke wscompile
    javac -d build ejb/MyEjb.java
    wscompile -define -mapping build/mapping.xml -d build -nd build -classpath build config.xml
    5. look at wsdl, there is nothing line MyIntfSoapPort like you had
    in particular
    <portType name="MyIntf">
    complete wsdl is :
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="MyEjbIntfService" targetNamespace="http://java.sun.com" xmlns:tns="http://java.sun.com" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <types/>
    <message name="MyIntf_sayHello">
    <part name="String_1" type="xsd:string"/></message>
    <message name="MyIntf_sayHelloResponse">
    <part name="result" type="xsd:string"/></message>
    <portType name="MyIntf">
    <operation name="sayHello" parameterOrder="String_1">
    <input message="tns:MyIntf_sayHello"/>
    <output message="tns:MyIntf_sayHelloResponse"/></operation></portType>
    <binding name="MyIntfBinding" type="tns:MyIntf">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/> <operation name="sayHello">
    <soap:operation soapAction=""/>
    <input>
    <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://java.sun.com"/></input>
    <output>
    <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://java.sun.com"/></output></operation></binding>
    <service name="MyEjbIntfService">
    <port name="MyIntfPort" binding="tns:MyIntfBinding">
    <soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>
    6. Package in deploytool.
    this is the webservices I got from the assembly tool.
    <webservices xmlns="http://java.sun.com/xml/ns/j2ee" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd">
    <webservice-description>
    <display-name>MyEjbIntfService</display-name>
    <webservice-description-name>MyEjbIntfService</webservice-description-name>
    <wsdl-file>META-INF/wsdl/MyEjbIntfService.wsdl</wsdl-file>
    <jaxrpc-mapping-file>mapping.xml</jaxrpc-mapping-file>
    <port-component>
    <display-name>MyIntf</display-name>
    <port-component-name>MyIntf</port-component-name>
    <wsdl-port xmlns:wsdl-port_ns__="http://java.sun.com">wsdl-port_ns__:MyIntfPort</wsdl-port>
    <service-endpoint-interface>ejb.MyIntf</service-endpoint-interface>
    <service-impl-bean>
    <ejb-link>MyEjb</ejb-link>
    </service-impl-bean>
    </port-component>
    </webservice-description>
    </webservices>
    So It works fine AFAIK, from your descriptrion, it seems that the wsdl file is incorrect so the problem starts far before the actual Tie generation. You wrote in a previous message that :
    "In the wsdl file this is one of the places it shows: <portType name="MyEjbIntfSoap">"
    This is where the problem is. Do you have any clue how you got that ? If you run again wscompile, do you have the same values ?
    Jerome

  • JAXB to generate java classes for XSD.

    Hi
    I have a XSD, which is importing other couple of xsds in it, tried to generate java classes using xjc, it is throwing error.
    C:\vittal\Project\received\development-1\da_xsd>xjc -p com daAuthoring.xsd
    parsing a schema...
    [ERROR] Property "Alt" is already defined. Use <jaxb:property> to resolve thi
    s conflict.
      line 42 of file:/C:/vittal/Project/received/development-1/da_xsd/commonElement
    s.xsd
    [ERROR] The following location is relevant to the above error
      line 2205 of file:/C:/vittal/Project/received/development-1/da_xsd/daCommonEle
    ments.xsd
    Failed to parse a schema.Please let me know how to fix this issue.

    Thanks for information,
    I do understand xml well, and having basic knowledge on XSD.
    1. can i generate a java classes for a xsd which is including other XSDs.
    2. how to overwrite the issue, using annotation, point me to a location where i will get more information, that will be great help.
    here is my xsd.
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:dctm="http://www.documentum.com" elementFormDefault="qualified">
         <xs:import namespace="http://dita.oasis-open.org/architecture/2005/" schemaLocation="ditaarch.xsd"/>
         <xs:import namespace="http://www.documentum.com" schemaLocation="dctmAttrs.ent.xsd"/>
         <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
         <xs:group name="alt">
              <xs:sequence>
                   <xs:element ref="alt"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="desc">
              <xs:sequence>
                   <xs:element ref="desc"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="title">
              <xs:sequence>
                   <xs:element ref="title"/>
              </xs:sequence>
         </xs:group>
         <!-- Elements in tblDecl.mod -->
         <xs:group name="colspec">
              <xs:sequence>
                   <xs:element ref="colspec"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="entry">
              <xs:sequence>
                   <xs:element ref="entry"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="row">
              <xs:sequence>
                   <xs:element ref="row"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tbody">
              <xs:sequence>
                   <xs:element ref="tbody"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tgroup">
              <xs:sequence>
                   <xs:element ref="tgroup"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="thead">
              <xs:sequence>
                   <xs:element ref="thead"/>
              </xs:sequence>
         </xs:group>
    </xs:schema>

  • Failed to Generate Wrapper Class Error With Postgresql

    Hello,
    Sorry if this comes across twice, I posted it first through the Google Groups interface, but I haven't seen it show up on the dev2dev forum interface. So here it is again.
    I've read the following threads that seem to be related to this
    question:
    http://groups-beta.google.com/group/weblogic.developer.interest.jdbc/browse_thread/thread/dc8f0a9ee03e9b9f/f0a70a673db3bb52
    http://groups-beta.google.com/group/weblogic.developer.interest.jdbc/browse_thread/thread/4f3b71c77dca30c4/4ed2e1c7b76a0c7b
    I also followed the links in the second post ( I also found them via
    Google as well ). I've been very sure the Postgresql JDBC driver is
    definitely in the class path. I'm able to load it with Class.forName()
    from a JSP page and then use DriverManager to get a connection that
    works. So that definitely means the driver is found.
    What else can cause this?
    The only really odd thing I am doing is running Weblogic on OS X,
    10.3.7 with all the updates. I know that this Weblogic setup works
    since I work on Oracle all day (using the provided Weblogic driver in
    8.1SP3). Just when I try to create a Postgresql connection for testing
    our app against Postgresql.
    I've tried it on Windows with Weblogic 8.1SP3 and it works, so I know
    Weblogic is capable of using this driver.
    My exact stacktrace is:
    java.lang.RuntimeException: Failed to Generate Wrapper Class
    at
    weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:183)
    at
    weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:171)
    at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:248)
    at weblogic.jdbc.pool.Driver.connect(Driver.java:164)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:507)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:139)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
    at jsp_servlet.__direct._jspService(direct.jsp:13)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:458)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:511)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:139)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
    at jsp_servlet.__direct._jspService(direct.jsp:13)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    What is going on at the place where this crashes? Is there a way find
    out what class it really can't find?
    Thanks,
    Patrick

    Patrick,
    1. Could you try to test the postgress connection pool using
    "Test Connection" on the pool set up page?
    2. Could you compare config.xml for broken and working installations
    in part of the connection pool settings?
    Regards,
    Slava Imeshev
    "Patrick Burleson" <[email protected]> wrote in message
    Sorry if this comes across twice, I posted it first through the Google Groups interface, but I haven't seen it show up on thedev2dev forum interface. So here it is again.
    >
    I've read the following threads that seem to be related to this
    question:
    http://groups-beta.google.com/group/weblogic.developer.interest.jdbc/browse_thread/thread/dc8f0a9ee03e9b9f/f0a70a673db3bb52
    http://groups-beta.google.com/group/weblogic.developer.interest.jdbc/browse_thread/thread/4f3b71c77dca30c4/4ed2e1c7b76a0c7b
    I also followed the links in the second post ( I also found them via
    Google as well ). I've been very sure the Postgresql JDBC driver is
    definitely in the class path. I'm able to load it with Class.forName()
    from a JSP page and then use DriverManager to get a connection that
    works. So that definitely means the driver is found.
    What else can cause this?
    The only really odd thing I am doing is running Weblogic on OS X,
    10.3.7 with all the updates. I know that this Weblogic setup works
    since I work on Oracle all day (using the provided Weblogic driver in
    8.1SP3). Just when I try to create a Postgresql connection for testing
    our app against Postgresql.
    I've tried it on Windows with Weblogic 8.1SP3 and it works, so I know
    Weblogic is capable of using this driver.
    My exact stacktrace is:
    java.lang.RuntimeException: Failed to Generate Wrapper Class
    at
    weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:183)
    at
    weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:171)
    at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:248)
    at weblogic.jdbc.pool.Driver.connect(Driver.java:164)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:507)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:139)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
    at jsp_servlet.__direct._jspService(direct.jsp:13)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:458)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:511)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:139)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
    at jsp_servlet.__direct._jspService(direct.jsp:13)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    What is going on at the place where this crashes? Is there a way find
    out what class it really can't find?
    Thanks,
    Patrick

  • Generating JAXB classes from XSD

    I am generating java classes using JAXB binding from XSDs. I organized the classes into 2 packages say package1 and package2
    The XSD to create the package2 is dependent on package1. So I do an include package1.xsd in package2.xsd. With this I am running into an issue with JDeveloper while generating the classes. When I generate classes using package2.xsd, all package1.xsd classes are also generated in the same package. So, I have to manually delete these classes from package1.xsd and add import statements from package1 where required.
    Is there a solutiion/work around available for suppressing duplicate class generation? Any help would be greatly appreciated.

    Try here as well
    https://jaxb.dev.java.net/

  • About generating Java classes from XSD Schema ???

    I need a powerfull tool to generate Java classes from XML Schema. I want that generated classes to have the option to validate XML(to be JAXP1.2 compliant).
    I used XML Spy 5.4 but the generated classes can't validate an XML file.
    Can you help me with other tools that:
    - generate Java classes from XSD
    - generate sample XML from XSD
    - are JAXP1.2 compliant(validate a XML file with a schema)
    Thanks.

    You can also use Castor: http://www.castor.org
    It generates classes from XML Schemas and enables data
    binding without writing any line of a fuckin SAX
    parser :-)I evaluated Castor and JAXB and while JAXB isn't perfect, it's got some things over Castor. Castor almost looks abandonded when I go to the site. The documentation just sort of trails off.

  • Customize names of generated JAXB classes

    I have a peculiar requirement. We have been using JAXB1.0 in our project to parse XMLs. External binding files were used to provide proper names for the generated JAXB classes. Now, I have an xml that looks something like this:
    //sample xml. Original format is much bigger
    <b>
    <MasterTag>
    <attr id="123">Value1</attr>
    <attr id="736">Value2</attr>
    <attr id="900">value3</attr>
    </MasterTag>
    </b>
    There's a property file which has key value pairs for the attr id
    Eg:
    <b>
    123=CompanyID
    736=CompanyAddress
    900=CompanyPinCode
    </b>
    Is it possible to generate JAXB classes names based on the attr id value? These values finally need to persisted in the db. JAXB is the preferred technology.
    Any other ideas are also welcome. Thanks.

    I might be misunderstanding your question, but if you control the single large schema, it would be simple to define the things that you want to treat specially as either individual elements or complexTypes inside the single schema file. Using psuedo-schema, say you have something like this now:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element name='Header'>
              <!-- your definition here -->
          </xs:element>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>You can change that to:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element ref='Header'/>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name='Header'>
      <!-- your definition here -->
    </xs:element>That should produce distinct classes for your Information and Header elements. You similary can break out the Item and Trailer elements.

Maybe you are looking for

  • I can't open orkut's new look in firefox 4.0b5. only open old orkut. why this happen ?

    hi I am from india. when i use orkut it's open old look. and my new orkut has been change in firefox. firefox is not supporting new orkut look. so pls help me

  • Netbeans Visual Web Pack

    Is anyone having this problem? In a nutshell a dataprovider associated to any database other than the default derby database will return null on dataprovider.canappend(); I have tried it with MySQL, MS SQL and I know the permissions are right, I even

  • 9100M resolution [solved]

    I just got an Acer Aspire 4530, it comes with the NVidia 9100M G. Resolution defaults to 1024x768. I had to manually add the Modeline and Modes options for 1280x800. For some reason, X defaults to 1024x768 instead, but if I remove all Modelines excep

  • IPhone Volumn too low

    Does anyone have extremely low volumn during a phone conversation? Even when I turn the volumn to the max, I can bearly hear the other person, the tone ring is also very low. There doesn't seem to be an option in the setting to set the voice volumn h

  • Dans l'app store j'ai une mise à jour d'un produit que je n'ai pas?

    Bonjour à tous, je viens de faire la mise à jour du dernier OS sur mon Iphone 3Gs Depuis, j'ai une proposition de mise à jour pour un jeu: Dream Park, alors que je ne le connais pas, je n'y ai jamais joué ni même télécharger. Une idée pour résoudre c