RE: Re: EJB and restlet

2009-03-26 Thread Jerome Louvel
Hi Runar,

Glasfish is a JEE server which contains both a Servlet Web Container and an
EJB Container. See this page for details:
http://java.sun.com/javaee/5/docs/tutorial/doc/bnaay.html#bnabh

It's been a while since I coded EJBs, but it seems that you should be able
to lookup your EJBs using JNDI from your Restlets/Resources. Again more
details here:
http://java.sun.com/javaee/5/docs/tutorial/doc/bnbnp.html
 
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Runar Halse Kristiansen [mailto:runa...@gmail.com] 
Envoyé : mercredi 25 mars 2009 07:22
À : discuss@restlet.tigris.org
Objet : RE: Re: EJB and restlet

Thanks for your input. 

I'm running the restlet on Glassfish. My web-xml is configured to run in a
servlet container with a servlet of the class
com.noelios.restlet.ext.servlet.ServerServlet.
This is how the firststeps example on restlet.org page describes it. 
So this means that the restlet is running in a ejb container since Glassfish
is one, right?
If the ejb injection is not supposed to work, how can I get it to work in
the setting I schetched above?

Thanks:)

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=14112
52

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1430319


RE: Re: EJB and restlet

2009-03-25 Thread Runar Halse Kristiansen
Thanks for your input. 

I'm running the restlet on Glassfish. My web-xml is configured to run in a 
servlet container with a servlet of the class 
com.noelios.restlet.ext.servlet.ServerServlet.
This is how the firststeps example on restlet.org page describes it. 
So this means that the restlet is running in a ejb container since Glassfish is 
one, right?
If the ejb injection is not supposed to work, how can I get it to work in the 
setting I schetched above?

Thanks:)

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1411252


Re: EJB and restlet

2009-03-23 Thread John D. Mitchell
On Monday 2009.03.23, at 10:38 , webp...@tigris.org wrote:
[...]
 I'm trying to use an existing EJB of mine in a restlet context. I'm  
 quite noob in restlets so I'm not even sure this is supposed to work.
 When using @EJB annotation to inject the ejb reference I get a null- 
 pointer. The EJB is deployed properly on my Glassfish application  
 server, and the reference to it from my restlet project is correct.  
 I've tried doing the injection in one of the resources, but no luck.

Maybe I've missed something but I don't think that the Restlet  
engine is an ejb container.

I guess you could run the Restlet engine inside Glassfish using a  
servlet adapter and have your restlet code utilize your existing ejbs  
but I'm not sure what the value of that would really be and depending  
on the kind of ejbs you're using there will likely be various  
lifecycle/usage mismatches.

Take care,
John

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1391210