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; }

Similar Messages

  • Problems with EJB Relationships

    Hi,
    I'm having a problems using relationships in EJB. There are two entities: User and Profile. The User entity is a simple entity, with some String fields and two Integer fields (the primary key and the foreign key - coming from Profile). The Profile entity has some String fields and an Integer field (the primary key).
    There is no problem when executing the ejbCreate() method on the Profile entity. Everything goes fine. But, when executing the ejbCreate() on the User entity, the following message appears:
    javax.ejb.CreateException: Could not create entity:java.sql.SQLException: ORA-06550: line 1, column 83:
    PL/SQL: ORA-00957: duplicate column name
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    The relationship between the two entities is like that:
    "UserBean"
    * Returns the profileId
    * @return the profileId
    * @ejb.persistent-field
    * @ejb.persistence
    * column-name="PROFILE_ID"
    * sql-type="NUMBER"
    * @ejb.interface-method
    * @ejb.relation
    * name="profile-user"
    * role-name="user-has-profile"
    * target-ejb="Profile"
    * target-multiple="no"
    * target-role-name="profile-is-in-user"
    * @jboss.relation
    * fk-column="profile_id"
    * related-pk-field="profileId"
    public abstract java.lang.Integer getProfileId();
    * Sets the profileId
    * @param java.lang.Integer the new profileId value
    * @ejb.interface-method
    public abstract void setProfileId(java.lang.Integer profileId);
    "ProfileBean"
    * Returns a Collection of Usuario
    * @return a Collection of Usuario
    * @ejb.interface-method
    * view-type="both"
    * @ejb.relation
    * name="perfil-usuario"
    * role-name="perfil-tem-usuario"
    public abstract java.util.Collection getUsuario();
    public abstract void setUsuario(java.util.Collection usuario);
    I'm using JBOSS 3.2 application server.
    Have anyone seen this??
    Thank you,
    Wilson

    I've already discovered what happened. The column-name attribute in the @ejb.persistence tag should always be in lower-case.

  • Problems with Java DOM Mapping

    Hi Experts,
    as part of my diploma-thesis I have to write a java DOM-Mapping, which mapps the following incoming message:
    <mt_MappingOUT>
    <set>
    <set_Element_01>...</set_Element_01>
    <set_Element_02>... </set_Element_02>
    <set_Element_03>... </set_Element_02>
    <set_Element_10>  </set_Element_10>
    </set>
    </mt_MappingOUT>
    to the following outgoinig message:
    <mt_MappingIN>
    <TABLE>
    <item>
    <item_FIELD_01>  </item_FIELD_01>
    <item_FIELD_10>  <item_FIELD_10>
    <i/tem>
    </TABLE>
    </mt_MappingIN>
    I am not a very experienced Java-Developer. You can see my code down there, which I tried to implement according to some bloggs; unfortunately the result is not what I want to have
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Text;
    import org.xml.sax.SAXException;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class DOMMAPPING implements StreamTransformation{
         public static void main(String[] args) throws Exception
              try
                   FileInputStream fin =
                        new FileInputStream("C:/mt_MappingOut.xml");
                   FileOutputStream fout =
                        new FileOutputStream("C:/target.xml");
                   DOMMAPPING mapping = new DOMMAPPING();
                   mapping.execute(fin, fout);
              catch (Exception e)          {
                   e.printStackTrace();
    public void setParameter (Map param) {}
    public void execute (InputStream in, OutputStream out)
         throws com.sap.aii.mapping.api.StreamTransformationException {
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              Document documentIn = null;
              DocumentBuilder builder = null;
              try {
                        builder = factory.newDocumentBuilder();
                   } catch (ParserConfigurationException e1) {
                        e1.printStackTrace();
              try {
                   Element itemNode = null;
                   NodeList[] list_f=new NodeList[10];
                   Element[] field=new Element[10];
                   documentIn = builder.parse(in);
                   Document documentOut = builder.newDocument();
                   Element rootNode = documentOut.createElementNS("urn:agrp:xi:geissseb","ns0:mt_MappingIn");
                   documentOut.appendChild(rootNode);
                   Element tableNode = documentOut.createElement("TABLE");
                   rootNode.appendChild(tableNode);
                   NodeList list_Set=documentIn.getElementsByTagName("set");
                   System.out.println(list_Set.getLength());
                   for(int j=1;j<10;j++){
                        list_f[j-1]=documentIn.getElementsByTagName("set_ELEMENT_01"+j);
                list_f[9]=documentIn.getElementsByTagName("set_ELEMENT_10");
                   //NodeList list_f01=documentIn.getElementsByTagName("f01");
                   for (int i=0;i<list_Set.getLength();i++)
                        itemNode=documentOut.createElement("item");
                        tableNode.appendChild(itemNode);
                        for(int k=0; k<10;k++){
                             Node f=list_f[k].item(i);
                             f=f.getFirstChild();
                             String str_f=f.getNodeValue();
                             Text text_f=documentOut.createTextNode(str_f);
                             field[k]=documentOut.createElement("item_FIELD_"(k1));
                             field[k].appendChild(text_f);
                             itemNode.appendChild(field[k]);
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer transform = tf.newTransformer();
                   transform.transform(new DOMSource(documentOut), new StreamResult(out));
                   } catch (SAXException e2) {
                        e2.printStackTrace();
                   } catch (IOException e2) {
                        e2.printStackTrace();
                   }catch (Throwable t) { throw new StreamTransformationException("error", t); }
    Unfortunately there seems to be at least one error in there because the result I get is just the following:
      <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    - <ns0:mt_MappingIn xmlns:ns0="urn:agrp:xi:geissseb">
      <TABLE />
      </ns0:mt_MappingIn>
    Below you will find my source message:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <xsd:schema targetNamespace="urn:agrp:xi:geissseb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="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">a7a28830bebf11dc81aa001a4b0af224</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="f01" 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>
    When I had problems withe Java SAX Mapping, I got great hints in the forum. So I hope you can help me out again...
    Cheers Sebastian

    Here you go.
    Code
    package com.sap.test;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.apache.crimson.tree.TextNode;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Text;
    import org.xml.sax.SAXException;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class DomTest {
         Document documentOut = null;
         public static void main(String[] args) throws Exception
         try
         FileInputStream fin =      new FileInputStream("test.xml");
         FileOutputStream fout = new FileOutputStream("test_out.xml");
         DomTest mapping = new DomTest();
         mapping.execute(fin, fout);
         catch (Exception e) {
         e.printStackTrace();
         public void setParameter (Map param) {}
         public void execute (InputStream in, OutputStream out)
         throws com.sap.aii.mapping.api.StreamTransformationException {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         Document documentIn = null;
         DocumentBuilder builder = null;
         try {
         builder = factory.newDocumentBuilder();
         } catch (ParserConfigurationException e1) {
         e1.printStackTrace();
         try {
         Element itemNode = null;
         //NodeList[] list_f=new NodeList10;
         //Element[] field=new Element10;
         documentIn = builder.parse(in);
         documentOut = builder.newDocument();
         Element rootNode = documentOut.createElementNS("urn:agrp:xi:geissseb","ns0:mt_MappingIn");
         rootNode.setAttribute("xmlns:ns0", "urn:agrp:xi:geissseb");
         documentOut.appendChild(rootNode);
         Element tableNode = documentOut.createElement("TABLE");
         rootNode.appendChild(tableNode);
         NodeList list_Set = documentIn.getElementsByTagName("set");
         System.out.println(list_Set.getLength());
         for(int j = 0 ; j < list_Set.getLength() ;j++){
              Element setNode = (Element)list_Set.item(j);
              NodeList children = setNode.getChildNodes();
              for(int index = 0; index < children.getLength(); index++)
                   Node child = children.item(index);
                   if (child instanceof Element) {
                        Element element = (Element) child;
                        if(element.getNodeName().startsWith("set_ELEMENT"))
                             createItemFeildNode(tableNode,element);
         //list_f[9]=documentIn.getElementsByTagName("set_ELEMENT_10");
    //     NodeList list_f01=documentIn.getElementsByTagName("f01");
         /*for (int i=0;i<list_Set.getLength();i++)
         itemNode=documentOut.createElement("item");
         tableNode.appendChild(itemNode);
         for(int k=0; k<10;k++){
         Node f=list_f[k].item(i);
         f=f.getFirstChild();
         String str_f=f.getNodeValue();
         Text text_f=documentOut.createTextNode(str_f);
         field[k]=documentOut.createElement("item_FIELD_"(k1));
         field[k].appendChild(text_f);
         itemNode.appendChild(field[k]);
         TransformerFactory tf = TransformerFactory.newInstance();
         Transformer transform = tf.newTransformer();
         transform.transform(new DOMSource(documentOut), new StreamResult(out));
         transform.transform(new DOMSource(documentOut), new StreamResult(System.out));
         } catch (SAXException e2) {
         e2.printStackTrace();
         } catch (IOException e2) {
         e2.printStackTrace();
         }catch (Throwable t) { throw new StreamTransformationException("error", t); }
         private void createItemFeildNode(Element root, Element element) {
              String inName = element.getNodeName();
              int temp = inName.lastIndexOf('_');
              if (temp == -1)
                   return;
              String index = inName.substring(temp+1);
              String nodeName = "Item_FIELD_" + index;
              String nodeVal = element.getFirstChild().getNodeValue();
              Element newElement = documentOut.createElement(nodeName);
              Text txtNode = documentOut.createTextNode(nodeVal);
              newElement.appendChild(txtNode);
              root.appendChild(newElement);          
    Input
    <?xml version="1.0" encoding="UTF-8" ?>
    <mt_MappingOut xmlns="urn:agrp:xi:geissseb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:agrp:xi:geissseb file:/D:/Eclipse/workspace/SDN/test.xsd">
    <set xmlns="">
      <set_ELEMENT_01>E1</set_ELEMENT_01>
      <set_ELEMENT_02>E2</set_ELEMENT_02>
      <set_ELEMENT_03>E3</set_ELEMENT_03>
      <set_ELEMENT_04>E4</set_ELEMENT_04>
      <set_ELEMENT_05>E5</set_ELEMENT_05>
      <set_ELEMENT_06>E6</set_ELEMENT_06>
      <set_ELEMENT_07>E7</set_ELEMENT_07>
      <set_ELEMENT_08>E8</set_ELEMENT_08>
      <set_ELEMENT_09>E9</set_ELEMENT_09>
      <set_ELEMENT_10>E10</set_ELEMENT_10>
      </set>
      </mt_MappingOut>
    Output
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:mt_MappingIn xmlns:ns0="urn:agrp:xi:geissseb">
    <TABLE>
      <Item_FIELD_01>E1</Item_FIELD_01>
      <Item_FIELD_02>E2</Item_FIELD_02>
      <Item_FIELD_03>E3</Item_FIELD_03>
      <Item_FIELD_04>E4</Item_FIELD_04>
      <Item_FIELD_05>E5</Item_FIELD_05>
      <Item_FIELD_06>E6</Item_FIELD_06>
      <Item_FIELD_07>E7</Item_FIELD_07>
      <Item_FIELD_08>E8</Item_FIELD_08>
      <Item_FIELD_09>E9</Item_FIELD_09>
      <Item_FIELD_10>E10</Item_FIELD_10>
      </TABLE>
      </ns0:mt_MappingIn>

  • 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

  • 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

  • Problem with EJB skeleton classloader

    Hi
    We have been migrating an enterprise application from Weblogic 7 to 9.2 and experienced strange problem with EJBs. Our EAR contains (beside the other elements) an EJB module with EJBs and some common POJO classes inside. At the deploy and run phase everything seems working fine, but when the remote client invokes a method which receives one of the common classes as a parameter we get ClassNotFoundException on the server side (talking precisely, the exception is thrown from the EJB skeleton, trying to unmarshall the parameter).
    It seems that our EJB's skeletons do not see the classes from EAR. We have tried moving the common classes to the APP-INF/lib directory or placing them at the root of EAR archive and adding reference in Manifest file of EJB module and it won't help.
    The only workaround we've found is to add the missing classes to the server classpath but this is unacceptable (however, it works).
    We are not using any custom classloader hierarchy.
    The other JARs have no problem loading the content of our EJB module (including the common classes, which cause the problem).
    So, why is the RMI classloader ommiting our application contents?

    The problem was fixed by upgrading to version 9.2.1

  • Problem with ejb 3.0 entity beans with manyToMany relationship

    Hello everyone!
    I am using struts 1.2.9 and java ee 5 sdk update 2 for my enterprise application. Besides others i have these entity beans Targetgroup.java and City.java, (i would upload file but i do not know how:)
    with manytomany relationship with join table.
    when user updates Targetgroup, by clicking on web page with checkboxes and textfields, struts dispatch action calls following method stateless bean:
    public void update(String firmId, String targetgroupId, String newGender, String newMinYearsOld, String newMaxYearsOld, String[] newCities) {
    TargetgroupPK pkForUpdate = new TargetgroupPK(targetgroupId, firmId);
    Targetgroup targetgroupForUpdate = find(pkForUpdate);
    targetgroupForUpdate.setGender(newGender);
    targetgroupForUpdate.setMinyearold(Integer.parseIn t(newMinYearsOld));
    targetgroupForUpdate.setMaxyearold(Integer.parseIn t(newMaxYearsOld));
    //pronalazenje gradva za koje je vezana ciljna grupa
    Collection<City> newCitiesCollection = new ArrayList<City>();
    for(int i = 0; i < newCities.length; i++){
    String tmp_city_name = newCities;
    City city_obj = cityFacade.find(tmp_city_name);
    newCitiesCollection.add(city_obj);
    targetgroupForUpdate.setCityidCollection(newCities Collection);
    parameter newCities represents names of cities which user checked on his update page. When the page is showen to him some cities are allready check because they were connected with Targetgruoup when it was created (targetgroup).
    this code throws following exception:
    [#|2007-07-26T12:13:36.993+0200|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_Threa dID=16;_ThreadName=httpWorkerThread-8080-0;_RequestID=f79d9c50-86b0-4b6c-96ab-97956dfb39c1;|StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
    javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
    javax.transaction.RollbackException: Transaction marked for rollback.
    at
    .com.sun.enterprise.web.connector.grizzly.WorkerTh read.run(WorkerThread.java:75)
    javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
    at com.sun.ejb.containers.BaseContainer.completeNewTx (BaseContainer.java:3659)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx( BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(Ba seContainer.java:1247)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHan dler.invoke(EJBLocalObjectInvocationHandler.java:1 92)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHan dlerDelegate.invoke(EJBLocalObjectInvocationHandle rDelegate.java:71)
    at $Proxy149.update(Unknown Source)
    at audiotel.sms.actions.backoffice.TargetgroupDispatc hAction.updateOrDelete(TargetgroupDispatchAction.j ava:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:270)
    at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:187)
    at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
    com.sun.enterprise.web.connector.grizzly.WorkerThr ead.run(WorkerThread.java:75)
    |#]
    exceprion is throwen ONLY when in parameter newCities are city names allready connected to Targetgroup. when NewCities contains names of
    City objects which are not connected to Targetgroup it works fine, but it's of no use for me, because user must be able to add or remove certian cities from relaionship with Targetgroup. I think it's because there are rows in join table that contain primary keys of city and targetgroup which are connected so perisistence manager cann't write them again.
    i thought it was going to figure it out by itself, and only update those rows.
    Does anyone know what is the problem and solution?
    Thanks! (forgive my spelling errors :)

    solved the problem!
    I moved code from sesion bean to struts action as follows:
    CityFacadeLocal cityFacade = lookupCityFacade();
    //prikupljanje novih podataka o ciljnoj grupi
    String newGender = ctf.getGender();
    String newMaxYears = ctf.getMaxyears();
    String newMinYears = ctf.getMinyears();
    String[] newSelectedCities = ctf.getSelectedCities();
    //niz imena gradova se prevodi u kolekcju objekata City
    Collection<City> newCitiesObjCollection = new Vector<City>();
    for(int i = 0; i < newSelectedCities.length; i++){
    String tmpCityName = newSelectedCities;
    City tmpCityObj = cityFacade.find(tmpCityName);
    newCitiesObjCollection.add(tmpCityObj);
    //setovanje novih podataka
    targetgroupForUD.setGender(newGender);
    targetgroupForUD.setMinyearold(Integer.parseInt(newMinYears));
    targetgroupForUD.setMaxyearold(Integer.parseInt(newMaxYears));
    targetgroupForUD.setCityidCollection(newCitiesObjCollection);
    //pozivanje update metdoe u session beany
    targetgroupFacade.edit(targetgroupForUD);
    //korisnik se vraca na stranu sa svim postojecim ciljnim grupama
    forward = mapping.findForward("backend.targetgroups");
    and now it works fine. I guess probelm was same transaction scope for Targetgroup and City entities. Now when they are separated it works.
    Thanks!

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

  • Exists some problem with auto-relationship?

    Hi all,
    I'm getting the following exception when I make deploy.
    [14/May/2003:12:23:28] FINE ( 3132): Field: atributos
    [14/May/2003:12:23:28] FINE ( 3132): Field: coluna br.com.inttegra.infra.bean.tabela.ColunaTabelaLocal
    [14/May/2003:12:23:28] FINE ( 3132): -Methods: getColuna setColuna
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.tabela.ColunaTabelaEJB_849864039_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.tabela.ColunaTabelaEJB_849864039_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): manySide: false
    [14/May/2003:12:23:28] FINE ( 3132): Field: thisRelationshipFieldWasGeneratedByTheNameMapper67
    [14/May/2003:12:23:28] FINE ( 3132): Field: classe br.com.inttegra.infra.bean.classes.ClassesLocal
    [14/May/2003:12:23:28] FINE ( 3132): -Methods: getClasse setClasse
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.classes.ClassesEJB_413640801_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.classes.ClassesEJB_413640801_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): manySide: false
    [14/May/2003:12:23:28] FINE ( 3132): Field: thisRelationshipFieldWasGeneratedByTheNameMapper71
    [14/May/2003:12:23:28] FINE ( 3132): Finder: ejbFindByPrimaryKey
    [14/May/2003:12:23:28] FINE ( 3132): Finder: ejbFindAll
    [14/May/2003:12:23:28] FINER ( 3132): EJBQLC compile query
    Bean: ParseAtributo
    Method: java.util.Collection findAll()
    EJBQL: select object(pa) from ParseAtributoEJB pa
    [14/May/2003:12:23:28] FINER ( 3132): EJBQLC start syntax analysis
    [14/May/2003:12:23:28] FINEST ( 3132): EJBQLC dump tree (AST)
    QUERY [61, (0/0), null]
    from [5, (1/19), null]
    RANGE [62, (0/0), null]
    ParseAtributoEJB [46, (1/24), null]
    pa [46, (1/41), null]
    select [4, (1/1), null]
    object [8, (1/8), null]
    pa [46, (1/15), null]
    WHERE [6, (0/0), null]
    TRUE [10, (0/0), null]
    [14/May/2003:12:23:28] FINER ( 3132): EJBQLC start semantic analysis
    [14/May/2003:12:23:28] FINEST ( 3132): EJBQLC dump tree (typed AST)
    QUERY [61, (0/0), null]
    from [5, (1/19), null]
    RANGE [62, (0/0), null]
    ParseAtributoEJB [68, (1/24), ParseAtributo]
    pa [67, (1/41), ParseAtributo]
    select [4, (1/1), null]
    object [8, (1/8), ParseAtributo]
    pa [66, (1/15), ParseAtributo]
    WHERE [6, (0/0), null]
    TRUE [10, (0/0), boolean]
    [14/May/2003:12:23:28] FINER ( 3132): EJBQLC start code generation
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.parse.ParseAtributoEJB789766943_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.parse.ParseAtributoEJB789766943_JDOState
    [14/May/2003:12:23:28] FINER ( 3132): EJBQLC result JDOQLElements(candidateClass: br.com.inttegra.infra.bean.parse.ParseAtributoEJB789766943_JDOState, filter: true, result: this, resultType: br.com.inttegra.infra.bean.parse.ParseAtributoEJB789766943_JDOState, isPCResult: true)
    [14/May/2003:12:23:28] FINE ( 3132): Selectors: 0
    [14/May/2003:12:23:28] FINE ( 3132): CreateMethod: br.com.inttegra.infra.bean.parse.ParseAtributoEJBcreate
    [14/May/2003:12:23:28] FINE ( 3132): ejbCreateMethod: ejbCreate
    [14/May/2003:12:23:28] FINE ( 3132): ejbPostCreateMethod: ejbPostCreate
    [14/May/2003:12:23:28] FINE ( 3132): Processing method: unsetEntityContext
    [14/May/2003:12:23:28] FINE ( 3132): Known method: null
    [14/May/2003:12:23:28] FINE ( 3132): Found method: public void br.com.inttegra.infra.bean.parse.ParseAtributoEJB.unsetEntityContext()
    [14/May/2003:12:23:28] FINE ( 3132): Processing method: ejbRemove
    [14/May/2003:12:23:28] FINE ( 3132): Known method: null
    [14/May/2003:12:23:28] FINE ( 3132): Found method: public void br.com.inttegra.infra.bean.parse.ParseAtributoEJB.ejbRemove() throws javax.ejb.RemoveException,javax.ejb.EJBException
    [14/May/2003:12:23:28] FINE ( 3132): Processing method: beforeCompletion
    [14/May/2003:12:23:28] FINE ( 3132): Known method: null
    [14/May/2003:12:23:28] FINE ( 3132): Processing method: ejbLoad
    [14/May/2003:12:23:28] FINE ( 3132): Known method: null
    [14/May/2003:12:23:28] FINE ( 3132): Found method: public void br.com.inttegra.infra.bean.parse.ParseAtributoEJB.ejbLoad() throws javax.ejb.EJBException,java.rmi.RemoteException
    [14/May/2003:12:23:28] FINE ( 3132): Processing method: ejbStore
    [14/May/2003:12:23:28] FINE ( 3132): Known method: null
    [14/May/2003:12:23:28] FINE ( 3132): Found method: public void br.com.inttegra.infra.bean.parse.ParseAtributoEJB.ejbStore() throws javax.ejb.EJBException,java.rmi.RemoteException
    [14/May/2003:12:23:28] FINE ( 3132): Processing method: jdoCleanAllRefs
    [14/May/2003:12:23:28] FINE ( 3132): Known method: null
    [14/May/2003:12:23:28] FINE ( 3132): Processing method: setEntityContext
    [14/May/2003:12:23:28] FINE ( 3132): Known method: null
    [14/May/2003:12:23:28] FINE ( 3132): Found method: public void br.com.inttegra.infra.bean.parse.ParseAtributoEJB.setEntityContext(javax.ejb.EntityContext)
    [14/May/2003:12:23:28] FINE ( 3132): pkfield: idParseAtributo
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.parse.ParseAtributoEJB789766943_JDOState
    [14/May/2003:12:23:28] FINEST ( 3132): TP PCClassGen: generating 'br/com/inttegra/infra/bean/parse/ParseAtributoEJB789766943_JDOState'...
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.parse.ParseEJB_1482881505_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.tabela.ColunaTabelaEJB_849864039_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.classes.ClassesEJB_413640801_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.parse.ParseEJB_1482881505_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.tabela.ColunaTabelaEJB_849864039_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.classes.ClassesEJB_413640801_JDOState
    [14/May/2003:12:23:28] FINEST ( 3132): TP PCClassGen: DONE generating 'br/com/inttegra/infra/bean/parse/ParseAtributoEJB789766943_JDOState'...
    [14/May/2003:12:23:28] FINE ( 3132): gen file in /u03/dds/dds/var/opt/SUNWappserver7/domains/domainCronos/ServerNC/generated/ejb/j2ee-modules/NC
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.identificacao.IdentificacaoEJB_1068400097_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): ##### PCImplClass Name is br.com.inttegra.infra.bean.resposta.RespostaEJB670563865_JDOState
    [14/May/2003:12:23:28] FINE ( 3132): listCmrs identificacoes parse resposta
    [14/May/2003:12:23:28] FINE ( 3132): persistentClass br.com.inttegra.infra.bean.identificacao.IdentificacaoEJB
    [14/May/2003:12:23:28] SEVERE ( 3132): JDOCodeGenerator: Caught Exception in generating CMP:
    javax.ejb.EJBException: CMRFieldInfo not found for field identificacaoPai
    at com.sun.enterprise.deployment.PersistenceDescriptor.getCMRFieldInfoByName(PersistenceDescriptor.java:262)
    at com.iplanet.ias.persistence.internal.model.ejb.util.NameMapper.getRelatedEjbDescriptor(NameMapper.java:368)
    at com.iplanet.ias.persistence.internal.model.ejb.util.NameMapper.getEjbNameForLocalInterface(NameMapper.java:297)
    at com.sun.jdo.spi.persistence.support.ejb.model.util.NameMapper.getPersistenceClassForLocalInterface(NameMapper.java:284)
    at com.sun.jdo.spi.persistence.support.ejb.model.DeploymentDescriptorModel.getFieldType(DeploymentDescriptorModel.java:503)
    at com.sun.jdo.api.persistence.model.util.ModelValidator.shouldBeRelationship(ModelValidator.java:2377)
    at com.sun.jdo.api.persistence.model.util.ModelValidator.isLegalRelationship(ModelValidator.java:2384)
    at com.sun.jdo.api.persistence.model.util.ModelValidator.getFieldsValidationList(ModelValidator.java:325)
    at com.sun.jdo.api.persistence.model.util.ModelValidator.getBasicValidationList(ModelValidator.java:167)
    at com.sun.jdo.api.persistence.model.util.ModelValidator.getFullValidationList(ModelValidator.java:183)
    at com.sun.jdo.api.persistence.model.util.ModelValidator.fullValidationCheck(ModelValidator.java:131)
    at com.sun.jdo.api.persistence.model.Model.validate(Model.java:1592)
    at com.iplanet.ias.persistence.internal.ejb.ejbc.JDOCodeGenerator.validate(JDOCodeGenerator.java:189)
    at com.iplanet.ias.persistence.internal.ejb.ejbc.JDOCodeGenerator.generate(JDOCodeGenerator.java:225)
    at com.iplanet.ias.ejb.codegen.CmpCompiler.compile(CmpCompiler.java:155)
    at com.iplanet.ias.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:1029)
    at com.iplanet.ias.deployment.backend.EJBCompiler.preDeployModule(EJBCompiler.java:464)
    at com.iplanet.ias.deployment.backend.EJBCompiler.compile(EJBCompiler.java:181)
    at com.iplanet.ias.deployment.backend.EjbModuleDeployer.runEJBC(EjbModuleDeployer.java:246)
    at com.iplanet.ias.deployment.backend.EjbModuleDeployer.deploy(EjbModuleDeployer.java:128)
    at com.iplanet.ias.deployment.backend.ModuleDeployer.doRequest(ModuleDeployer.java:77)
    at com.iplanet.ias.admin.server.core.mbean.config.ManagedServerInstance.deployEJBJarModuleArchiveOrDirectory(ManagedServerInstance.java:890)
    at com.iplanet.ias.admin.server.core.mbean.config.ManagedServerInstance.deployEJBJarModule(ManagedServerInstance.java:841)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.iplanet.ias.admin.server.core.jmx.Introspector.invokeMethodOn(Introspector.java:188)
    at com.iplanet.ias.admin.server.core.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:137)
    at com.iplanet.ias.admin.server.core.jmx.ASMBeanServerImpl.invoke(ASMBeanServerImpl.java:222)
    at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.callInvoke(AdminAPIEntryServlet.java:217)
    at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.callMBean(AdminAPIEntryServlet.java:176)
    at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.doGet(AdminAPIEntryServlet.java:101)
    at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.doPost(AdminAPIEntryServlet.java:83)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.S
    [14/May/2003:12:23:28] WARNING ( 3132): DPL5035:Error while running ejbc
    com.iplanet.ias.deployment.backend.IASDeploymentException: Fatal Error from EJB Compiler -- -- Error while processing CMP beans.
    at com.iplanet.ias.deployment.backend.EJBCompiler.wrapException(EJBCompiler.java:589)
    at com.iplanet.ias.deployment.backend.EJBCompiler.compile(EJBCompiler.java:186)
    at com.iplanet.ias.deployment.backend.EjbModuleDeployer.runEJBC(EjbModuleDeployer.java:246)
    at com.iplanet.ias.deployment.backend.EjbModuleDeployer.deploy(EjbModuleDeployer.java:128)
    at com.iplanet.ias.deployment.backend.ModuleDeployer.doRequest(ModuleDeployer.java:77)
    at com.iplanet.ias.admin.server.core.mbean.config.ManagedServerInstance.deployEJBJarModuleArchiveOrDirectory(ManagedServerInstance.java:890)
    at com.iplanet.ias.admin.server.core.mbean.config.ManagedServerInstance.deployEJBJarModule(ManagedServerInstance.java:841)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.iplanet.ias.admin.server.core.jmx.Introspector.invokeMethodOn(Introspector.java:188)
    at com.iplanet.ias.admin.server.core.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:137)
    at com.iplanet.ias.admin.server.core.jmx.ASMBeanServerImpl.invoke(ASMBeanServerImpl.java:222)
    at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.callInvoke(AdminAPIEntryServlet.java:217)
    at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.callMBean(AdminAPIEntryServlet.java:176)
    at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.doGet(AdminAPIEntryServlet.java:101)
    at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.doPost(AdminAPIEntryServlet.java:83)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    Caused by: com.iplanet.ias.ejb.codegen.CmpCompilerException: Error while processing CMP beans.
    at com.iplanet.ias.ejb.codegen.CmpCompiler.compile(CmpCompiler.java:198)
    at com.iplanet.ias.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:1029)
    at com.iplanet.ias.deployment.backend.EJBCompiler.preDeployModule(EJBCompiler.java:464)
    at com.iplanet.ias.deployment.backend.EJBCompiler.compile(EJBCompiler.java:181)
    ... 30 more
    Caused by: javax.ejb.EJBException: CMRFieldInfo not found for field identificacaoPai
    at com.iplanet.ias.persistence.internal.ejb.ejbc.JDOCodeGenerator.generate(JDOCodeGenerator.java:264)
    at com.iplanet.ias.ejb.codegen.CmpCompiler.compile(CmpCompiler.java:155)
    ... 33 more
    [14/May/2003:12:23:33] FINE ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: get connection
    [14/May/2003:12:23:33] FINE ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: create connection
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: opening socket to [192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: server suggested 127.0.0.1:62189
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: using 192.168.200.9:0
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: create call context
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: outbound call: [endpoint:[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5](remote),objID:[0:0:0, 2]] : sun.rmi.transport.DGCImpl_Stub[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: write remote call header...
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: getting output stream
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: execute call
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: getting input stream
    [14/May/2003:12:23:33] FINE ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: name = "java.rmi.dgc.Lease", codebase = ""
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: (thread context class loader: sun.misc.Launcher$AppClassLoader@a56a7c)
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: class "java.rmi.dgc.Lease" found via codebase, defined by null
    [14/May/2003:12:23:33] FINE ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: name = "java.rmi.dgc.VMID", codebase = ""
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: (thread context class loader: sun.misc.Launcher$AppClassLoader@a56a7c)
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: class "java.rmi.dgc.VMID" found via codebase, defined by null
    [14/May/2003:12:23:33] FINE ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: name = "[B", codebase = "" 
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: (thread context class loader: sun.misc.Launcher$AppClassLoader@a56a7c)
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: class "[B" found via codebase, defined by null 
    [14/May/2003:12:23:33] FINE ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: name = "java.rmi.server.UID", codebase = ""
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: (thread context class loader: sun.misc.Launcher$AppClassLoader@a56a7c)
    [14/May/2003:12:23:33] FINER ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: class "java.rmi.server.UID" found via codebase, defined by null
    [14/May/2003:12:23:33] FINE ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: free connection (reuse = true)
    [14/May/2003:12:23:33] FINE ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: reuse connection
    [14/May/2003:12:23:33] FINE ( 3132): RMI RenewClean-[192.168.200.9:40873,com.iplanet.ias.admin.server.core.channel.LocalRMIClientSocketFactory@6fdca5]: create reaper
    my ejb-jar:
              <ejb-relation>
                   <ejb-relation-name>Identificacao-Identificacoes</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Identificacao-has-identificacoes</ejb-relationship-role-name>
                        <multiplicity>One</multiplicity>
                        <relationship-role-source>
                             <ejb-name>Identificacao</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>identificacoes</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>identificacoes-owned-by-Identificacao</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>Identificacao</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>identificacaoPai</cmr-field-name>
                        </cmr-field>
                   </ejb-relationship-role>
              </ejb-relation>
    my sun-cmp-mappgins
                   <cmr-field-mapping>
                        <cmr-field-name>resposta</cmr-field-name>
                        <column-pair>
                             <column-name>IDENTIFICACAO.ID_RESPOSTA</column-name>
                             <column-name>RESPOSTA.ID_RESPOSTA</column-name>
                        </column-pair>
                   </cmr-field-mapping>
                   <cmr-field-mapping>
                        <cmr-field-name>identificacaoPai</cmr-field-name>
                        <column-pair>
                             <column-name>IDENTIFICACAO.ID_IDENTIFICACAO_PAI</column-name>
                             <column-name>IDENTIFICACAO.ID_IDENTIFICACAO</column-name>
                        </column-pair>
                   </cmr-field-mapping>
                   <cmr-field-mapping>
                        <cmr-field-name>identificacoes</cmr-field-name>
                        <column-pair>
                             <column-name>IDENTIFICACAO.ID_IDENTIFICACAO</column-name>
                             <column-name>IDENTIFICACAO.ID_IDENTIFICACAO_PAI</column-name>
                        </column-pair>
                   </cmr-field-mapping>
                   <cmr-field-mapping>
                        <cmr-field-name>parse</cmr-field-name>
                        <column-pair>
                             <column-name>IDENTIFICACAO.ID_PARSE</column-name>
                             <column-name>PARSE.ID_PARSE</column-name>
                        </column-pair>
                   </cmr-field-mapping>
    somebody already got this exception?

    This question is identical to the thread=19208 and 19209.
    Please do not duplicate the threads.
    Regards,
    Marina

  • 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

  • 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

  • Problems with EJB Application with many CMP's

    I had been working with a Sun engineer in reference to a major problem with a large CMP Module with over 120 cmp beans with many relationships. It was filed as a bug and just recently they released Update 2. I installed this update and now I can build our complete application in Sun 1 Studio 5. Now, there seems to still be a problem in the application module. If we create the application and add our session module, cmp module and web module there is not problems. I can create the ear file and deploy this to S1AS7. Now if I exit the IDE the next time I return the Application shows that there is a error (red error indicator). I cannot expand the application to see the modules. The same problem was in S1S4 but it was not that big of a deal as it allowed you to add the modules back in, save and export the ear. But, now in S1S5 you cannot do a single thing with this module. Even the menu items to delete are not available. The only thing we can to is create the application again and add the modules etc. Also, if I right click on the application and select view error information it does nothing so I cannot even see the error that is causing this trouble. Also, we know it is something with the application and the cmp module because we can add just the web moduel and session module, save, exit and return and the application is fine. It is only when we add in the cmp module that after saving and returning things are wacked.
    Has anyone else seen this problem with the application?

    I have found the error. In the ide log it showed that the entity expansion limit was reached for the DOM parser. I added this to my ide.cfg and all works well now.
    -J-DentityExpansionLimit=128000
    Apperently the limit is 64000 and with the very large modules it was just not enough.

  • Problems With N96 Nokia Maps

    Hey!
    Just bought a Nokia N96, but i have som major problems with it, especially regarding the GPS function.
    When i try to start Nokia Maps it loads up to 30%, and then stops. I`ll get this message: Can not open this program. Please install the lastest version on nokia.com/maps.
    But i have tried that, it still doesnt work!
    What can i do?
    (it works perfect when i connect the usb cabøe into it and suggests "mass storrage")

    There are actually 2 versions of Nokia Maps and each has its own map data. You have to match data to Nokia Maps version. The best way to do this is to delete the Cities folder, running Maps at least once and then reinstalling the map data.

  • Problem with @OneToOne relationship in EJB 3.0

    Hi,
    I'm new to EJB 3.0. If i done any stupid thing please forgive me. Here is my doubt.
    I would like to use one-to-one relationship between two entities like USER and ADDRESS.
    I just did like this (the below code)to enable the relationship between these two entities.
    @Entity
    @Table(name="internalUser")
    public class InternalUser implements Serializable{
    .........//field entries of the User
    private Address userAddress;// Field for address entity.
    .......//setters and getters
    @OneToOne(cascade={CascadeType.ALL})
    @JoinColumn(name="id",table="user_address")
    public Address getUserAddress() {
    return userAddress;
    public void setUserAddress(Address userAddress) {
    this.userAddress = userAddress;
    } and Here is the Address EntityBean
    @Table(name="user_address")
    @Entity
    public class Address implements Serializable{
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    //setters and getters..
    }Entire Ejb application is deployed success fully. But when i try to add a User entry along with address, it is not able to save the address entry, but able to save the User entry correctly. And also it is not able to build a relationship with Address table.
    Here is my code which i write to save the User
    InternalUser user=new InternalUser();
    user.setName("Bharat");
    user.setSignnum("bhak");
    user.setDescription("Patel");
    Address address= new Address();
    address.setAreaCode("500032");
    address.setState("AP");
    address.setStreet("Prashanthi Nagar");
    user.setUserAddress(address);
    remote.saveUser(user); Here remote is SessionBeanInterface
    I'm using Postgres as a database.
    Please help me in this. What necessary steps need to follow in order to use @OneToOne relationship
    Edited by: chanti12345 on Apr 29, 2009 12:09 AM
    Edited by: chanti12345 on Apr 29, 2009 12:11 AM

    hi i solved this query.
    I made few changes in Both the entity classes. Here is the code for the Entites USER and ADDRESS
    @Entity
    @Table(name="internalUser")
    public class InternalUser implements Serializable{
    .......//field entries
    private Address userAddress;//address entry
    ......//setters and getters
    @OneToOne(cascade={CascadeType.ALL})
    public Address getUserAddress() {
         return userAddress;
    public void setUserAddress(Address userAddress) {
         this.userAddress = userAddress;
    @Table(name="user_address")
    @Entity
    public class Address implements Serializable{
    ....//fields and setters and getters
    }see the difference in the code . after making this change i'm able to save the User with relation ship with Address. No changes needed in client code.
    Thanks a lot to every one.
    Edited by: chanti12345 on Apr 29, 2009 2:22 AM

Maybe you are looking for

  • Premiere Pro CC (2014) Crashes if I try and locate footage/scrub/create a blank sequence, please help

    Hello, this is my first time asking for help on here, I've been going round the forums and web in general for hours and can't seem to find a solution to this. I really hope someone can help me sort this. Every time I try and open a project in Pr CC 2

  • Spry Photo Gallery Demo

    I am trying to build my own gallery based on the demo  Photo Gallery Version 2. I want to add the photo metadata below the main image but I'm not sure how to do it. I am new to XML and javascript (I first looked at it 3 days ago), I can add the data

  • How to import a web service into labview and make the assembly strong named signed?

    I have used the web services tool to import my .net project files. I am then putting them into clearcase. In order for my dll's to work on a network im getting the error that they need to strong named signed. Is there anyway of strong name signing th

  • Hyperlinks Won't display on page

    Frustrated! Never had the problem before. I'm creating 6 pages from a template. The template looks fine but when I enter any hyperlink in an editable region it doesn't show up. The link works but it's just a blank spot on the page. Running out of tim

  • Upgrade Java Version in 6i server

    How can I upgrade the Forms Sever 6i 's java in order to run some java bean (compile by java jdk 1.4.2) ?