Problem Removing CMP 2.0 Bean from Many side of One-to-Many

I'm getting an exception within the weblogic container when I try to
delete a bean from the many side of a one-to-many CMR.
The two entity beans are called CaseFile and CaseExpert. There are
many CaseExperts for each CaseFile. When you call the remove method
on the CaseExpert, Weblogic throws a null pointer exception when
accessing the EntityCache as shown at the bottom of this message. I'm
using the latest version of Weblogic 7 (WebLogic Server 7.0 Thu Jun
20 11:47:11 PDT 2002 190955). My relationship section of my
ejb-jar.xml file is also shown below.
Any ideas?
Thanks,
David
[email protected]
javax.ejb.EJBException: EJB Exception:: java.lang.NullPointerException
at weblogic.ejb20.cache.TxKey.<init>(TxKey.java:30)
at weblogic.ejb20.cache.EntityCache.doGet(EntityCache.java:158)
at weblogic.ejb20.cache.EntityCache.get(EntityCache.java:118)
at weblogic.ejb20.manager.DBManager.getReadyBean(DBManager.java:252)
at weblogic.ejb20.manager.DBManager.lookup(DBManager.java:949)
at gov.usdoj.usa.ecms.casefile.exposure.ejb.CaseExpertBean_76ewyr__WebLo
gic_CMP_RDBMS.__WL_setCaseFile(CaseExpertBean_76ewyr__WebLogic_CMP_RDBMS.java:45
2)
at gov.usdoj.usa.ecms.casefile.exposure.ejb.CaseExpertBean_76ewyr__WebLo
gic_CMP_RDBMS.__WL_setCaseFile(CaseExpertBean_76ewyr__WebLogic_CMP_RDBMS.java:43
1)
at gov.usdoj.usa.ecms.casefile.exposure.ejb.CaseExpertBean_76ewyr__WebLo
gic_CMP_RDBMS.ejbRemove(CaseExpertBean_76ewyr__WebLogic_CMP_RDBMS.java:1978)
at weblogic.ejb20.manager.DBManager.remove(DBManager.java:876)
at weblogic.ejb20.internal.EntityEJBLocalObject.remove(EntityEJBLocalObj
ect.java:95)
<relationships>
<ejb-relation>
<ejb-relation-name>caseExpert-caseFile</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>CaseExpert-CaseFile</ejb-relationship-role-name>
<multiplicity>many</multiplicity>
<relationship-role-source>
<ejb-name>CaseExpertEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>caseFile</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>CaseFile-CaseExperts</ejb-relationship-role-name>
<multiplicity>one</multiplicity>
<relationship-role-source>
<ejb-name>CaseFileEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>caseExperts</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
</relationships>

Wrong newsgroup, needs to go to one of the ejb newsgroups.
mbg
"Sai S Prasad" <[email protected]> wrote in message
news:3ec28167$[email protected]..
>
Hi,
I like to do the following:
1) Map one bean corresponding to table A to many beans corresponding totable
B 2) table B has two columns as the primary keys.
3) One of the primary key column in table B is a foreign key pointing tothe primary
key of table A.
4) bean corresponding to table A has the cmr Collection field
I am not able to map this scenario. I guess the mapping is possible aslong as
each table has its own unrelated primary keys. If anyone has tried this,please...please...help.
>
>
Thanks.

