users@glassfish.java.net

Re: MDB00037: Message-driven bean invocation exception: [javax.ejb.EJBException

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Mon, 22 Feb 2010 13:46:21 +1100

Hi Jack,

You're sending the Customer object wrapped in the JMS Message: you need
to unwrap it when you retrieve it:

 public void onMessage(Message message) {
   ObjectMessage objectMessage = (ObjectMessage) message.getObject();
   System.out.println(((Customer)objectMessage).getCustomerName());

> I also like to declare both declare both CustomerLocal.java&
> CustomerRemote.java to provide flexibility to access
> CustomerBean.java from local& remote but Netbeans insisted that the
> 2 can only exist with different methods in it.

How are you declaring the interfaces? Are you trying to let your bean
class implement two interfaces, or add both @Local and @Remote
annotations to your bean class? Java EE 5's EJB spec doesn't allow that/

You should be able to have the two interfaces (marked with @Local and
@Remote annotations or declared in your ejb-jar.xml), just don't try to
have your bean class extend both.

Regards,
Dies