Problems with a Java Mapping

Hi Experts,
as part of my diploma-thesis I have to write a java SAX-Mapping, which mapps the following incoming message:
mt_MappingOUT
             set
                 set_Element_01
                 set_Element_02
                 set_Element_03
                 set_Element_10
to the following outgoinig message:
mt_MappingIN
              TABLE
                    item
                        item_FIELD_01
                        item_FIELD_10
I develped the following code, which unfortunately results in "XML is not well defined" while testing. Unfortunately I cannot find the problem. So I hope someone of you can have a look an will have an idea.
Created on 20.12.2007
@author Sebastian Geissler
import java.io.FileInputStream;
import java.io.FileOutputStream;
import com.sap.aii.mapping.api.*;
import java.io.*;
import java.util.Map; import javax.xml.parsers.*;
import org.xml.sax.; import org.xml.sax.helpers.;
public class SETtoITEMjavaSAX extends DefaultHandler implements StreamTransformation
     private Map map;
     private OutputStream out;
     public void setParameter (Map param)
          map = param;
     public void execute (InputStream in, OutputStream out)
     throws com.sap.aii.mapping.api.StreamTransformationException
          DefaultHandler handler = this;
          SAXParserFactory factory = SAXParserFactory.newInstance();
          try
               SAXParser saxParser = factory.newSAXParser();
               this.out = out; saxParser.parse(in, handler);
          catch (Throwable t)
               t.printStackTrace();
     private void write (String s) throws SAXException
          try
               out.write(s.getBytes()); out.flush();
          catch (IOException e)
               throw new SAXException("I/O error", e);
     public void startDocument () throws SAXException
          write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
          write("<ns0:mt_MappingIn xmlns:ns0=\"urn:agrp:xi:geissseb\"><TABLE>");
     public void endDocument () throws SAXException
          write("</TABLE></ns0:mt_MappingIn>");
          try { out.flush();
          catch (IOException e) {
               throw new SAXException("I/O error", e);
     public void startElement (String namespaceURI, String sName, String qName, Attributes attrs)
     throws SAXException
          String eName = sName;
          if ("".equals(eName))
               eName = qName;
          if(eName.equals("set"))
               write("<item>");
          if(eName.substring(0,6).equals("set_E"))
               write("<item_FIELD"eName.substring(10,13)">");
     public void endElement (String namespaceURI, String sName, String qName) throws SAXException
          String eName = sName;
          if ("".equals(eName))
               eName = qName;
          if(eName.equals("set"))
               write("</item>");
          if(eName.substring(0,6).equals("set_E"))
               write("</item_FIELD"eName.substring(10,13)">");
     public void characters (char buf[], int offset, int len)
     throws SAXException {
          String s = new String(buf, offset, len);
          write (s);
Thank you,
Sebastian

Hi  Ravi, hi Raman,
thanks so far... I did some changes in my code, but I am still having the same problem... down there you will find my new code and the source message.
there is my new code:
private Map map;
     private OutputStream out;
     public void setParameter (Map param)
               map = param;
     public void execute (InputStream in, OutputStream out)
     throws com.sap.aii.mapping.api.StreamTransformationException
          DefaultHandler handler = this;
          SAXParserFactory factory = SAXParserFactory.newInstance();
          try
               SAXParser saxParser = factory.newSAXParser();
               this.out = out; saxParser.parse(in, handler);
          catch (Throwable t)
               t.printStackTrace();
     private void write (String s) throws SAXException{
          try{
               out.write(s.getBytes()); out.flush();
          catch (IOException e){
               throw new SAXException("I/O error", e);
     public void startDocument () throws SAXException{
          write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
          write("<ns0:mt_mappingOUT xmlns:ns0=\"urn:agrp:xi:geissseb\"><TABLE>");
     public void endDocument () throws SAXException {
          write("</TABLE></ns0:mt_mappingOUT>");
          try { out.flush();
          catch (IOException e) {
               throw new SAXException("I/O error", e);
     public void startElement (String namespaceURI, String sName, String qName, Attributes attrs)
     throws SAXException {
          String eName = sName;
          if ("".equals(eName))
               eName = qName;
          if(eName.equals("mtset"))
               write("<item>");
          if(eName.substring(0,2).equals("se"))
               write("<Item_FIELD_"eName.substring(13,14)">");
     public void endElement (String namespaceURI, String sName, String qName) throws SAXException {
          String eName = sName;
          if ("".equals(eName))
               eName = qName;
          if(eName.equals("mtset"))
               write("</item>");
          if(eName.substring(0,2).equals("se"))
               write("</item_FIELD_"eName.substring(13,14)">");
     public void characters (char buf[], int offset, int len)
     throws SAXException {
          String s = new String(buf, offset, len);
          write (s);
and there is the source message:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:agrp:xi:geissseb" targetNamespace="urn:agrp:xi:geissseb">
     <xsd:element name="mt_MappingOut" type="dt_MappingOut" />
     <xsd:complexType name="dt_MappingOut">
          <xsd:annotation>
               <xsd:appinfo source="http://sap.com/xi/TextID">
               4c79fbb0bde711dcae43001a4b0af224
               </xsd:appinfo>
          </xsd:annotation>
          <xsd:sequence>
               <xsd:element name="set">
                    <xsd:annotation>
                         <xsd:appinfo source="http://sap.com/xi/TextID">
                         0b366510aeda11dcb3bb00174205b856
                         </xsd:appinfo>
                    </xsd:annotation>
                    <xsd:complexType>
                         <xsd:sequence>
                              <xsd:element name="set_ELEMENT_01" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b366511aeda11dcaf2600174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                              <xsd:element name="set_ELEMENT_02" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b366512aeda11dc84d400174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                              <xsd:element name="set_ELEMENT_03" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b366513aeda11dcbcab00174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                              <xsd:element name="set_ELEMENT_04" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b366514aeda11dc96a300174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                              <xsd:element name="set_ELEMENT_05" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b366515aeda11dca77700174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                              <xsd:element name="set_ELEMENT_06" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b366516aeda11dc8f7d00174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                              <xsd:element name="set_ELEMENT_07" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b366517aeda11dcc24b00174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                              <xsd:element name="set_ELEMENT_08" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b366518aeda11dc92cd00174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                              <xsd:element name="set_ELEMENT_09" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b366519aeda11dcc9b100174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                              <xsd:element name="set_ELEMENT_10" type="xsd:string">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        0b36651aaeda11dcc5a700174205b856
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                         </xsd:sequence>
                    </xsd:complexType>
               </xsd:element>
          </xsd:sequence>
     </xsd:complexType>
</xsd:schema>
I really hope you can help me there..
Thanks in advance..
Sebastian

Similar Messages

  • Problem with castor xml mapping

    Hi,
    we have following problem with castor xml mapping.
    How to use references in the collections(Hashmap or vector)?
    WE have a method called getAttribute map which will return a hashmap consist different type of objects. We want to keep only the
    references of objects if that object occurs more than once,instead of keeping the whole object
    Following is the the xml mapping file.
    <mapping>
    <class name="com.opvista.ndtool.core.mos.ManagedObject" identity="Id" auto-complete="false" verify-constructable="false">
    <map-to xml="ManagedObject"/>
    <field name="Id" get-method="getId" set-method="setId" type="string">
    <bind-xml name="Id" node="attribute"/>
    </field>
    <field name="AttributeMap" type="org.exolab.castor.mapping.MapItem" collection="map" get-method="getAttributeMap">
    <bind-xml name="AttributeMap" node="element">
         <class name="org.exolab.castor.mapping.MapItem">
    <field name="key" type="java.lang.Object">
         <bind-xml name="key" node="attribute"/>
    </field>
    <field name="value" type="java.lang.Object">
         <bind-xml name="value" node="element" reference="true"/>
         </field>
    </class>
         </bind-xml>
    </field>
    </class>
    </mapping>
    we are using reference=true for the values. But it will throw below exception.
    Unable to resolve ID for instance of class 'java.lang.String' due to the following error: Unable to resolve ClassDescriptor.
         at org.exolab.castor.xml.Marshaller.getObjectID(Marshaller.java:1988)
         at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1628)
         at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1831)
         at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1814)
         at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1825)
         at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:821)
    Please help us to overcome from this problem?
    Thanks,
    Dileep

    for your ref here is what i think the basic mapping file would look like
    <class name="Person">
    <map-to xml="person"/>
    <field name="name" type="string">
    <bind-xml name="name" node="attribute" />
    </field>
    <field name="age" type="string">
    <bind-xml name="age" node="attribute" />
    </field>
    </class>
    <class name="MetaPerson">
    <map-to xml="person"/>
    <field name="dependents" type="string">
    <bind-xml name="dependents" node="attribute" />
    </field>
    <field name="presentAdd" type="string">
    <bind-xml name="present_add " node="attribute" />
    </field>
    <field name="permanentAdd" type="string">
    <bind-xml name="permanent_add " node="attribute" />
    </field>
    </class>
    however i am still not clear as to how i can use the metaperson object in the person class as well as in the mapping file.
    hope this gives a better idea abt my problem statement.
    Please help me out

  • Problems with external context mapping

    Hi ,
    I am having the following problems with external context mapping from one WD component to another.
    Problem description:
    In the <i>Component Interfaces</i> I have defined a WD interface "InfA".
    In the <i>interface controller</i> of this compoenent,I have ContextA and attributeA(cardinality 1..1).The contextA is marked as an "Input Element".
    Now my webdynpro componentB adds InfA as used component.In componentB I decalre a contextB with attributeB and map it to contextA to set up the external context mapping.
    Now I expect that if any webdynpro component implements this WD interface InfA ,he has access to contextA with the data getting filled from contextB.
    After i have created the component for the used component I try to fill values in the source node contextB thru this code:
    wdContext.currentContextB.setB(value);
    But in the runtime I keep getting error nullPointerException for nodeContextB,suggesting that the mapping has not been completed.
    Can anyone suggest due to what the error can come ,and, if its a webdynpro bug ,is there a workaround??
    Thanks in advance for your help.
    Best regards
    Sourav

    HI,
    Valery : I personally checked  by doing the example, if the names of value attribute are different in the child's interface and parents component controller then it throws the exception.
    Sourav: NullPointer Exception is thrown when something is not properly initialised, if in the main component the cardinality of mapped origin is 1.1 then you need to access it element directly like:
    wdContext.currentParentNodeElement().setFname("Abhijeet");
        wdContext.currentParentNodeElement().setLname("M");
    i will suggest just check out if you are declaring some element of value node and without initialising taking its use or what?
    if this doesnt solve your problem, please post the expanded exception.
    hope it helps
    let me know if you face nay problem
    regards

  • Solution Manager systems RAM requirements - problems with the Java Engine

    Hello,
    I am about to install SAP Solution Manager 7 on a WIndows 2003 Server x64 but I need to know what the RAM requirements are? I have been having problems with the Java Engine starting and it seems to time out, I have heard that this is a very RAM hungry process and it might be why?
    Many thanks for your help in advance,
    Omar

    Hello Omar,
    To size SAP Solution Manager 7.0 EHP1 we recommend to use the SAP Solution Manager Quicksizer Tool at:
    http://service.sap.com/sizing-solman
    Here you find information on how to use the tool, how to collect input data for E2E Scenario Sizing, on SAP E2E RCA Sizing, Introscope Tuning, Wily Enterprise Manager Cluster Setup for E2E RCA Scenario and BI Aggregation Strategy in E2E Scenario.
    Please find more information about installing Solution Manager in:
    http://service.sap.com/instguides -> SAP Solution Manager
    I hope this information helps.
    Thanks,
    Mark

  • JCoIDoc IDocLibrary 3.0.2 Problems with IDocServerExample.java

    Hello, I´m facing a problem with IDocServerExample.java. I created a new project in eclipse, added the package com.sap.conn.idoc.examples and the class IDocServerExample.java. I configured the files "MYSERVER.jcoServer" and "BCE.jcoDestination" and started the application. Then I get the following error messages: *********************************************************************************************************************************************************
    com.sap.conn.jco.JCoException: (102) RFC_ERROR_COMMUNICATION: Unable to get repository at com.sap.conn.jco.rt.DefaultServer.update(DefaultServer.java:136) at com.sap.conn.jco.rt.DefaultServer.(DefaultServer.java:105) at com.sap.conn.idoc.jco.DefaultJCoIDocServer.(DefaultJCoIDocServer.java:35) at com.sap.conn.idoc.jco.DefaultJCoIDocServerFactory.createServer(DefaultJCoIDocServerFactory.java:17) at com.sap.conn.idoc.jco.DefaultJCoIDocServerFactory.createServer(DefaultJCoIDocServerFactory.java:13) at com.sap.conn.jco.rt.DefaultServerManager.getServer(DefaultServerManager.java:108) at com.sap.conn.jco.rt.StandaloneServerFactory.getServerInstance(StandaloneServerFactory.java:170) at com.sap.conn.idoc.jco.JCoIDoc.getServer(JCoIDoc.java:78) at com.sap.conn.idoc.examples.IDocServerExample.main(IDocServerExample.java:18) Caused by: com.sap.conn.jco.JCoException: (102) RFC_ERROR_COMMUNICATION: Connect to message server host failed Connection parameters: TYPE=B DEST=JCOSERVER01 MSHOST=arm115tx GROUP=PUBLIC R3NAME=T01 PCS=1 LOCATION CPIC (TCP/IP) on local host rz1462 with Unicode ERROR service '?' unknown TIME Tue Jul 07 09:09:40 200 RELEASE 711 COMPONENT NI (network interface) VERSION 39 RC -3 DETAIL NiErrSet COUNTER 2 at com.sap.conn.jco.rt.MiddlewareJavaRfc.generateJCoException(MiddlewareJavaRfc.java:615) at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1280) at com.sap.conn.jco.rt.ClientConnection.connect(ClientConnection.java:661) at com.sap.conn.jco.rt.PoolingFactory.init(PoolingFactory.java:103) at com.sap.conn.jco.rt.ConnectionManager.createFactory(ConnectionManager.java:171) at com.sap.conn.jco.rt.DefaultConnectionManager.createFactory(DefaultConnectionManager.java:44) at com.sap.conn.jco.rt.ConnectionManager.getFactory(ConnectionManager.java:160) at com.sap.conn.jco.rt.RfcDestination.initialize(RfcDestination.java:789) at com.sap.conn.jco.rt.RfcDestination.getSystemID(RfcDestination.java:817) at com.sap.conn.jco.rt.RepositoryManager.getRepository(RepositoryManager.java:32) at com.sap.conn.jco.rt.RfcDestination.getRepository(RfcDestination.java:891) at com.sap.conn.jco.rt.DefaultServer.update(DefaultServer.java:132) ... 8 more Caused by: RfcException: [null] message: Connect to message server host failed Connection parameters: TYPE=B DEST=JCOSERVER01 MSHOST=arm115tx GROUP=PUBLIC R3NAME=T01 PCS=1 LOCATION CPIC (TCP/IP) on local host rz1462 with Unicode ERROR service '?' unknown TIME Tue Jul 07 09:09:40 200 RELEASE 711 COMPONENT NI (network interface) VERSION 39 RC -3 DETAIL NiErrSet COUNTER 2 Return code: RFC_FAILURE(1) error group: 102 key: RFC_ERROR_COMMUNICATION at com.sap.conn.rfc.engine.RfcIoControl.error_end(RfcIoControl.java:255) at com.sap.conn.rfc.engine.RfcIoControl.ab_rfcopen(RfcIoControl.java:94) at com.sap.conn.rfc.api.RfcApi.RfcOpen(RfcApi.java:83) at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1273) ... 18 more
    Does anyone know what I´m doing wrong? With thanks, Veit

    Im having the same issue here.  Has anyone found a solution to this?

  • Problem with list and map in GWT

    I have a problem with map and list in GWT. I need to put a map in to a list but GWT does not support ArrayList and HashMap since they are not serialized types.
    Exactly I want to create following list with out using ArrayList and HashMap
    ArrayList<HashMap<String, Object>> map = new ArrayList<HashMap<String,Object>>(); Thank you for new ideas,
    Regards

    If try to use ArrayList then I receive following exception when I make a rpc call.
    Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'java.util.ArrayList' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.:

  • Problems with a java bean in Weblogic 5.1

    Hello,
              I am having a problem deploying a java bean in Weblogic 5.1:
              I have been given a .class and a .jar file for a java bean (not an EJB). I
              placed the .class file into e:\temp\WEB-INF\classes and added the following
              line to my weblogic.properties file:
              weblogic.httpd.webApp.testApp=e:/temp/
              I have also updated the web.xml file in the WEB-INF directory as follows:
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
              Application 1.2//EN"
              "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <servlet>
              <servlet-name>EdIface</servlet-name>
              <jsp-file>test.jsp</jsp-file>
              </servlet>
              <servlet-mapping>
              <servlet-name>EdIface</servlet-name>
              <url-pattern>EdIface</url-pattern>
              </servlet-mapping>
              </web-app>
              When I try to access my http:\\server:port\testApp\test I get an "Error
              500 - internal server error".
              Has anyone had experice with deploying a java bean with jsut the .class and
              .jar file? Where should I put the .jar file?
              I appreciate any advice!
              

    Bump

  • Problem in SAX Java mapping

    Hi,
    I'm using SAX Java mapping in one scenario. Problem is when I get some Croatina characters, like Đ or u0160,
    output XML is not valid. XML Spy complains, IE complains and so on. Customer is sure  that data ( XML in CLOB field in Oracle DB) is UTF-8? What could be a problem?
    What I'm doing is reading entire XML into string with help of BufferedReader, then do some manipulation and write String into byte array with:
                   byte[] bytes = file.toString().getBytes("UTF-8");
                   saxParser.parse(new ByteArrayInputStream(bytes), handler);
    and then of course parse XML. readLine method reads data and problematic is "Ä�" - ￯0 - 0xC490.
    For this character XML Spy doesn't complain, IE also. After conversion, this character looks like "Ä?" - 0xC43F, and this is not good any more. Why?

    Hi Stefan,
    I've finally done it. Code as foollws:
         public void execute(InputStream in, OutputStream out)
                   throws com.sap.aii.mapping.api.StreamTransformationException {
              DefaultHandler handler = this;
              SAXParserFactory factory = SAXParserFactory.newInstance();
              try {
                   SAXParser saxParser = factory.newSAXParser();
                   fStreamOut = new BufferedWriter(new OutputStreamWriter(out, "UTF-8"));
                   encoding = "UTF-8";
                   if (map != null) {
                        mappingTrace = (MappingTrace) map
                                  .get(StreamTransformationConstants.MAPPING_TRACE);
                   InputStreamReader is = new InputStreamReader(in, "UTF8");
                   BufferedReader reader = new BufferedReader(is);
                   StringBuffer file = new StringBuffer();
                   String line = new String();
                   try {
                        while ((line = reader.readLine()) != null) {
                             file.append(line);
                   } catch (IOException e) {
                        e.printStackTrace();
                   } finally {
                        try {
                             in.close();
                        } catch (IOException e) {
                             e.printStackTrace();
                   Date d4 = new Date();
                   file = replaceREGEX(
                             "<\\?xml version=\"1\\.0\" encoding=\"UTF-8\"\\?>", "",
                             file);
                   char[] cArray = file.toString().toCharArray();
                   Date filedat = new Date();;
                   SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd_HHmmss_SSS");
                   String fName = df.format(filedat) + "_El_Invoice.xml";
                   Writer out1 = new BufferedWriter(new OutputStreamWriter(
                             new FileOutputStream(fName), "UTF8"));
                   try {
                        out1.write(file.toString().toCharArray());
                        out1.close();
                   } catch (UnsupportedEncodingException e) {
                   } catch (IOException e) {
                   saxParser.parse(fName, handler);
                   File outFile = new File(fName);
                   outFile.delete();
              } catch (Throwable t) {
                   if (mappingTrace != null) {
                        mappingTrace.addInfo(t.toString());
                   t.printStackTrace();
    problem was also in method for writing in output stream, so I've changed it:
         private void printOutPut(String sOP) {
              try {
                      //    fStreamOut.write(sOP.getBytes());
                   fStreamOut.write(sOP);
              } catch (IOException e) {
                   e.notify();

  • Problem with Context in mapping

    Hi.
    I  have a big problem with my mapping.
    My input look like this.:
    - <Rec>
    - <raw>
      <Rec_type>B</Rec_type>
      <Record_data>0000340H150000006269 N2007020105070000727001000009000540006599350000000000</Record_data>
      </raw>
    - <raw>
      <Rec_type>C</Rec_type>
      <Record_data>0000350H1500000062690000107074030000610000000060800000004910001080 80620000727001</Record_data>
      </raw>
    - <raw>
      <Rec_type>D</Rec_type>
      <Record_data>0000360H15000000626900001070740000107079030000610000000060800000004920000000727001</Record_data>
      </raw>
    - <raw>
      <Rec_type>D</Rec_type>
      <Record_data>0000370H15000000626900001070740000107432030000000000000000000000000000000000727001</Record_data>
      </raw>
    - <raw>
      <Rec_type>C</Rec_type>
      <Record_data>0000380H1500000062690000115008010004995000000499900000041630001610 83470000727001</Record_data>
      </raw>
    - <raw>
      <Rec_type>C</Rec_type>
      <Record_data>0000390H1500000062690000115008050003997000000400300000033320001660 83470000727001</Record_data>
      </raw>
    - <raw>
      <Rec_type>C</Rec_type>
      <Record_data>0000400H1500000062690000115008030002996000000300000000024980001640 83470000727002</Record_data>
      </raw>
    - <raw>
      <Rec_type>C</Rec_type>
      <Record_data>0000410H1500000062690000115008040003995000000399900000033300001630 83470000727002</Record_data>
      </raw>
    - <raw>
      <Rec_type>C</Rec_type>
      <Record_data>0000420H1500000062690000115483010004850000000480100000040250000300 83110000727002</Record_data>
      </raw>
    - <raw>
      <Rec_type>D</Rec_type>
      <Record_data>0000430H15000000626900001154830000107432010000000000000000000000000000000000727002</Record_data>
      </raw>
    - <raw>
      <Rec_type>D</Rec_type>
      <Record_data>0000440H15000000626900001154830000107079010001453000000144000000011710000000727002</Record_data>
      </raw>
    - <raw>
      <Rec_type>D</Rec_type>
      <Record_data>0000450H15000000626900001154830000115124010003397000000336100000028590000000727002</Record_data>
      </raw>
    - <raw>
      <Rec_type>C</Rec_type>
      <Record_data>0000460H1500000062690000115502020004012000000399900000029470001240 73570000727001</Record_data>
      </raw>
    My target is an iDoc with this structure.:
    IDOC
    - E1OILT1
    - -   xxxx
    - -   xxxx
    - -   E1OILT2
    - -   E1OILT2
    - -   E1OILT2
    - -   E1OILT3
    - -   E1OILT3
    For each B-record I'm going to produce an iDoc.
    My problem is that all "C"-records shall into the first E1OILT3-segment and
    all "D"-records shall into the second E1OILT3-segment.
    It works well with the C-record but not with the D-records.
    D is depend on C, but C dont need to have a D-record.
    C could also have several D-records.
    Don't know if I explained this good enough but i hope  someone could give me an hint whats wrong with my context.
    Thanks

    then i think you need to write some JAVA code to do this.
    Create a User-Defined Function.
    and start using some of the ResultList Methods.
    check the blogs to how to do this.
    it will take you some time beacuse you need to understand the concept of Context if you don't know already.
    there is some methods like "addValue" that create a new Value.
    Regards,
    Roi Grosfeld

  • Problems with EJB relationship mapping (annotations)

    So, I'm part of a group working on a web-based project management system, and we're having some trouble with the relationship mapping between the entity beans.
    I've been mainly working on a class called WorkPackage. So the mappings I've got:
    Within the WorkPackage class
    (A work package is one "module" of work within a project)
            @Entity
            @Table(name="WorkPackage")
            @IdClass(WorkPackagePK.class)
            public class WorkPackage implements java.io.Serializable
            @Id
            @Column(name="wpID")
            public String getWpID() { return wpID; }
         public void setWpID(String id) { this.wpID = id; }
         @Id
            @Column(name="projID")
            public String getProjId() { return projId; }
         public void setProjId(String projId) { this.projId = projId; }
            @ManyToOne // bidirectional - owner side
         @JoinColumn(name="projID")
         public Project getProject() { return project; }
         public void setProject(Project project) { this.project = project; }      And on the Project side
            @Entity
            @Table(name="Project")
            public class Project implements java.io.Serializable
            @Id
            @Column(name="projID")
            public String getId() { return id; }
         public void setId(String id) { this.id = id; }
           @OneToMany(mappedBy="project") // biderctional - target side
         public Set<WorkPackage> getWorkPackages() { return workPackages; }
         public void setWorkPackages(Set<WorkPackage> workPackages) { this.workPackages = workPackages; } The problem here is that its apparently seeing 'projID' as attempting to be mapped to 2 columns within the 'workpackage' table in the database instead of using the @Id one as the id, and the other as the foreign key to the 'project' table.
    So, when I try to add a workpackage to the database via a JSF page, it gives me the error 'java.sql.BatchUpdateException: Column 'projID' specified twice'.
    Maybe its something to do with variable in the project class being called 'id' even though its mapped to the database column 'projID'
    Edited by: wormdundee on Mar 1, 2008 2:26 PM

    I think the trouble is that you overrode the column names for the projID and project properties to the same value. Try
    @Entity
            @Table(name="WorkPackage")
            @IdClass(WorkPackagePK.class)
            public class WorkPackage implements java.io.Serializable
            @Id
            @Column(name="WP_WP_ID")
            public String getWpID() { return wpID; }
         public void setWpID(String id) { this.wpID = id; }
         @Id
            @Column(name="WP_PROJ_ID")
            public String getProjId() { return projId; }
         public void setProjId(String projId) { this.projId = projId; }
            @ManyToOne // bidirectional - owner side
         @JoinColumn(name="WP_PROJECT_PROJ_ID")
         public Project getProject() { return project; }
         public void setProject(Project project) { this.project = project; }

  • Performance problems with new Java Tiger style recommendations

    Performance problems with jdk 1.5 on Linux plattform
    (not tested on Windows, might be the same)
    using the new style recommendations.
    I need fast Vector loops for high speed mathematical calculations, some
    hints about the fastest way to program that loop would be also great!
    After refactoring using the new features from java 1.5 (as recommended from
    SUN) I lost performance significantly:
    using a vector:
    public Vector<unit> units;
    The new code (recommended from SUN for Java Tiger for redesign):
    for (unit u: units) u.accumulate();
    runs more than 30% slower than the old code:
    for (int i = 0; i < units.size(); i++) units.elementAt(i).accumulate();
    I expected the opposite.
    Is there any information available that helps?
    The following additional information I got from Mr. Shankar Unni:
    I got some fairly anomalous results comparing ArrayList and Vector: for the
    1.5-style loops, ArrayList was faster then Vector, but for a loop with get()
    calls, Vector was faster. Vector was even faster than that using
    elementAt(), which was a surprise:
    For a million summing iterations over a 100-element array:
    vector elementAt loop took 3446 ms.
    vector get loop took 3796 ms.
    vector iterator loop took 5469 ms.
    arraylist get loop took 4136 ms.
    arraylist iterator loop took 4668 ms.

    If your topic doesn't change, please stay in your original post.

  • A problem with my Java Scrabble game

    Hello
    I am making a Java Scrabble game for a school assignment and I have a problem with the following:
    The number of players is input by the user (2 to 4) and i need to create a number of arrays based on the number of players. These arrays must have 7 playing pieces at all times until the "bag" of pieces has less pieces than those required to replace the ones a certain player just used (in wich case the bag would give that player all of it's remaining pieces and, from this point on, the player arrays would not necessarily need to have 7 pieces).
    this is my procedure to take a piece from the bag:
         public Piece takePiece()
              if (this.pieceCounter > 0) {
                   Arrays.sort(this.pieces, 0, this.pieceCounter);
                   int i = this.generator.nextInt(this.pieceCounter);
                   Piece p = this.pieces;
                   this.pieceCounter--;
                   this.pieces[i] = this.pieces[this.pieceCounter];
                   return p;
              else
                   return null;
    this is my Piece class:
    public class Piece implements Comparable {
         private int scorePiece;
         private char letterPiece;
         public Piece(char letterPiece, int scorePiece)
              this.scorePiece = scorePiece;
              this.letterPiece = letterPiece;
         public int scorePiece()
              return scorePiece;
         public String letterPiece()
              return letterPiece();
         public String toString()
              return letterPiece+ " " + scorePiece;
         public int compareTo(Object a)
              Piece piece= (Piece) a;
              return (int) letterPiece - (int) piece.letterPiece;
    }Thanks in advance for your help

    Ok, if i create a Players class and do this in Main class:
         if(nPlayers >= 2 && nPlayers <= 4)
              Players arrayPlayers[];
              arrayPlayers= new Players [nPlayers ];
              for(int i=0 ; i < nPlayers ; i++)
                       arrayPlayers[i] = new Players ();
              }My Players Class should contain something like this:
             // Array of 7 that contains Pieces...
         Piece[] pieces= new Piece[7];how can i get pieces from takePiece(); (Class Bag) and put them in the pieces arrays until takePiece(); returns null?

  • Problem in Uploading Java mapping Code

    Hi Guys,
                  I never work on Java mapping before, i got the code required for my progrmme in these forums.So i saved it as a text file. now i want to import that fileintomy programme as Java class. i think i have to use Netweaver Studio. what exactly i have o do it.
    Thanks in advance.
    Kartik

    Hello Kartik,
    If your code is handling the Required Mapping.Then what is you need to do is  :
    Create the Jar file using any Java IDE (or) use Netweaver developer studio.
    Before creating the u201Cjaru201D file just make sure that the "path" of the class file in the imported archive. It should be the
    same as your "package" path.
    Once the class file is created, we have to create the jar file with all the necessary files. After creating the jar file, it
    has to be deployed to XI.
    Import the Jar file using Imported Archive  in IR under Mapping Objects.
    See this blog it explains how to load :
    Java Mapping (Part III)
    After doing the necessary setps you can test the Mapping.
    regards
    Gangaprasad

  • Problem with shared column mapping

    I have a problem with mapping different fields onto the same column. In most cases Kodo handles it very well but one tough case it does not
    Modification references contract N-1 using contract_id field
    Contract back references two modifications out of all modification owned by THIS contract (last_modification and executed_modifcation)
    when both modifications are not null it works fine since I make sure both fields point to modification owned by the same contract
    hovewer when I set one of the fields (executed_modifcation) to null (after it was not null) Kodo attempts to set not only executed_modifcation field to null but contract_id as well. Which obviously not desired
    I understand that it is a pretty hard corner case. Do you think you can handle it or it is a dead end?
    Attached are my files

    Abe,
    I fully agree with your analysis. In my case we can use precedence of direct
    mappings over reference mapping in null situation.
    However as you noted, there are cases when we have only references and so
    you can not say which mapping is more important. However since we are
    resolving NULL issue here, I am not sure we need to know precedence of
    references - not null case should always take precedence. In other words:
    priority 1: direct mapping
    priority 2: not null reference
    priority 3: null reference
    Of course all three cases are subject rule of not changing value of shared
    column
    "Abe White" <[email protected]> wrote in message
    news:[email protected]...
    I admit that I didn't go through all your metadata, but I do believe that
    3.0 final will handle this case. My plan is to implement updates such
    that direct field mappings always take precedence over foreign key
    mappings.
    Let's say column CONTRACT_ID is used by int field contractId and is
    also used by field lastModification as part of an FK to a Modification
    instance (which I believe is close to your mapping). Because contractId
    is a simple field rather than a foreign key, Kodo will give it the final
    say on nulling/defaulting the CONTRACT_ID column. So if you null the
    lasetModification field, CONTRACT_ID will retain the value of the
    contractId field. Any non-null value of the lastModification field will
    stilly have to jive with the contractId field, though, or else we'll
    throw an exception like we do currently when you try to set 1 column to
    multiple values.
    I believe this solves the common case of shared
    columns between direct mappings and FK mappings. There are other cases
    in which multiple FK mappings overlap on certain columns, and this does
    not solve nulling problems in those instances. However, I think those
    cases are very rare and not worth the effort. Correct me if I'm wrong
    and your situation actually is one of sharing columns between multiple
    FKs and no primitives after all.

  • Problem with places, the map is disappear

    HI everyone,
    I notice today a problem with iphoto 9 (ver 8.1.2), if i go to places the map on the right is disappear, i have geotagged some photos but nothing, so I have no map inside spaces, any guess?
    Thank you
    Michele

    in the iPhoto preferences is look up places set to automatically?
    When you click on the little "i" in the lower right hand corner of any of these photos does it flip over and show the location?
    LN

Maybe you are looking for

  • Z2 Tablet LTE - 2 questions?!

    basically I bought a Z2 LTE Tablet 2nd hand from my local cash converters, will this be under warranty if something breaks? and: I have android L on my device, 5.0.2 but according to your site: Latest available software: 23.1.A.1.28 there's a new upd

  • Install disk misplaced - where can I download Rosetta?

    Hello, Someone I work for didn't install rosetta when they install OSX 10.6 . I need to install an app that uses rosetta.  They've misplaced the install disk. The link I found to Rosetta redirects to a "Lion" page. Does anyone have a solution? I have

  • FRM-40031 is not a forms run time file

    FRM-40031 is not a forms run time file Hello, I'm using forms 6i and developed and compiled and ran the form successfully without any errors. I registered in Oracle Apps 11.5 but at the time if accessing the form, I'm getting the above error. Any hel

  • Problem manually transferring music to Ipod Nano

    I am trying to manually add music from my iTunes to my Ipod Nano. I highlight the relevant song/playlist and drag over the Ipod in the menu on then left hand side of the screen, but when my mouse is over the Ipod, it just shows a 'no-entry' type of l

  • CS6 lost disc. Do I have to buy it again?

    I bought the CS6 and promptly lost the disc before I could download it onto my computer. I still have the box, it has a sticker with some codes on the bottom, not sure if those would do anything? So my question is, do I have to buy it again or will t