3 Replies Latest reply on Dec 22, 2008 12:00 PM by stephanos

    Get JAX RS Jersey working...

    stephanos

      Hi forum,


      I'd like to use Jersey for my RESTful services (don't like using/having RESTeasy Beta 5 (!)). But I can't get it working with Seam (tried all flavors from 2.1.0 GA to 2.1.1. CR2). I always get


      java.lang.IllegalStateException: No active application scope



      when using Component.getInstance(..), although I have


      <web:context-filter url-pattern="/rest/*" />


      defined (The service itself works, is registered and can be browsed).


      I feel like JAX RS is a very neglected area in Seam (using this old RESTeasy version e.g.) ...


      Any suggestions?

        • 1. Re: Get JAX RS Jersey working...
          ckarthi

          If /rest/* is the URL mapping for Jersey servlet, we should be able to get the Seam components using Component.getInstance. I had done similar thing inside CXF service implementation classes. A stripped down version is  in this Link (as CXF runs within Spring container and instantiates on its own)

          • 2. Re: Get JAX RS Jersey working...
            stephanos

            Well, thanks for your response.


            I tried Jersey and CXF by now, nothing seems to work. I'm really devastated here, spending almost 1 week now with something that's supposed to be this easy. I hope Seam will fix it's horrible JAX RS support (really, Beta 5?, I mean it doesn't even recognize my interface annotations and can't produce application/xml content for a Collection, come on!).


            I really don't know where to go from here...maybe writing a MessageWriter for XML of collections might work, although it's really painful!


            I mean, is it so hard to listen to the community (https://jira.jboss.org/jira/browse/JBSEAM-3449) which even already tries to provide a solution?
            PLEASe correct me if I'm wrong, I hope so. Putting this JAX RS support on the feature list for 2.1.0 now seems like a joke to me, being in this bad shape...


            • 3. Re: Get JAX RS Jersey working...
              stephanos

              By the way, if anyone wants to use Collections in his @GET resources, I can recommend this workaround: My Link


              Of course, in the newest version of Jersey and probably RESTeasy, this is not necessary, but until someone integrates those with Seam (I would love to hear about it!), we have to stick with this..


              Cheers,
              stephan