JAXB object creation for common XML

Hi,
Does JAXB let us create common Java Objects for common XMLs.
Consider the following scenirio:
XML1.xml
<xsd:schema>
<xsd:import namespace="Commons" schemaLocation="Commons.xsd"/>
<xsd:complexType name="ComplexElementType">
<xsd:sequence>
<xsd:element name="Commons" type="Commons:CommonsType"/>
<xsd:element name="field1" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="complexElement1" type="ComplexElementType"/>
</xsd:schema>
XML2.xml
<xsd:schema>
<xsd:import namespace="Commons" schemaLocation="Commons.xsd"/>
<xsd:complexType name="ComplexElementType">
<xsd:sequence>
<xsd:element name="Commons" type="Commons:CommonsType"/>
<xsd:element name="field2" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="complexElement2" type="ComplexElementType"/>
</xsd:schema>
The above 2 xmls uses common xml commons.xml.
Now, lets consider the package of creating Java objects are:
XML1.xml -> com.xml1
XML2.xml -> com.xml2
in general, commons java object will be created separately in both the packages.
So, my question is, is there any way with which the java objects related to commons.xmls be same or related with some interface?
Regards
Sandeep Jindal

Hi,
Does JAXB let us create common Java Objects for common XMLs.
Consider the following scenirio:
XML1.xml
<xsd:schema>
<xsd:import namespace="Commons" schemaLocation="Commons.xsd"/>
<xsd:complexType name="ComplexElementType">
<xsd:sequence>
<xsd:element name="Commons" type="Commons:CommonsType"/>
<xsd:element name="field1" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="complexElement1" type="ComplexElementType"/>
</xsd:schema>
XML2.xml
<xsd:schema>
<xsd:import namespace="Commons" schemaLocation="Commons.xsd"/>
<xsd:complexType name="ComplexElementType">
<xsd:sequence>
<xsd:element name="Commons" type="Commons:CommonsType"/>
<xsd:element name="field2" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="complexElement2" type="ComplexElementType"/>
</xsd:schema>
The above 2 xmls uses common xml commons.xml.
Now, lets consider the package of creating Java objects are:
XML1.xml -> com.xml1
XML2.xml -> com.xml2
in general, commons java object will be created separately in both the packages.
So, my question is, is there any way with which the java objects related to commons.xmls be same or related with some interface?
Regards
Sandeep Jindal

