Yann Ramin wrote:
AFAIK, You can't use the @EJB annotation outside of an actual bean or
class managed by the EJB framework (Tapestry is not). You need to bind
to the using a JNDI context - I think the Quickstart example has a good
example of using a Tapestry ASO (BeanLocator) for that.
Ok, i'm tried to use it:
AddContract.java:
SellerFacadeLocal sellerFacade = null;
try {
InitialContext ctx = new InitialContext();
sellerFacade =
(SellerFacadeLocal)ctx.lookup("java:comp/geronimo/env/mtx.racer.beans.SellerFacade");
} catch (NamingException e) {
return new TextStreamResponse("text/plain", e.toString());
}
and i get:
javax.naming.NotContextException: geronimo/env/mtx.racer.beans.SellerFacade
in geronimo console:
Enterprise Applications
default/Racer/1191755539379/car
EJBModule
RacerEJB.jar
SessionBeans
SellerFacade
java:comp/geronimo/env/mtx.racer.beans.SellerFacade/entityManager
Pavel Volkovitskiy wrote:
Hello!
i'm trying to use ejb3 beans from my tap5 app
right now i'm doing:
mtx/racer/pages/contract/AddContract.java:
...
@EJB
private SellerFacadeLocal sellerFacade;
and then
public StreamResponse onSubmit() {
...
Seller s = sellerFacade.getSeller(code, dealer, comment);
there Seller - entity, sellerFacade - stateless bean and
sellerFacadeLocal - interface
but this doesn't work, i'm getting "javax.naming.NotContextException:
geronimo/env/mtx.racer.beans.SellerFacade/entityManager"
so, i'm doing something wrong...
any tips or tap5&ejb3 examples?