dev@glassfish.java.net

Glassfish (Build 20) questions: Remote access to EJB3 SLSB, Transaction attributes

From: Andreas Loew <Andreas.Loew_at_sun.com>
Date: Tue, 27 Sep 2005 10:45:16 +0200

All,

sorry, I don't know whether this is the proper alias to post my
questions about GlassFish, but if it is not, I'd also appreciate any
pointers to more appropriate places...

I have just looked into GlassFish Build 20 (20050923), and tried to
deploy an EJB3 SLSB providing a remote interface which also defines
transaction attributes on its methods.

I have run into two particular problem areas:

1)
I get the attached failure from the EJB verifier telling me about
transactional methods that have to be specified in the "remote or home
interface" of the specified bean. As I am trying to deploy an EJB3-style
bean (which means I don't need to provide neither a remote nor a home
interface), I am wondering about what this failure may mean or whether
it is critical at all.

The method definitions in question look like the following:

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public Order saveNewOrder(Order order) throws OrderException,
OrderMinimumAmountException {
     ...
}


2)
I can't seem to figure out how to access an EJB3-style SLSB that has
apparently been successfully deployed into GlassFish from a remote
standalone Java client (i.e. not using injection within the container):
What is the recommended way to do this? Do I have to use a JNDI
InitialContext, and if yes, how does it have to be configured? What JNDI
name do I have to use? In my sample, do I get an instance that can be
casted into Ejb3OrderServiceBean or just OrderService?

My EJB 3 SLSB class looks like the following:

@Stateless @Remote
public class Ejb3OrderServiceBean implements OrderService {
     ...
}

Does the correct JNDI name refer to Ejb3OrderService(Bean) (as the bean
implementation class) or to OrderService (as the POJI interface to be
implemented by the bean)? If the latter, how do we handle several
different bean classes implementing the same interface?

Many thanks in advance,
best regards

Andreas

-- 
Andreas Loew
Java Architect, Client Solutions
Sun Microystems (Germany)