-
1. Re: JBoss 5.1.0 GA + EJB 3.0: RESTful Web Services with Jers
longbeach Dec 11, 2009 6:42 AM (in response to longbeach)Hi,
i got it working. It was just a basic configuration problem in Eclipse.
But now I have a question regarding injection of resources.
I am using the Jersey implementation of JSR-311.
I use EJB 3.0 (not 3.1). I have exposed a stateless session bean as a RESTful web service.
@Path("/blabla")
@Stateless
public class MyBean implements MyBeanRemote{
@PersistenceContext
private EntityManager em;
...
}
I try to inject a persistence context but it is not working. em is null.
So my question is :
do injection of resources (@PersistenceContext, @EJB ...) cease to work in a stateless session bean that has been exposed as a RESTful web service ?
Thanks -
2. Re: JBoss 5.1.0 GA + EJB 3.0: RESTful Web Services with Jers
jaikiran Dec 11, 2009 7:07 AM (in response to longbeach)Before i answer this, let me tell you that i don't have experience with RESTful web services (and haven't yet found time to read through the docs).
"longbeach" wrote:
How do you call that exposed resftul web service ?"longbeach" wrote:
Hi,
i got it working.
Can you tell us how you got that working? I mean how did you call the exposed RESTful web service? I even don't know whether exposing a SLSB as a RESTful web service guarantees any EJB semantics (like tx). Does it? -
3. Re: JBoss 5.1.0 GA + EJB 3.0: RESTful Web Services with Jers
longbeach Dec 11, 2009 8:21 AM (in response to longbeach)Jaikiran, I got it working by adding the EJB project as a library in my Web project, so that was just a configuration problem in Eclipse.
Now regarding the "theory", you might want to check the exchanges i just had with Adam Bien here :
http://www.adam-bien.com/roller/abien/entry/restful_calculator_with_javascript_and