Discussions

EJB programming & troubleshooting: Problem in findBy Methods

  1. Problem in findBy Methods (1 messages)

    I have a findBy method which should return a Collection of reference of the Remote Interface of the an CMP Beam.
      To return the collection I am first storing the primary keys in a HashMap and then calling HashMap.values() which returns the collection of the Values stored in the HashMap.
    Now this is giving me the following error.

    Exception thrown by rmi server: [-5162936691716975359S10.90.50.165:[7001,7001,7002,7002,7001,-1]/260]
    java.lang.UnsupportedOperationException
    at java.util.AbstractCollection.add(AbstractCollection.java:219)
    at com.tibersoft.core.ejb.entity.client.ClientPropertyValue_EntityBeanHomeImpl.findByClientAndSection(ClientPropertyValue_EntityBeanHomeImpl.java, Compiled Code)

    But if I change the return type to Enumeration and make the required changes , its works fine.

    Can anybody tell me why is it behaving like that. Do I have to return the Collection in any particular way .

    Thanks
  2. Problem in findBy Methods[ Go to top ]

    maybe u should use
    javax.rmi.PortableRemoteObject.narrow(acollection.next(), Acaccounttb.class);

    by the way, can u show the code to findby... , i wander how to user EntityBean to find more than primarykey .