From: Bill B. <bb...@re...> - 2010-08-10 20:19:08
|
Would be cool if you could put together a simple test case I can use to reproduce the problem. I'm not going to have time otherwise for the next few weeks because of various mini-vacations. Rubens Inaba wrote: > Bill, > > After removing the caching stuff the client started to work. > > Please let me know if you find a fix for the caching. > > I will try to use jackson instead. > > Thanks, > > Rubens > > On Tue, Aug 10, 2010 at 11:39 AM, Bill Burke <bb...@re... > <mailto:bb...@re...>> wrote: > > First, lets figure out the 404. Does the client work if you remove > the caching? If not, is the server getting and processing the request? > > As for the JSON output, I can't help you out much there as Jettison > sucks pretty bad. I'd suggest using the resteasy-jackson-provider > for processing JSON. > > Rubens Inaba wrote: > > This is my POJO definition @XmlRootElement(name = "addguest") > @Path("/") > > public class AddGuestWrapper { > /** The ADDRESSSOURCE. */ > String ADDRESSSOURCE ; > /** The PERSONNAMEID. */ > int PERSONNAMEID ; > /** The PERSONID. */ > int PERSONID; > /** The LEGACYCD. */ > String LEGACYCD = ""; > /** The MAILINGNAME. */ > String MAILINGNAME = ""; > /** The FIRSTNAME. */ > String FIRSTNAME = ""; > /** The LASTNAME. */ > String LASTNAME = ""; > /** The BIRTHDAY. */ > Date BIRTHDAY; > /** The SALUTATION. */ > String SALUTATION = ""; > /** The ADDRESSID. */ > int ADDRESSID; > /** The ADDRESSLIN e1. */ > String ADDRESSLINE1 = ""; > /** The ADDRESSLIN e2. */ > String ADDRESSLINE2 = ""; > /** The CITY. */ > String CITY = ""; > /** The STATECD. */ > String STATECD = ""; > /** The ZI p5. */ > String ZIP5 = ""; > /** The ZI p4. */ > String ZIP4 = ""; > /** The COUNTRYCD. */ > String COUNTRYCD = ""; > /** The POSTALCODE. */ > String POSTALCODE = ""; > /** The EMAIL. */ > String EMAIL = ""; > /** The PEMAIL. */ > String PEMAIL = ""; > /** The TOURSTAKEN. */ > String TOURSTAKEN; > /** The PTOURSTAKEN. */ > String PTOURSTAKEN; > /** The UNAPPLIEDBALANCE. */ > BigDecimal UNAPPLIEDBALANCE; > /** The AGENTID. */ > int AGENTID; > /** The middlename. */ > String middlename = ""; > /** The suffix. */ > String suffix = ""; > /** > * Gets the. > * * @return the adds the guest wrapper > */ > @GET > @Produces("application/json") > public AddGuestWrapper get(){ > return this; > } > > > I used to get this json before > [{"addguest":{"ADDRESSID":2835774,"ADDRESSLINE1":"150 > MEADOWBROOK RD > ","ADDRESSLINE2":" > > ","ADDRESSSOURCE":"HOUSEHOLD","AGENTID":0,"BIRTHDAY":"1900-01-01T00:00:00-05:00","CITY":"STRATFORD > ","COUNTRYCD":"USA > ","EMAIL":" > ","FIRSTNAME":"Paul","LASTNAME":"Louloudes","LEGACYCD":"04094099","MAILINGNAME":"","middlename":" > ","PEMAIL":" > ","PERSONID":218732,"PERSONNAMEID":2926925,"POSTALCODE":" > ","PTOURSTAKEN":0,"SALUTATION":"Mr. > ","STATECD":"CT","suffix":" ","TOURSTAKEN":"1 > ","UNAPPLIEDBALANCE":"0.00","ZIP4":3017,"ZIP5":"06614"}}] > > After upgrading I'm getting all lowercase and there's no > addguest attribute anymore. > [{"suffix":" > ","personnameid":2926925,"legacycd":"04094099","mailingname":"","firstname":"Paul","lastname":"Louloudes","birthday":-2208970800000,"salutation":"Mr. > ","addressid":2835774,"addressline1":"150 > MEADOWBROOK RD > ","addressline2":" > ","city":"STRATFORD > ","statecd":"CT","zip5":"06614","zip4":"3017","countrycd":"USA > ","postalcode":" > ","unappliedbalance":0.00,"agentid":0,"personid":218732,"ptourstaken":"0","addresssource":"HOUSEHOLD","email":" > ","pemail":" ","tourstaken":"1 ","middlename":" "}] > > > In the client side when I try to call this line > request.getTarget(String.class) I get this exception > org.jboss.resteasy.client.ClientResponseFailure: Failed with > status: 404 > at > org.jboss.resteasy.client.ClientRequest.getTarget(ClientRequest.java:498) > > What should I do? > > > thanks, > > Rubens > > > > On Tue, Aug 10, 2010 at 10:33 AM, Bill Burke <bb...@re... > <mailto:bb...@re...> <mailto:bb...@re... > <mailto:bb...@re...>>> wrote: > > Failing how? > > Rubens Inaba wrote: > > Hello All: > > What shoud I do after upgrading to resteasy 2.0 GA I'm > getting > this exception below: > > org.jboss.resteasy.client.ClientResponseFailure: Failed with > status: 404 > at > > org.jboss.resteasy.client.ClientRequest.getTarget(ClientRequest.java:498) > > > My client source code is as follow: > > > RegisterBuiltin.register(ResteasyProviderFactory.getInstance()); > FacesContext context = > FacesContext.getCurrentInstance(); > if ( null == > > context.getExternalContext().getSessionMap().get(Constants.LIGHTWEIGHTBROWSERCASHE) > ){ > cache = new LightweightBrowserCache(); > > context.getExternalContext().getSessionMap().put(Constants.LIGHTWEIGHTBROWSERCASHE, > cache); > }else{ > cache = > > (LightweightBrowserCache)context.getExternalContext().getSessionMap().get(Constants.LIGHTWEIGHTBROWSERCASHE); > } > // This line enables caching > ClientRequest request = new > ClientRequest(AppSettings.get("resteasyURL")+ > GuiUtil.URLEncodeSegements(url)); > request.setHttpMethod("GET"); > CacheFactory.makeCacheable(request, cache); > return > request.getTarget(String.class); //* **its failing here it > supposed to retrieve a JSON string** * > * > * > * > * > *Thanks,* > * > * > *Rubens * > * > * > > > > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > > > ------------------------------------------------------------------------ > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > <mailto:Res...@li...> > <mailto:Res...@li... > <mailto:Res...@li...>> > > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > -- Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |