JAXB Classes Names

HI! I�m working with JAXB, and i have two classes in my xsd schema, Kcilivt and Kcil42t.
After making the binging, it has generated my two classes, with names Kcilivt.java and Kcil42T.java.
The T in the second case is upper case, because it's after a number, and i want it in lower case.
Can anybody help me?
Thanks

if they are meant to be different classes, then just give them different xml element names.

Similar Messages

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

  • Class Name customization in JAXB

    Does Sun Jaxb allows customizing class names so that they are same as in schema definition, instad of Java format. For example, if a purhcaseorder schema has complex type named purchaseorder, jaxb generates Class by PurchaseOrder, is there a way to not to do this. Similllary for elements and attributes
    Thanks

    Customize JAXB? Ha ha ha! That's a good one.
    I can't remember if this is one of the irregular selection of things you can specify. Have you messed around with the binding document? I can't remember what they call it. It's a mapping doucment that's supposed to allow you to do this type of thing but I find it's often not functional.

  • JAXB compiler for class names with special characters

    Hi,
    I trying to run the xjc against an XSD where element names (class names) have an "_" in them. For eg ACCOUNT_AKG.
    JAXB creates a class ACCOUNTAKG and omits the "_". I need "_" to be preserved in the class name of the class is generated.
    Can someone show me the right direction , so I can create classes with "_" preserved in the class name.
    This would be a big help
    thanks
    Jax

    Hi,
    I trying to run the xjc against an XSD where element names (class names) have an "_" in them. For eg ACCOUNT_AKG.
    JAXB creates a class ACCOUNTAKG and omits the "_". I need "_" to be preserved in the class name of the class is generated.
    Can someone show me the right direction , so I can create classes with "_" preserved in the class name.
    This would be a big help
    thanks
    Jax

  • How to change generated class name when create binding files.

    I have a dtd file, which has lines like this:
    <!ELEMENT rights (
         %plain-text;
         | rights.owner
         | rights.startdate
         | rights.enddate
         | rights.agent
         | rights.geography
         | rights.type
         | rights.limitations
         )*>
         <!ELEMENT rights.type (%plain-text;)*>
    when i use xjc to create binding files, I got an error:
    trying to create the same field twice: value.
    I suspect that the reason is because the name of rights and rights.type.
    so, i'd like to know how can i control the generated class name. for example, i want to generate a class RightTypeEle for element rights.type. how can do that?
    btw, i use latest version of jaxb.
    Thanks in advance.

    hi Vincentq,
    What function are you using to create the attachment?  Have you looked at SAP_WAPI_ATTACHMENT_ADD?
    Cheers,
    Sue

  • Update Unbounded element using SOAP_CLIENT and JAXB classes

    I am writing a custom worklist application using 10.1.3.3. I am able to successfully kick off my BPEL process from my Java application and I am even able to modify most of the fields defined in my XSD. My problem occurs when I try to update the unbounded elements. They are of complex type and each request can have an unlimited number of these elements.
    I used JDeveloper's tool to generate the JAXB classes I'm using to interact and modify the payload of my task. I know that JAXB does not generate setter methods for unbounded elements. I should be able to get the list of elements and simply add to it. Unfortunately, the new list elements are not being saved when I marshall my payload and update the task with the new payload.
    Any ideas on what I'm doing wrong or if there is another way to do this? I've posted code snippets below.
    Thanks!
    Quote Element from XSD:
    <xsd:element name="Quote" nillable="true" minOccurs="0" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="WorksheetId" type="xsd:int" minOccurs="0"/>
    <xsd:element name="QuoteId" type="xsd:int" minOccurs="0"/>
    <xsd:element name="Description" nillable="true" minOccurs="0">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="250"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="Quantity" type="xsd:int" nillable="true" minOccurs="0"/>
    <xsd:element name="UnitPrice" type="xsd:float" nillable="true" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    AddQuote java code:
    JAXBContext jc = JAXBContext.newInstance("myproject.xml");
    Unmarshaller u = jc.createUnmarshaller();
    Task detailTask = wfSvcClient.getTaskQueryService().getTaskDetailsById(ctx, thisId);
    Element detailPayload = detailTask.getPayloadAsElement();
    ObjectFactory objFactory = new ObjectFactory();
    XMLWorksheet xRequest = objFactory.createWorksheet();
    xRequest = (XMLWorksheet)u.unmarshal(detailPayload.getFirstChild());
    List quotes = xRequest.getQuote();
    quotes.add(quote);
    Marshaller m = jc.createMarshaller();
    m.marshal(xRequest, detailPayload);
    detailTask.setPayloadAsElement(detailPayload);
    taskService.updateTask(ctx, detailTask);

    who actually managed to make the SOAP_CLIENT working ?
    What is the jar list and order you use ?
    Does it work with java 5 ?
    Thanks for the help!

  • Heavy loading of jaxb classes

    Hi,
    We need to use the latest jaxb 2.1 libraries in our application. We are using netweaver 7.1 CE and it seems to ship with jaxb 2.0 libs. (file:/usr/sap/CE7/J00/j2ee/cluster/bin/ext/jaxb20/jaxb-impl.jar)
    We are already using heavy loading for the hibernate classes, and I assumed I could to the same for jaxb. The dump of the heavy loaded classes from telnet is as follows:
       /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/javassist-3.4.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/hibernate-entitymanager-3.3.2.GA.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/asm-1.5.3.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/antlr-2.7.6.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/commons-collections-3.1.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/hibernate-commons-annotations-3.0.0.GA.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/jaxb-xjc-2.1.7.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/hibernate-annotations-3.3.1.GA.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/jaxb-impl-2.1.7.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/log4j-1.2.15.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/asm-attrs-1.5.3.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/jaxb-api-2.1.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/commons-logging-1.0.4.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/cglib-2.1.3.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/ehcache-1.5.0.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/dom4j-1.6.1.jar
        /usr/sap/CE7/J00/j2ee/cluster/apps/sap.com/Manifest/app_libraries_container/lib/hibernate-3.2.6.ga.jar
    The jaxb classes is included, but it does not seem that my jaxb libraries is used by my application. I've added a util method to do o lookup of the classloader of the jaxb class that I get hold of in the app, and it is still the original jaxb2.0
    Is this the correct approach to use a newer JAXB or is there some other way of doing it?
    Regards Jaco

    In the NetWeaver you can make one application dependent on another one using the [application-j2ee-engine.xml|http://help.sap.com/saphelp_nwce10/helpdata/en/45/053c1041f30486e10000000a155369/content.htm] descriptor.
    If you have YourApp.ear, and HibernateJars.ear (the latter one as "Heavy Library"), in the YourApp.ear/META-INF/application-j2ee-engine.xml you could write:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
    <application-j2ee-engine>
         <provider-name>yourcompany.com</provider-name>
         <reference reference-type="hard">
              <reference-target target-type="application" provider-name="yourcompany.com">HibernateJars</reference-target>
         </reference>
    </application-j2ee-engine>
    In such case, the HibernateJars' classloader will not see the jaxb classes loaded by server, and whatever refers to jaxb there - will use the version you want. BUT, YourApp's classloader will use the jaxb version loaded on server.
    I know this may still be confusing... I would recommend you to browse through the classloader viewer on the web console (port 50000):
    SAP NetWeaver Administrator > Problem Management > Classloader viewer > Java Class Loader Viewer
    (find the classloaders of your applications and browse through Children, Parents and Resources tabs -
    this is where I understood the NetWeaver's classloading approach

  • Problem Generating JAXB Classes

    I am using Eclipse (Enterprise Pack) and want to generate JAXB classes from a schema. I right click on the schema, select Generate JAXB classes - fill in package name, next and get the error:
    java.lang.NoClassDefFoundError: com/sun/tools/xjc/XJCFacade
    Caused by: java.lang.ClassNotFoundException: com.sun.tools.xjc.XJCFacade
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
    Exception in thread "main"
    Am I missing a library?
    Steve Watson

    The web service project will add additional server runtime libraries to the classpath thus resolving the jaxb dependencies, in the case of a dynamic web project, you'll have to manage that with the JPA facet and eclipselink, or by adding the Moxy jars seperately. However, if you want to use the target runtime libraries create a user-library and reference the following server libraries: (from Server Install Dir\modules) glassfish.jaxb_"version".jar, glassfish.jaxb.xjc_"version".jar, javax.activation_"version".jar, javax.xml.bind_"version".jar, javax.xml.stream_"version".jar.

  • Generating JAXB classes

    Hi,
    My xml: http://www.javaexperience.com/catalog.xml
    I have an xml for which I want to generate JAXB classes. Unfortunately I don't have access to xsd for this xml.
    Could someone please share steps to generate JAXB classes for a xml. What I have tried is:
    1) Generate the xsd from this xml using XML to XSD Generater Online - xmlGrid.net
    2) Use the Maven JAXB plugin "org.jvnet.jaxb2_commons"
    The problem I faced with my approach was that:
    Since the xml has root element and one of the child element as same name, the JAXB processor fails on reaching the child "Catalog" tag. Even though it had successfully processed the root "Catalog" tag.
    Any pointers would of great help.

    The web service project will add additional server runtime libraries to the classpath thus resolving the jaxb dependencies, in the case of a dynamic web project, you'll have to manage that with the JPA facet and eclipselink, or by adding the Moxy jars seperately. However, if you want to use the target runtime libraries create a user-library and reference the following server libraries: (from Server Install Dir\modules) glassfish.jaxb_"version".jar, glassfish.jaxb.xjc_"version".jar, javax.activation_"version".jar, javax.xml.bind_"version".jar, javax.xml.stream_"version".jar.

  • JAXB class conflict error

    I am new to JAXB.
    I am using external customization file to create JAXB classes.
    I have one XSD file which includes another XSD. Both of them have the same element name and the classes are getting created in the same folder. I have tried each and every option of the options mentioned in the fix collides examples of JAXB sun tutorial without any success.
    Please guide me on this.
    This is the following error:
    compile:
    [echo] Compiling the schema...
    [xjc] C:\Sun\jwsdp-1.6\jaxb\samples\acord-dri\gen-src\primer.po is not found and thus excluded from the dependency
    check
    [xjc] Compiling file:/C:/Sun/jwsdp-1.6/jaxb/samples/acord-dri/Aon_Acord-Repository_v-1-0-1.xsd
    [xjc] [ERROR] Multiple <schemaBindings> are defined for the target namespace "http://www.ACORD.org/Standards/Acord
    MsgSvc/1.1.0"
    [xjc] line 129 of binding.xjb
    [xjc] [ERROR] Another <schemaBindings> is defined here
    [xjc] line 98 of binding.xjb
    [xjc] [ERROR] A class/interface with the same name "primer.po.SenderAonAcord" is already in use. Use a class custo
    mization to resolve this conflict.
    [xjc] line 265 of Acord-Repository_v-1-0-1.xsd
    [xjc] [ERROR] (Relevant to above error) another "SENDERAonAcord" is generated from here.
    [xjc] line 217 of Aon_Acord-Repository_v-1-0-1.xsd
    [xjc] [ERROR] This error is caused because on Windows you cannot have both "SENDERAonAcord.java" and "SenderAonAco
    rd.java" in the same directory.
    [xjc] unknown location
    [xjc] failure in the XJC task. Use the Ant -verbose switch for more details

    This is because of name conflicts in the xsd. If the <xsd:element> name is same as some <xsd:complexType> and that is referenced from the element this happens. If you provide different names, it will solve the problem
    Regards,
    Sushil

  • How do I unmarshal to only a portion of generated JAXB classes?

    I have an XML schema that is laid out something like this:
    <Information>
    <Header/>
    <Item> (Unbounded)
    <Trailer/>
    </Information>
    I receive files that have thousands of items in them. Because of the size of the files, I must use SAX to parse the file.
    I need to unmarshal each file and store the results in a database after following some conditional logic. It is not practical to unmarshal a 500 MB file.
    What I have been doing is using a SAX DefaultHandler to strip out each <Item> element.
    I had to create a separate schema for just the <Item> element so that I could use JAXB's xjc to generate a set of classes to unmarshal each <Item> element to.
    This works great, but it is a hassle to maintain. You see, I also need to unmarshal the <Header> element. So I have to create a separate schema for that as well. So then I end up with two sets of JAXB classes, with lots of duplication. Plus, if I have any complex types that are referenced in both the <Header> and the <Item>, then I have to include those in each sub schema.
    What I want to know is:
    Is it possible to just generate ONE set of JAXB classes for the main schema, and then unmarshal the stripped out <Item> element to just the corresponding Item in the generated JAXB classes?
    This is a complicated topic, and I hope I've been clear. Basically, I have to create these <Header> and <Item> schemas by hand every time the main schema changes, and I want to get away from that.

    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.

  • Help - Class name and descriptions for a function location.

    Hi Guys
    i have to write a report that displays the class and class descriptions for a function location. the user passes in either the function location(TPLNR) or the class name and  the report should display the the class characteristics and resp. values. Is there a FM that i coud use?
    please help.
    many thanks.
    seelan.

    sadiepu1 wrote:
    When I set up Words with Friends on my Fire it asked for my username and password which from a previous reply to my inquiry above stated that the S 3 doesn't store due to privacy issues. I have tried all my usual combinations of usernames and passwords and my Fire won't let me access the game as it keeps telling me that one or the other is not correct. I have deleted the app from my Fire and re-downloaded it but have the same error comes up. I have accessed the Words with Friends support both on my phone and their website but there is no live chat. I might have to take both to a Verizon store. Also, my Fire won't let me access the game without a correct username and password. To say that I am frustrated would be an understatement as well I have tried everything I can think of with no luck! Thanks for any help you can give!
    Did you use facebook to log in? 
    Verizon will not be able to help you retrieve any of the information you need.  You will have to contact Zynga.

  • How can i get all java class names from a package using reflection?

    hi,
    can i get all classes name from a package using reflection or any other way?
    If possible plz give the code with example.

    You can't, because the package doesn't have to be on the local machine. It could be ANYWHERE.
    For example, via a URLClassLoader (ie from the internet) I could load a class called:
    com.paperstack.NobodyExpectsTheSpanishInquisitionI haven't written it yet. But I might tomorrow. How are you going to determine if that class is in the package?
    This subject comes up a lot. If you want to do something a bit like what you're asking for (but not quite) there are plenty of threads on the subject. Use google and/or the forum search facility to find them.
    But the answer to your question, as you asked it, is "you can't do that".

  • How to find the class name of the  BO

    HI
      How to find out a class for a business object.
    For example for the Business Object FORMABSENC i want to find out the class name.
    iam not able to find out from se24 or swo1.
    Or please suggest me how can i use the method createbapistructure of this businessobject.
    Regards
    vijaya

    Hello Vijay
    When you double-click on "method" AbsenceForm.CreateBapiStructure (transaction SWO1) and switch to tab ABAP you see (on ERP 6.0) that the field Name is empty meaning this BO "method" has not yet been implemented.
    Other methods are implemented by modules of function group SWXA. Checking package SWX you will see that there are no suitable classes around for this object.
    Final remark: Methods of business objects has just a semantic meaning and has nothing to do with object orientation (i.e. classes).
    Regards
      Uwe

  • Object class name does not exist in IDM

    Hi Team
    We are process of Integrating GRC 10.1 to Enterprise Portal.Followed accordingly as per the SAP Note No. 1977781.
    While running the Schema Job, we get a message Schema Imported Suxcessfully. While running the Job : GRAC_REPOSITORY_SYNC_JOB, the job
    shows successful, but a Warning Message : User Adaptor Empty in SLG1 T.code.
    I have checked the Path suffix,connectors,data source and all are maintained but no sure about this warning message.
    Secondly,I tried for test creation of user on Portal via GRC 10.1.I am getting below error
    "Object class name does not exist in IDM" Please see log below
    Request gets closed stating Auto Provisioning failed.Please advice if someone has faced same issue and the steps taken to rectify it.
    Thanks
    Nitesh

    Hi Nitesh,
    We worked on this issue for quiet sometime with SAP to get this finally fixed You can check all below mentioned notes.
    First Check:
    Please check the Note: 1915763 - Error Provisioning from GRC 10 to SAP Portal while adding or removing a role in Change Account request type.
    This Note says that if your LDAP set as data source is read-only in Portal, then you need to change it to Modifiable in order to allow create or change user belonging to LDAP.
    We have set the UME correctly and no longer read-only. But our access requests still used to fail with the following messages.
    "Object class name does not exist in IDM".
    Second Check:
    Kindly ensure the field mapping for portal is done in IMG settings properly.
    If it is fine please check below note 2033714 - AC10.0: error in SGL1 "Object class name does not exist in IDM".
    This note is only to check if you have made any mistake with your portal mapping and doesn't address the correct issue.
    Third Check:
    Finally after implementing SAP note 1941250 - UAM: Truncated parameters provisioned on changing users from Access Request
    our issue got fixed.
    Regards,
    Madhu.

Maybe you are looking for