Hi,

Has anyone tried to return Collections from a BMP ejbFindAll() type of
operation?

I return an ArrayList of String objects, the client receives this list ok
but gets a cast exception on trying to extract the String from the list. eg.

  public Collection ejbFindAll() throws java.rmi.RemoteException,
javax.ejb.FinderException
  {
    ArrayList v = new ArrayList();
    v.add("First");
    v.add("Second");
    return v;
  }

and the client code:

      Collection coll = home.findAll();
      System.out.println(coll.size()  + coll.toString()); // this shows
correct count and contents: "2[First, Second]"
      Iterator iterator = coll.iterator(); 
      while(iterator.hasNext())
      {
        String s = (String)iterator.next();    // class cast exception
        System.out.println("Desc=" + s);
      }

On closer inspection with a debugger it turns out the objects in the list
are of class __Proxy5, some sort of orion proxy object.

This appears to be a bug but I'd like to be sure in case its me. Has anyone
done this successfully?

I'm using orion 1.4.5, I cannot seem to upgrade with autoupdate due to
(probably) firewall restrictions.

TIA

Permjeet



Reply via email to