Similar Messages

  • Is it possible to restrict the object creation for stateless session beans

    Hi,
    Is it possible to restrict/fix the ejb object creation for stateless session beans in application server?
    For example, i want to configure the application server ( am using JBOSS ) to create maximum of 10 session bean objects. and if any requests for the stateless session bean come, as application server has created 10 objects, the requests should be blocked.
    Thanks in advance,
    nvseenu

    You can keep a counter in the application code. A static var won't work, but an entity and a consistent id should. This version would affect performance, but it would be portable to other app servers.
    // ConstrainedBean.java
    package unq.ejb;
    import javax.ejb.Stateless;
    import javax.ejb.CreateException;
    import javax.annotation.PostConstruct;
    import javax.annotation.PreDestroy;
    import javax.persistence.PersistenceContext;
    import javax.persistence.EntityManager;
    @Stateless
    public class ConstrainedBean implements Constrained {
        final static int DEFAULT_COUNTERID = 1;
        @PersistenceContext EntityManager em;
        @PostConstruct
        protected void init() throws CreateException {
         ConstrainedBeanCounter counter =
             em.find(ConstrainedBeanCounter.class, DEFAULT_COUNTERID);
         if( counter == null ) {
             counter = new ConstrainedBeanCounter();
             counter.counterId = 1;
             counter.counterValue = 0;
             em.persist(counter);
         if( counter.atMaximum() ) {
             throw new CreateException("error attempting to create > 10 beans");
         else {
             counter.increment();
        @PreDestroy
        protected void destroy() {
         ConstrainedBeanCounter counter = em.find(ConstrainedBeanCounter.class,
                                   DEFAULT_COUNTERID);
         counter.decrement();
        public void doSomething() { System.out.println("doSomething()"); }
    // ConstrainedBeanCounter.java
    package unq.ejb;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    @Entity
    public class ConstrainedBeanCounter implements java.io.Serializable
        @Id public int counterId;
        public int counterValue = 0;
        public void increment() {
         counterValue++;
        public void decrement() {
         counterValue--;
        public boolean atMaximum() {
         return counterValue > 9;
    }

  • Reg : object creation for controller and view ?

    hi friends....
    i am new to WDA and objects...
    please explain me..
    when i create the web dynpro component one interface is automatically created as IF_COMPONENTCONTROLLER for component
    IF_MAINVIEW for view
    IF_WINDOW for window
    correct me if i am wrong
    suppose if i want to reuse class, i want to create object... like wise
    if i want to reuse interfaces, i want to create object.
    but in this case..for eg (IF_COMPONENTCONTROLLER, IF_MAINVIEW ) where we are creating object...?
    no need to create object ?
    regards
    deva

    >but in this case..for eg (IF_COMPONENTCONTROLLER, IF_MAINVIEW ) where we are creating object...?
    no need to create object ?
    No you don't have instantiate any of the objects.  Think of Web Dynpro as a modeling layer implemented in ABAP Objects, but sitting on top of the Object Oriented constructs.  You still have some of the benfiits of OO - like event registration, inheritance, methods, etc - but a lot of the OO setup is done and maintained by the framework for you.  So although each section of Web Dynpro - the component, the controllers, contexts, views, etc - are all technically ABAP Object instances, you don't have to manage the objects directly.

  • Issues while JDBC System Object Creation for accessing MS SQL 2000 Server

    Dear Experts,
    I am creating system object to connect to MS 2000 server in Ep 7.3
    1) created system with all the properties
    2) User mapping done
    3) permissions ok
    but still while testing connection its giving error
    "No connection to system DBSQL found:
    com.sapportals.connector.connection.ConnectionFailedException: Connection Failed: A nested exception occurred. Could not initialize physical connection.
    Connection Failed: A nested exception occurred. Could not initialize physical connection.
    Connection Failed: A nested exception occurred. Could not create JCO connection.
    'user' missing"
    """ Connection Test for Connectors:
    Test Details:
    The test consists of the following steps:
    1. Retrieve the default alias of the system
    2. Check the connection to the back-end application using the connector defined in this system object
    Results
    Default alias retrieved successfully
    Connection failed. Make sure user mapping is set correctly and all connection properties are correct. """"

    Dear Mr. Arun,
    thanks for the valuable sap note
    I have applied the note but same result :
    No connection to system DBSQL found:
    com.sapportals.connector.connection.ConnectionFailedException: Connection Failed: A nested exception occurred. Could not initialize physical connection.
    Connection Failed: A nested exception occurred. Could not initialize physical connection.
    Connection Failed: A nested exception occurred. Could not create JCO connection.
    'user' missing
    1) i have created JDBC Driver as mentioned in sap note
    2) created System object
    3) created destination as required in EP 7.1 and above
    4) mapped user in user administration
    when i am testnig connection its giving above mentioned error
    same system object when i am creating for EP 7 its working fine with all 3 jar files and system creating succesfully
    plz help

  • Business Object Creation for OBN:

    Hi
    I am a very new user of the SAP EP.
    I believe i have EP 6.0 on my machine.(How do i find out which release of EP I am using ?)
    As part of my first step towards learning OBN, I tried to create a folder under "Business Objects". But, I do not get any screen/message, when I right click on the Business Objects and say New Folder.
    What authorizations / permissions are required for the same ?
    Thanks for the help.
    Best Regards
    Prasad

    Hi Prasad,
    To see the version of portal click on
    System administration->support->version.In Version you can see the portal version ,J2ee details and KM details.
    <b>Plz don forget points, if it helped.</b>
    Thanks,
    Harish.

  • Java Core Program :: Dynamic Object Creation for Classe & Invoking the same

    Hi,
    I need to create a dynamic object for a class & invoke it.
    For eg: I have a table in my DB where all the names of my java classes are stored. I need to call name from the table of the DB and call that class dynamically in my java program.
    ResultSet_01 = executeQuery("select classname from class_table where class_descrip = 'Sales Invoice' ");
                   while(ResultSet_01.next())
                        String class_name = ResultSet_01.getDouble("classname");
                   }Now using the string in class_name that is fetched from ResultSet_01, I need to create an object for the class_name & invoke the class that is been created with the same name.
    Thank in advance.
    Regards,
    Haider Imani

    Well for a start since a class name is a String, not a number you'd better start by getting the name with getString() not getDouble().
    You need to work with fully qualified names, (FQNs) like "com.acme.myproject.MyDynamicClass", not just the bare MyDynamicClass.
    The next question is where the .class files for the dynamically loaded classes are stored. If they are part of your normal program code, on the class path, then you can use Class.forName to load the class and return a Class object. If they are in some special place you'll need to create a URLClassLoader and get the Class from that.
    Generally, when you load a class this way, it should implement some known interface, or extend some know abstract class. By placing objects of the dynamic class in a reference to that interface you can use the methods defined in the interface.
    The usual way of getting an instance of a dynamic class is to call newInstance() on the Class object.

  • Bussiness Object creation for workflow

    Hi Experts,
    I am new in workflow and want to make the workflow for addition of two numbers.
    Please can anyone guide me the steps which i have to follow.
    I want to make my own BO , But there  several options like supertype,object type ..etc.
    Please explain the BO and other steps to follow .
    Rgds,
    Premraj

    Hi,
    U want to add two no. using BO.
    For this u have to create 'z' Object .
    Inside that create 'z'Method.
    Now after that u can write ur functionality of adding two no. in that method.
    this u can use in ur WF.
    Or u can use delegation also.
    Take selfitem as a supertype for BO.
    Or there is one step-conatiner operation...
    u can directly use that for addition of two numbers.
    details:
    Each business object has the following properties:
    a.     Object Type ID u2013 It is used for internal identification of the business object.
    b.     Object Name u2013 It is used for external identification of the business object.
                    Using this property external system can interact with SAP system.
    c.     Super Type u2013 It is the parent object from which all the components of the BO are inherited.
    d.     Name u2013 It is a descriptive name of the BO.
    e.     Description u2013 It is a brief description of the business object type.
    f.     Application - The application component to which the BO belongs to.
    g.     Program - Program that will contain the ABAP code of the BO.
    hope it helps u!
    Regards,
    Mamta

  • Authorization object creation for transaction MIGO

    Hi,
    We have created the auth object for acct asignment category with values as activity & acct assignment category.
    But when assigned to respective users, its still allowing to perform the transactions.
    Basically I am using this object for doing Goods Reciept tcode MIGO.
    As in if auth object carries value 'K' in this object i.e. for cost center then other user with value 'P' i.e. project wont be allowed to perform the MIGO for POs with 'K'.
    Kindly tell me the specifications for the auth object, so that it will restrict users from performing the MIGO.
    Regards,
    Krutika

    hi!
    1) identify the infoobject which must have restricted access. I think it is Profit Center in your case or may be PSP element
    2) in infoobject maintainance screen check Whether it is marked as Authorization relevant(RSD1)
    3) goto RSSM and create a new authorization object and add your infoobject to it.
    4) in PFCG role maintainance screen add create a new role Project Management and addt eh users to it. under the authorizations tab go to maintaina authorizatioons and add your authorization object that you create in RSSM. and maintain the correct values with in it.
    with regards
    ashwin

  • Object Creation for Hierarchy in BW side

    Hi
    Some hierarchies have been added in R/3 side for Account Group and Profit center group.In BW side i need to Create/maintain the infoobject for the same.
    Could anyone help me.How to go about this.I mean what are all the External chraracteristics i need to select for Account Group and Profit center group Or on what basis we need to select the external characteristics for these hierarchies.
    Regards
    Kumar

    Hi Kumar,
    In the characteristic (infoobject) select "with hierarchy" and activate.
    Create an infopackage for the hierarchy in the datasource and click the
    "Available Hierarchies from OLTP" button.
    Select the hierarchy you want to load in BW an start the infopackage.
    Success,
    Udo

  • XML log: Error during temp file creation for LOB Objects

    Hi All,
    I got this exception in the concurrent log file:
    [122010_100220171][][EXCEPTION] !!Error during temp file creation for LOB Objects
    [122010_100220172][][EXCEPTION] java.io.FileNotFoundException: null/xdo-dt-lob-1292864540169.tmp (No such file or directory (errno:2))
         at java.io.RandomAccessFile.open(Native Method)
         at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
         at java.io.RandomAccessFile.<init>(RandomAccessFile.java:98)
         at oracle.apps.xdo.dataengine.LOBList.initLOB(LOBList.java:39)
         at oracle.apps.xdo.dataengine.LOBList.<init>(LOBList.java:30)
         at oracle.apps.xdo.dataengine.XMLPGEN.updateMetaData(XMLPGEN.java:1051)
         at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(XMLPGEN.java:511)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:445)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroup(XMLPGEN.java:1121)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroup(XMLPGEN.java:1144)
         at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(XMLPGEN.java:558)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:445)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:308)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:348)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:293)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    I have this query defined in my data template:
    <![CDATA[
    SELECT lt.long_text inv_comment
    FROM apps.fnd_attached_docs_form_vl ad,
    apps.fnd_documents_long_text lt
    WHERE ad.media_id = lt.media_id
    AND ad.category_description = 'Draft Invoice Comments'
    AND ad.pk1_value = :project_id
    AND ad.pk2_value = :draft_invoice_num
    ]]>
    Issue: The inv_comment is not printing on the PDF output.
    I had the temp directory defined under the Admin tab.
    I'm guessing if it's the LONG datatype of the long_text field that's causing the issue.
    Anybody knows how this can be fixed? any help or advice is appreciated.
    Thanks.
    SW
    Edited by: user12152845 on Dec 20, 2010 11:48 AM

    Hi All,
    I got this exception in the concurrent log file:
    [122010_100220171][][EXCEPTION] !!Error during temp file creation for LOB Objects
    [122010_100220172][][EXCEPTION] java.io.FileNotFoundException: null/xdo-dt-lob-1292864540169.tmp (No such file or directory (errno:2))
         at java.io.RandomAccessFile.open(Native Method)
         at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
         at java.io.RandomAccessFile.<init>(RandomAccessFile.java:98)
         at oracle.apps.xdo.dataengine.LOBList.initLOB(LOBList.java:39)
         at oracle.apps.xdo.dataengine.LOBList.<init>(LOBList.java:30)
         at oracle.apps.xdo.dataengine.XMLPGEN.updateMetaData(XMLPGEN.java:1051)
         at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(XMLPGEN.java:511)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:445)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroup(XMLPGEN.java:1121)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroup(XMLPGEN.java:1144)
         at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(XMLPGEN.java:558)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:445)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:308)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:348)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:293)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    I have this query defined in my data template:
    <![CDATA[
    SELECT lt.long_text inv_comment
    FROM apps.fnd_attached_docs_form_vl ad,
    apps.fnd_documents_long_text lt
    WHERE ad.media_id = lt.media_id
    AND ad.category_description = 'Draft Invoice Comments'
    AND ad.pk1_value = :project_id
    AND ad.pk2_value = :draft_invoice_num
    ]]>
    Issue: The inv_comment is not printing on the PDF output.
    I had the temp directory defined under the Admin tab.
    I'm guessing if it's the LONG datatype of the long_text field that's causing the issue.
    Anybody knows how this can be fixed? any help or advice is appreciated.
    Thanks.
    SW
    Edited by: user12152845 on Dec 20, 2010 11:48 AM

  • Is JAXB suitable for large XML files ?

    Hi,
    I have a very large XML file (~700 MB) (schema available). I need to unmarshall this into java objects and carry out some (business validation rules) on it.. These buisness rules may involve validating data from content objects that correspond to different sections of this large XML file.
    I am uncertain whether JAXB will help me here. (just started on it) Does JAXB build the entire content tree for the XML document during Unmarshaller.unmarshall ? Is there anyway of asking it to build content objects on demand as opposed to building the whole content tree immediately ?
    All help/suggestions appreciated.

    Forgot to add:
    after carrying out validation the data is put into some RDBMS tables.
    One approach would be to convert the XML files into SQL Loader compatible flat files (using a tool). Load these flat files into staging tables. Perform business validations on staging table data and then finally move the data into the main tables. All the validating logic could either be in stored procedures or java code.
    The above is very long-winded. It would be great if JAXB can handle very large XML files (without loading the whole XML file into memory) so that business validations can be done by java, without any intermediate format conversion.
    I hope the above is somewhat clear.

  • Creation of new object link for DMS

    i have searched a lot  about Creation of new object link for DMS on internet .
    and all replies  focus on that documentation :
    1.     Program two screens for the following module pools for the SAP object that is to be linked additionally:
    u2013 SAPLCV00
    u2013 SAPLCVIN
    The process logic must be according to that of screen 0204 in program SAPLCV00 and must not be changed.
    2.     Create the function module OBJECT_CHECK_XXXX (XXXX = name of the SAP object).
    i need  to know how to implement that  in more detailed step by step
    as  i know DMS and  abap also.

    Hi Reda,
    Hope the below URL will help to understand how the Process of adding a object link works.
    Enhancement Without Modification of the Object Links - Engineering Change Management (LO-ECH) - SAP Library
    Thanks & Regards,
    Seshadri.

  • Java Mapping Using JAXB [Java Arch for XML Binding]

    Hi All,
    Anyone tried using JAXB  [Java Architecture for XML Binding API available with Java WebServices Pack] technique for XML processing in Java Mapping??
    I am facing the following problems..
    1. I am not able to generate namespace while marshalling target XML [In standalone mode and not tried in XI].
    2. What are the jar files we need to import?
       I tried importing the following jar files in XI.
    jaxb-api.jar,jaxb-impl.jar,jaxb-libs.jar,jax-qname.jar,namespace.jar,relaxngDatatype.jar
      and getting some errors while importing these files in XI.
    3. It throws error at runtime [Interface Mapping-Test Tab]
       like Resource not found:javax/xml/bind/Messages_en.properties,javax/xml/bind/Messages_en_US.properties
    4. Even after creating a copy of available file Messages.Properties with name: Messages_en.properties and Messages_en_US.properties.. it is not generating any messages in Target message tab
    Thanks in Advance,
    Ananth Chinnaraj

    Sravya ,
    I have searched wide and far for this, but no success.
    A lot on JAXB XI and Webdynpro, but nothing on JAXB, XI and mappings.
    Could you please post the url here ?
    Thanks and kind regards,
    Jan

  • Automate creation of web.xml file for tomcat 4.1.29

    hi , this is with ref to Tomcat 4.1.29, if i am correct, each Servlet in the application has to be mentioned in the web.xml file for the Tomcat to know about it. Is there any way to automate the creation of web.xml file , depending on the contents of the Servlet folder of the application. Any way to escape from writing each Servlet name in web.xml file.
    rc

    Hello,
    Maybe you should check if you can use Ant tool to do
    that. I am not sure if it can help u.
    Zeph.
    http://ant.apache.org/
    It will, specially if used in conjunction with XDoclets :
    http://xdoclet.sourceforge.net/
    XDoclet has Ant tasks to generate web.xml files.

  • Authorization Object for role creation for query display?

    Hi,
    Can Anybody here tell me what is the Authorization object that we use for role creation for query display?
    I want to assign a role to the newly designed query! that query does not have any role so far!
    Pls suggest me
    Thanks,
    Ravi

    Hi,
    I could make the authorization tab green by entering the authorization object!
    But user tab still remains red as it is not allowing me to enter my username in the user tab!
    in the user tab  i am unable to enter my user name?
    Any suggestions?
    Thanks,
    Ravi

Maybe you are looking for