<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    RestEasy deployment
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/atman">Igor Atman</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/592501#592501">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><span style="color: #008080; font-size: 10pt;"><p><span style="color: #000000;">Hi,</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #000000;"><span style="color: #000000;">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 &lt;servlet-class&gt; but received error complaining that my application cannot be cast into servlet. Then I used "unaware" version setting my Application as &lt;init-param&gt; inside &lt;servlet&gt; declaration . No luck either. The error now says "resource unavilable". What finally worked for me is setting my Application as &lt;</span>context-param&gt;. The app works fine but I have a couple of issues with the way it is deployed. </span></p><p><span style="color: #000000;">First, what does it mean that I can set up my Application through &lt;context-param&gt; only? Is something missing from my environment?</span></p><p><span style="color: #000000;">Is it true that it is normally not advisable to deploy the application through &lt;context-param&gt; (I heard that it can cause strange behavior from Spring beans etc.)? </span></p><p><span style="color: #000000;">Thanks!</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="color: #008080; font-size: 10pt;"> </span>&#160;</p><p><span style="font-size: 10pt;">Didn't work:</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="font-size: 10pt;"> </span>&#160;</p></span><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><p><p><p><p><p><p><p><p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p></p></p></p></p></p></p></p></p></p><p><p><p><p><p><p><p><p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p></p></p></p></p></p></p></p></p><p><p><p><p><p><p><p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p></p></p></p></p></p></p></p><p><p><p><p><p><p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p></p></p></p></p></p></p><p><p><p><p><p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p></p></p></p></p></p><p><p><p><p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p></p></p></p></p><p><p><p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p></p></p></p><p><p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p></p></p><p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p></p><p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p></p><p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><p align="left"><span style="color: #008080; font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="color: #008080; font-size: 10pt;"> </span>&#160;</p></span></p></p><p align="left"><p align="left"><div align="left"><span style="font-size: 10pt;"> </span></div></p><span style="font-size: 10pt;"> </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="font-size: 10pt;"> </span>&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p><p><span style="color: #000000;">&lt;servlet&gt;</span></p><p><p><span style="color: #000000;">&#160;&#160;&#160; &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;</span></p><p><span style="color: #000000;">&#160;&#160;&#160; &lt;servlet-class&gt;path.MyApplication&lt;/servlet-class&gt;</span></p><p><span style="color: #000000;">&lt;/servlet&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Didn't work:</p><p><a class="jive-link-anchor-small">#</a></p><p><a class="jive-link-anchor-small">#</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="font-size: 10pt;"> </span>&#160;</p></p><p><span style="color: #000000;">&lt;servlet&gt;</span></p><p><p><span style="color: #000000;">&#160;&#160;&#160; &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;</span></p><p><span style="color: #000000;">&#160;&#160;&#160; &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;</span></p><p><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;init-param&gt;</span></p><p><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;</span></p><p><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;param-value&gt;path.MyApplication&lt;/param-value&gt;</span></p><p><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/init-param&gt;</span></p><p><span style="color: #000000;">&lt;/servlet&gt;</span></p></p><div><div><span style="font-size: 10pt;"> </span></div></div><p align="left">Worked:</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #000000;">&lt;servlet&gt;</span></p><p><span style="color: #000000;">&#160;&#160;&#160; &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;</span></p><p><span style="color: #000000;">&#160;&#160;&#160; &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;</span></p><p><span style="color: #000000;"> </span><span style="color: #000000;">&lt;/servlet&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="color: #000000;"> </span>&#160;</p><p align="left"><span style="color: #000000; font-size: 10pt;">&lt;context-param&gt;<br/>&#160;&#160;&#160; &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;<br/>&#160;&#160;&#160; &lt;param-value&gt;path.MyApplication&lt;/param-value&gt;<br/>&lt;/context-param&gt;</span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/592501#592501">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>