[jboss-user] [JBoss Web Services] - RestEasy deployment
Igor Atman
do-not-reply at jboss.com
Thu Mar 10 11:41:25 EST 2011
Igor Atman [http://community.jboss.org/people/atman] created the discussion
"RestEasy deployment"
To view the discussion, visit: http://community.jboss.org/message/592501#592501
--------------------------------------------------------------
Hi,
I'm new to RestEasy and for my test project I was following Bill Burke's "Restful Java" examples. My project works fine but what is bothering me is that I was unable to deploy it as described in the book. Bill provides two web.xml examples for deployment in both "JAX-RS-aware and unaware" containers. None worked for me. First I expected JBoss container to be JAX-RS aware. I tried to set my Application class as <servlet-class> but received error complaining that my application cannot be cast into servlet. Then I used "unaware" version setting my Application as <init-param> inside <servlet> declaration . No luck either. The error now says "resource unavilable". What finally worked for me is setting my Application as <context-param>. The app works fine but I have a couple of issues with the way it is deployed.
First, what does it mean that I can set up my Application through <context-param> only? Is something missing from my environment?
Is it true that it is normally not advisable to deploy the application through <context-param> (I heard that it can cause strange behavior from Spring beans etc.)?
Thanks!
Didn't work:
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>path.MyApplication</servlet-class>
</servlet>
Didn't work:
#
#
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>path.MyApplication</param-value>
</init-param>
</servlet>
Worked:
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
</servlet>
<context-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>path.MyApplication</param-value>
</context-param>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/592501#592501]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110310/c97bfaac/attachment.html
More information about the jboss-user
mailing list