<!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;">
JAX-RS and ClientFramework
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/sirwayne">Michael Müller</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/605821#605821">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hello,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>i cant't open a thread in the rest usegroup, so i post here my problem. =)...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I try to start the client example from the easy user guide:</p><p><a class="jive-link-external-small" href="http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html/RESTEasy_Client_Framework.html" target="_blank">http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html/RESTEasy_Client_Framework.html</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>but i get always a 404 error</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Exception in thread "main" org.jboss.resteasy.client.ClientResponseFailure: Error status 404 Not Found returned</p><p>    at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:414)</p><p>    at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:405)</p><p>    at org.jboss.resteasy.client.core.BaseClientResponse.checkFailureStatus(BaseClientResponse.java:399)</p><p>    at org.jboss.resteasy.client.core.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:38)</p><p>    at org.jboss.resteasy.client.core.ClientInvoker.invoke(ClientInvoker.java:107)</p><p>    at org.jboss.resteasy.client.core.ClientProxy.invoke(ClientProxy.java:72)</p><p>    at $Proxy18.getBasic(Unknown Source)</p><p>    at client.RestClient.main(RestClient.java:34)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My Code:</p><p>Client side#</p><p>public class RestClient {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    public static void main(String[] args) {</p><p>           // this initialization only needs to be done once per VM</p><p>        RegisterBuiltin.register(ResteasyProviderFactory.getInstance());</p><p><span>        SimpleClient client = ProxyFactory.create(SimpleClient.class, "</span><a class="jive-link-external-small" href="http://localhost:8080/" target="_blank">http://localhost:8080/</a><span>");</span></p><p>        System.out.println(client.getBasic());</p><p>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Server side:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>@Path("/")</p><p>public interface SimpleClient</p><p>{</p><p>   @GET</p><p>   @Path("basic")</p><p>   @Produces("text/plain")</p><p>   String getBasic();</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>public class SimpleClientImpl implements SimpleClient{</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    @Override</p><p>    public String getBasic() {</p><p>        return "Test";</p><p>    }</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>web.xml</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p><span>&lt;web-app version="3.0" xmlns="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a><span>"</span></p><p><span>    xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"</span></p><p><span>    xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a><span> </span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" target="_blank">http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd</a><span>"&gt;</span></p><p>&lt;/web-app&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>Has anybody an idea? There is no problem if i use a browser </span><a class="jive-link-external-small" href="http://localhost:8080/project/basic" target="_blank">http://localhost:8080/project/basic</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks =)</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/605821#605821">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>