I also ran into this when first developing BMP Entity Beans

Check your implementation class -  the method

 public String ejbFindByPrimarKey( String key ) ...

needs to return either a collection (of primary keys)  or an instance of the
primary key type 


-----Original Message-----
From: Artur Jonak [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 7:26 AM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] BMP finder method problem


Hi,

I have a very simple BMP Entity Bean with following home interface:

public interface SimpleBeanHome extends BaseHome {}

and in another file:

public interface BaseHome extends EJBHome
{
    Base create(String key) throws RemoteException, CreateException;
    Base findByPrimaryKey(String key) throws RemoteException,
FinderException;
}

my implementation of the bean is trivial.
Let's assume that all code is correct.
In the client application I try to create my bean with key 'one' - it works
properly.
But if I try to find this bean using findByPrimaryKey the following
Exception is thrown

[SimpleBean] TRANSACTION ROLLBACK EXCEPTION:result of finder method is not a
valid return type: class java.lang.String; nested exception is:
 java.rmi.RemoteException: result of finder method is not a valid return
type: class java.lang.String
[SimpleBean] java.rmi.RemoteException: result of finder method is not a
valid return type: class java.lang.String
[SimpleBean]  at
org.jboss.ejb.plugins.BMPPersistenceManager.findEntities(BMPPersistenceManag
er.java:259)
[SimpleBean]  at
org.jboss.ejb.EntityContainer.find(EntityContainer.java:392)
[SimpleBean]  at java.lang.reflect.Method.invoke(Native Method)
[SimpleBean]  at ............................

Note that if I don't inherit SimpleBeanHome interface from BaseHome but
simply
from EJBHome with declared both methods the application works perfectly.

I'm using JBOSS 2.2 with Tomcat 2.2.
What's going on?

Regards,
AJ.

________________________________________________

Pozdrawiam,
AJ.

<mailto:[EMAIL PROTECTED]>
<http://strony.wp.pl/wp/ajonak>
________________________________________________


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to