Similar Messages

  • How call session bean from Client side

    Hi
    calling session bean from client side it gives Lookup erroe, it gives JNDI error
    how we know session bean is working. in Admin tree bean statis is reb Flaf, and ID is "Down" how we activate it..
    null

    If you can make a connection using sess_sh, then you know that you have configured your database and listener properly. If it is not working, read the manuals that you can download from technet. They are pretty good, and if you follow the directions, you should see success.
    Good Luck!
    Brad

  • How do i remove an e-mail mailbox from my iPad (leaving one behind)?

    How do I remove an e-mail mailbox from my iPad, as it appears to be causing problems with an nhs.net account?

    You can deactivate an email account in Settings > Mail, Contacts, Calendars > the account > Account. Turn it OFF.

  • How-to remove a jsf backing bean from session?

    How can I find the reference to a backing bean (with session scope) and then remove the bean?
    I may have painted myself into a corner. When most of my pages are navigated to, they get key info from session and then initially populate the page fields. I populate the fields in the constructor with values from the database based on the keys found in session. So the second time a particular page is called the values may be stale or completely unrelated to the page navigated from because the bean already exists and, naturally, the constructor is never called.
    I'm thinking if I could remove the backing bean, jsf wouldn't find it so it would be recreated on subsequent navigations. Since the constructor would be called with every navigation to the page, the values would not be stale or unrelated.
    Any help would be greatly appreciated.
    TIA,
    Al Malin

    //To reset session bean
    FacesContext
         .getCurrentInstance()
         .getApplication()
         .createValueBinding( "#{yourBeanName}").setValue(FacesContext.getCurrentInstance(), null );
    //To get session bean reference
    Object obj = FacesContext
              .getCurrentInstance()
              .getApplication()
              .createValueBinding("#{yourBeanName}")
              .getValue(FacesContext.getCurrentInstance());
    YourSessionBean bean = (YourSessionBean)obj;

  • Problem in calling single entity bean from other beans

    Hi,
    I am implementing session facade with SUN's J2EE 1.3 deploy tool for JBoss server.
    I have a entity bean UserBean which creates users in database ( create() )and tells if user exists or not ( findByPrimaryKey() ).
    Initially, I had implemented UserBean with remote interfaces. So, any servlet ( my client ) which needed to use UserBean would make a remote call to it. It was used by 5 different servlets.
    Now I am going for Local interfaces. So, I am packaging UserBean with other beans which need it.
    Problem is, if I package UserBean with , say , ChatLogsBean ( Stateless bean ), it works fine. But when I package it with WebLogsBean ( Stateless bean ) also and deploy all beans together, JBoss gives error messages that instances of UserBean are already created.
    How should structure my beans sothat I can avoid these duplication problem ?
    Present flow is as follow:
    Servlet Stateless Bean Other beans
    ChatLogs Servlet --> ChatLogsWrapper --> ChatLogsBean ( Stateless bean ) & UserBean( Entity bean )
    WebLogs servlet --> WebLogsWrapper --> WebLogsBean ( Stateless bean ) & UserBean
    WordLogs servlet --> WordLogsWrapper --> WordLogsBean ( Stateless bean ) & UserBean
    All servlets are packaged into corresponding WARs.
    ChatLogsWrapper , ChatLogsBean ,UserBean are packaged into 'ChatWrapper' JAR.
    WebLogsWrapper , WebLogsBean , UserBean are packaged into 'webWrapper' JAR
    and similarly for WordLogs.
    Any help ?
    Regards,
    Suraj

    I suggest you post to one of the forums on jboss.org. There should not be a problem AFAIK having remote and local interfaces to the same EJB. I assume that you gave these unique names (FooHome/FooLocalHome..etc...) for the home and remote interfaces and declared both in the ejb DD.

  • I need help recovering the DOWNLOAD ICON from the side bar thing

    i don't know how but the download was gone from the side bar one day, i guess my parents did something accidentally and took it off. But i don't know. is there any way for me to get that icon back on the side bar?

    To your other post - where is the home folder - - it's the little house in the Finder sidebar with your username after it.
    Yanda the panda wrote:
    but the download folder is completely gone from everywhere
    it only pops up a window when i download something
    That is not the downloads directory - that's the Safari local Downloads window. Not the same
    Now, are you saying that the real Downloads directory has been removed - deleted?
    Click on that home folder - the house icon and look carefully for a Downloads Folder. It should look like this:
    If you do not see it, perhaps it was moved.
    In the Finder search window, enter downloads. Select "This Mac" and "File Name" and see if it pops up.
    If not, do you have a backup? TM or something else?
    If not, we can create a new Downloads folder but alas, everything in the original is gone.

  • One to many relationship in hibernate

    I am very much new to hibernate,
    for testing purpose I am using JPA annotations and hibernate.
    While testing one to many relationship , I got a problem
    I have a PurchaseOrder class and OrderLine class having one to many relationship.
    package orderpackage;
    import java.util.ArrayList;
    import java.util.List;
    import javax.persistence.CascadeType;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.OneToMany;
    @Entity
    public class PurchaseOrder {
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private int id;
      @OneToMany(cascade=CascadeType.ALL,mappedBy="order")
      private List <OrderLine> orderLine = new ArrayList<OrderLine>();
      public PurchaseOrder(String orderName) {
      this.orderName = orderName;
      public List<OrderLine> getOrderLine() {
      return orderLine;
      public void setOrderLine(List<OrderLine> orderLine) {
      this.orderLine = orderLine;
      private String orderName;
      public int getId() {
      return id;
      public void setId(int id) {
      this.id = id;
      public String getOrderName() {
      return orderName;
      public void setOrderName(String orderName) {
      this.orderName = orderName;
    OrderLine.java
    package orderpackage;
    import javax.persistence.CascadeType;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.ManyToOne;
    @Entity
    public class OrderLine {
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private int id;
      private String itemName;
      private int qty;
      @ManyToOne(cascade=CascadeType.ALL)
      private PurchaseOrder order;
      public OrderLine(String itemName, int qty) {
      this.itemName = itemName;
      this.qty = qty;
      public PurchaseOrder getOrder() {
      return order;
      public void setOrder(PurchaseOrder order) {
      this.order = order;
      public int getId() {
      return id;
      public void setId(int id) {
      this.id = id;
      public String getItemName() {
      return itemName;
      public void setItemName(String itemName) {
      this.itemName = itemName;
      public int getQty() {
      return qty;
      public void setQty(int qty) {
      this.qty = qty;
         OrderTest.java
    package orderpackage;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
    public class OrderTest {
      public static void main(String[] args) {
      PurchaseOrder order = new PurchaseOrder("order no 1");
      OrderLine orderLine1 = new OrderLine("item1",25);
      OrderLine orderLine2 = new OrderLine("item2",28);
      OrderLine orderLine3 = new OrderLine("item3",38);
      OrderLine orderLine4 = new OrderLine("item4",48);
      order.getOrderLine().add(orderLine1);
      order.getOrderLine().add(orderLine2);
      order.getOrderLine().add(orderLine3);
      order.getOrderLine().add(orderLine4);
      SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
      Session session = sessionFactory.openSession();
      session.beginTransaction();
      session.persist(order);
      session.getTransaction().commit();
      session.close();
    I can see Order and Order Line are get persisted but Order Line table don't have order_id populated automatically. Please help me out.

    That is because you're not setting it, obviously. Nowhere in your code are you actually populating the order property of the orderlines.

  • One to many shuffle

    Hi Guys
    I want to know how do we save the data from one table to another as soon as the user shuffle the things in one to many shuffle
    this one to many shuffle is done based on selection of Radio group
    When user select a radio button as per that the data will be displayed in one to many shuffle below
    what I want is When the user shuffle the things which he wants then it should immediately go and save in another table based on primary keys
    How can I do that???
    Any suggestion is Appreciated
    Thanks ,
    Santosh.

    You can have af:switcher component to display ADF Form and ADF table and based on your value of Radio button hide/show the facet
    check this little example http://www.youtube.com/watch?v=tMuZJvU5eTk&feature=plcp

  • One to Many CMP Bean

    Does anyone have a One to Many relationship for CMP working in 9.0.3 or 9.0.4? If so can you please send me the code at [email protected] I continue to get the following error:
    com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: Database error: java.sql.SQLException: ORA-00904: invalid column name
    Both beans work seperate but once I put the relationship in that is when I get the error.
    Here is my relationship
    <relationships>
    <ejb-relation>
    <ejb-relation-name>CostCenter - ChartEJB</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>CostCenter may have many ChartEJB</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>CostCenter</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>charts</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>ChartEJB belongs to CostCenter</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>ChartEJB</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    </ejb-relation>
    </relationships>

    I think, that problem is in the orion-ejb-jar.xml Maybe the persitance name is wrong...
    here is our definition ejb-jar.xml:
    <ejb-relation>
    <ejb-relation-name>AidFormProvided - AidForm</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>AidFormProvided - AidForm</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>AidFormProvidedBean</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>aidFormP</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>AidForm-belongs-to-AidFormProvided</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>AidFormBean</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>aidFromProvideds</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    here is definotion from orion-ejb-jar.xml:
    ....AidFormProvidedBean...
         <cmp-field-mapping name="providedDate" persistence-name="PROVIDED_DATE" />
         <cmp-field-mapping name="aidFormP">
                        <entity-ref home="AidFormBean">
                             <cmp-field-mapping name="aidFormP" persistence-name="AIDFORMOID" />
                        </entity-ref>
                   </cmp-field-mapping>
    ...AidFormBean...
    <cmp-field-mapping name="aidFromProvideds">
    <collection-mapping table="SM_AID_FORM_PROVIDED">
    <primkey-mapping>
    <cmp-field-mapping name="aidFormP">
    <entity-ref home="AidFormBean">
    <cmp-field-mapping name="aidFormP" persistence-name="AIDFORMOID" />
    </entity-ref>
    </cmp-field-mapping>
    </primkey-mapping>
    <value-mapping type="sk.datalock.sama.ejb.AidFormProvidedEJB">
    <cmp-field-mapping name="oid">
    <entity-ref home="AidFormProvidedBean">
    <cmp-field-mapping name="oid" persistence-name="OID" />
    </entity-ref>
    </cmp-field-mapping>
    </value-mapping>
    </collection-mapping>
    </cmp-field-mapping>
    Zajo

  • CMP Beans from Tables: Why does the Container try to create new tables?

    I'm trying to develop an EJB application using JDeveloper on 9iAS. I have several CMPs and have my tables that I want my CMPs to be based on already defined in my DB schema. I want to use CMP but I don't want the Container to create the tables, rather I want the Container to map my CMP EJBs to the already existing tables.
    The issue is:
    While creating these CMP EJBs in JDeveloper I chose the "New Enterprise Java Bean" EJB creation wizard using the option labeled "Container-managed Entity Beans from Tables". My assumption is that this does what I want, because the wizard prompts for a schema and table you want to map to. Then it creates the attributes & getter/setter methods, PK class, etc. all based on the table defintion automatically. Great. So why when I try to run my application do I get error messages for each EJB such as:
    Auto-creating table: create table STREET_TYPE (PK_STYP_ID NUMBER(8), STREET_TYPE VARCHAR2(20), primary key (PK_STYP_ID, STREET_TYPE))
    Warning: Error creating table: ORA-00955: name is already used by an existing object
    Huh?? I thought the idea is that the CMP EJB is mapped to the existing table in my schema. Why is the Container trying to create new tables?? Is this possible? Or am I missing something fundamental about how Containers create and manage CMPs? Or is this just a JDevelop container issue? TIA

    I presume you are getting the problem on application
    deploy? This happens when upon initialization of the application using the built-in OC4J container/app server that is part of JDeveloper. Here is the full messaging:
    [Starting OC4J using the following ports: HTTP=8989, RMI=23892, JMS=9228.]
    C:\OraHome1\jdk\bin\javaw.exe -ojvm -classpath C:\OraHome1\j2ee\home\oc4j.jar com.evermind.server.OC4JServer -config C:\OraHome1\jdev\system\oc4j-config\server.xml
    [waiting for the server to complete its initialization...]
    Copying default deployment descriptor from archive at Q:\CBTCOF\COF_APPLICATION\COF_Project\classes/META-INF/orion-ejb-jar.xml to deployment directory C:\OraHome1\jdev\system\oc4j-config\application-deployments\current-workspace-app\classes...
    Auto-deploying file:/Q:/CBTCOF/COF_APPLICATION/COF_Project/classes/ (No previous deployment found)...
    Auto-creating table: create table STREET_TYPE (PK_STYP_ID NUMBER(8), STREET_TYPE VARCHAR2(20), primary key (PK_STYP_ID, STREET_TYPE))
    Warning: Error creating table: ORA-00955: name is already used by an existing object
    [...OTHER SIMILAR ERROR MESSAGES]
    done.
    Oracle9iAS (9.0.2.0.0) Containers for J2EE initialized
    If so, in the application.xml file of you
    OC4J instance the is a setting autocreate-tables,
    which by default is true!
    Set it to false as below and that should clear up
    your problem.
    <orion-application autocreate-tables="false"
    default-data-Hmm. I found at least a dozen or so files with that name and set everyone that had this attriute to "false", restarted the OC4J server and still got these errors.

  • Create CMP Entity Beans from Tables Wizard - Can't see any tables with DB2

    Hi,
    I'm trying to use the "Create CMP Entity Beans from Tables Wizard" to create an entity from a table in a DB2 database. The problem is, on page 2, I can't see any available tables. I have verified that the connection works (I can open the connection in the Navigator frame and I can see that table).
    Note that if I try this wizard on an Oracle database, I can see tables.
    WTF? Can someone please help?

    I second the motion. I too work in an environment with centralized data management (DBA's) that create and maintain all tables under a generic schema. This has prevented me from using the Create Entity Beans from Table feature of Jdev r3 preview.
    At least I can see that I'm not alone.
    Thanks
    When I select the "Create CMP Entity Beans from Tables Wizard," no tables or views are available to select. The JDev database connection is using an ID assigned to me.
    The tables that I am looking for were created by the DBA under his ID and are therefore in that schema. He did create Public Synonyms for them, but the tables still do not show up in the wizard.
    Is there a configuration step that I need to do to have those tables show up?
    Tables created by a DBA and then accessed by developers using a public synonym is a very common scenario and should be supported by JDeveloper (IMO).
    Thanks.
    I'm using JDev 9.0.2.8.2.

  • How to remove Bean from session upon leaving the web page?

    Hi...
    I got the following problem
    I promote a user with a Datatable filled with data, each time the user enters the webpage with the table I go the DB and retrieve all relevant data again (so each time the user gets an OnLine representation of the DB)
    to archive that I defined the bean that pulls data from DB in Request scope. and it worked well... but now i added an option to export the table into Pdf made by a servlet.... now to be able to get the bean from the servlet i had to change the scope of the Bean to Session Scope... and all works fine.. BUT... now the page not showing OnLine representation of the DB.. cause its only created once , cause its inside Session Scope...
    My question is how can I remove the Bean from Session scope upon the user leaving the page (I don't want to remove the bean from session scope on the next called bean of the other page) i want to remove the Bean upon leaving the current web page... Or maybe force the constructor to be executed each time the Page is loaded (as if it was a Request scope bean)....
    Any ideas?
    Thanks ahead!
    Daniel.

    Hi,
    When you are moving to another page, you are performing an action right ?
    (i mean the request moving to Server side), if you do so, then clear the bean object values list.
    for example :
        private List<Integer> intList = new ArrayList<Integer>();
      public void clear()
       intList.clear();
    or
    store a new object in session, when ever u moved to the second page, so that the old object will be no longer
    in use, so it will be garbage collected.Regards,
    Sathya.

  • Hi I am having problems removing mail from trash folder. Can anyone help please

    Hi I am having problems removing mail from trash folder. I can send mails to the folder but cannot delete them permanently from the trash folder. I am using Iphone 3G and anm up to date with OS. Can anyone help please

    Check that there isn't a different Trash folder to the one with the proper Trash symbol on it.
    If you see one in your list of folders rather than a separate one, highlight it, then click on Mailbox...Use this mailbox for...Trash

  • How do you delete songs from Itunes? I have many that show up as many as 7 times and itunes will not allow me to remove them.

    How do you delete songs from Itunes? I have many that show up as many as 7 times and itunes will not allow me to remove them.

    I have tried to Hilight them and hit Control Delete nothing happens. I tried to just Delete one, but when you hit delete nothing happens.

  • EJB 3.0: CMP Entity bean from view

    Hi,
    I have created an entity bean from a database view.
    I don't have a good filed to use as id in my view. So I want to generate the id in my entity bean.
    How can I do this ?
    Thanks

    Hi,
    I didn't get your question.
    CMP is something, which can be done by hand.
    So maybe it is better, to do it manually.
    Bea has some workaround, I am sure.
    Maybe it is something with deployment descriptors, which
    have to be configured to the underlying database.
    Sorry for my stupid first answer.
    Volker.

Maybe you are looking for

  • Amount of RAM useful limited to processor speed?

    I have heard that at a certain point the amount of RAM you throw in your computer won't help past a certain processor speed. If this is true, is there a chart out there that will show these limits? Or if anyone has any opinions as far as a: Dual 2.7G

  • SSRS Dataset Filter Operator

    Hi -- I have a Dataset which returns data based on a multi select parameter. It uses a filter to achieve this and works as expected (based on the IN Operator). Now I have to update the report so it also returns records for this parameter value which

  • Multiple redirect URLs for mutliple guest VLANs

    We are trying to implement 2 guest WLANs tunnneled to our DMZ and want to redirect users to 2 different URLs (one for each WLAN) when they click the "Accept" button. We are running 6.0.182 on the DMZ controllers and have a customized web passthrough

  • Error in webi report  - ORA-06502

    Dear All, I have create an object in Universe "description" , I am using this object in WEBI report. When I run the WEBI report I am getting below error: Database error occurred :the databasr error text is  ORA-06502: PL/SQL: numeric or value error:

  • How to preview video transitions in CS4

    Is there a way to preview a video transition before applying the effect in the timeline, similar to the feature in Elements 7? Alternatively, is there a site that demonstrates each of these effects so as to save time and avoid having to memorize them