This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes JBoss 5.1.0 GA + EJB 3.0: RESTful Web Services with Jersey Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JBoss 5.1.0 GA + EJB 3.0: RESTful Web Services with Jersey" Watch "JBoss 5.1.0 GA + EJB 3.0: RESTful Web Services with Jersey" New topic
Author

JBoss 5.1.0 GA + EJB 3.0: RESTful Web Services with Jersey

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Hi,
I am using the Jersey implementation of the RESTful API (JSR -311) in an Enterprise application using JBoss as a server.

I am using EJB 3.0 of course. Not EJB 3.1, which is still not available with JBoss.

I'd like to expose a stateless session bean as a restful web service . Here is the code of its interface :


And the code of the bean :



My EJBs are located in an EJB project which is inside an Enterprise application (EAR file). How do you call that exposed resftul web service ?
I do have a Web project in that Enterprise application.

If using an URL, for a GET resource, what would it be like ?

http://localhost/EARname/something ?
http://localhost/EARname/EJBProjectName/something ?
...

Thanks for helping.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

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.

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JBoss 5.1.0 GA + EJB 3.0: RESTful Web Services with Jersey
 
Similar Threads
Calling a web service from an session bean.
NullPointer Exception in EJB 3.0
Help EJB3
EJB3 Session bean and JBoss 5
ejb 3.0 lookup