You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Lothar Piepmeyer <lo...@ixteam.de> on 2006/11/01 18:48:08 UTC

cannot use home methods in BMP

Hi,

sorry for  the bandwidth. Maybe the following topic has already been
discussed several times.


I have  the following two types

public interface AccountHome extends EJBHome {
   .
   public double getTotalBankValue() throws AccountException,
RemoteException;
} 



public class AccountBean implements EntityBean {
	public double ejbHomeGetTotalBankValue() throws AccountException
{
		.
	}
}


The ejb-jar.xml contains the following lines 

			<ejb-name>Account</ejb-name>
			<home>account.AccountHome</home>
			<remote>account.Account</remote>
	
<local-home>account.AccountLocalHome</local-home>
			<local>account.AccountLocal</local>
			<ejb-class>account.AccountBean</ejb-class>


The main method of the test client contains the following code
  
	Context ctx = new InitialContext(System.getProperties());
	Object obj = ctx.lookup("Account");
	AccountHome home = (AccountHome)
javax.rmi.PortableRemoteObject.narrow(obj, AccountHome.class);
	System.err.println("Total of all accounts in bank initially = "
+ home.getTotalBankValue());


Everything seems very straight forward. However, when starting OpenEJB
in embedded mode  I receive the following Stack trace:

    [java] Exception in thread "main"
java.lang.UnsupportedOperationException: Unkown method: public abstract
double account.AccountHome.getTotalBankValue() throws
account.AccountException,java.rmi.RemoteException
     [java] at
org.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.jav
a:148)
     [java] at
org.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java
:299)
     [java] at
org.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHand
ler.java:87)
     [java] at $Proxy3.getTotalBankValue(Unknown Source)
     [java] at account.client.AccountClient.main(AccountClient.java:37)
     [java] Java Result: 1


Running OpenEJB in client/server-mode gives a similiar result.

I tested several findX or getX methods and they all worked fine. I
checked the jar-File successfully with the validate option.

The example is from the book 'Mastering Enterprise Java Beans'. I found
a similar example in Sun's J2EE tutorial and tested it with the same
result.

Any ideas are welcome 

Lothar


Re: cannot use home methods in BMP

Posted by David Blevins <da...@visi.com>.
On Nov 1, 2006, at 9:48 AM, Lothar Piepmeyer wrote:

> Hi,
>
> sorry for  the bandwidth. Maybe the following topic has already been
> discussed several times.
>
>
> I have  the following two types
>
> public interface AccountHome extends EJBHome {
>    .
>    public double getTotalBankValue() throws AccountException,
> RemoteException;
> }
>
>
>
> public class AccountBean implements EntityBean {
> 	public double ejbHomeGetTotalBankValue() throws AccountException
> {
> 		.
> 	}
> }
>

[...]

>     [java] Exception in thread "main"
> java.lang.UnsupportedOperationException: Unkown method: public  
> abstract
> double account.AccountHome.getTotalBankValue() throws
> account.AccountException,java.rmi.RemoteException
>      [java] at
> org.openejb.core.ivm.EjbHomeProxyHandler._invoke 
> (EjbHomeProxyHandler.jav
> a:148)

> I tested several findX or getX methods and they all worked fine. I
> checked the jar-File successfully with the validate option.

Home methods are not supported in OpenEJB 1.0.  They really could be  
though, it'd only take a half a day to get them in.  If this is  
something you'd like I could work on it and put up a build for you.

Let me know.

-David