Re: [Resteasy-users] Resteasy and Vert.x

2015-01-17 Thread Bill Burke
Awesome!  Thanks!

On 1/16/2015 11:49 AM, Kristoffer Sjögren wrote:
> Hi
>
> I have created a project called vertxrs which support JAX-RS over Vert.x.
>
> This is the embedded version of Vert.x which use Resteasy as the
> implementation of JAX-RS.
>
> https://github.com/deephacks/vertxrs
>
> The jars should be in Maven Central at any moment.
>
> Enjoy,
> -Kristoffer
>
>
> --
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Use Resteasy server-side Cache

2014-10-29 Thread Bill Burke
Implementation was refactored and reimplemneted in 3.0:

http://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html/Cache_NoCache_CacheControl.html#server_cache

On 10/29/2014 1:35 PM, Frederic Eßer wrote:
> Hello everyone,
>
> I develop a software which provides webservices on a tomcat. These
> webservices parse and display data from a 3rd website with JSOUP in XML
> or JSON format.
> Now I want to use the server-side caching to reduce the requests be made
> to these websites.
> The Project is managed with Maven and I'm using the 3.0.6.Final version
> of resteasy and it will all be deployed on an integrated Tomcat 7 for
> testing purposes.
>
> While researching on how to get the caching into my project I stumbled
> upon this link
> http://docs.jboss.org/resteasy/docs/1.1.GA/userguide/html/Cache_NoCache_CacheControl.html
> which I thought contained everything I needed. So I added the dependency
> to my pom
>
>  
>  org.jboss.resteasy
>  resteasy-cache-core
>  3.0.9.Final
>  
>
> and added the context parameter to my web.xml
>
>  
>  resteasy.server.cache.maxsize
>  1000
>  
>
>  
>
> resteasy.server.cache.eviction.wakeup.interval
>  5000
>  
>
>  
>
> org.jboss.resteasy.plugins.cache.server.ServletServerCache
>  
>
> But while trying to run the project on my server I get the following
> exception
>
> SEVERE: Error configuring application listener of class
> org.jboss.resteasy.plugins.cache.server.ServletServerCache
> java.lang.ClassNotFoundException:
> org.jboss.resteasy.plugins.cache.server.ServletServerCache
>  at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
>  at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
>  at
> org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
>  at
> org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
>  at
> org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
>  at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4638)
>  at
> org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
>  at
> org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
>  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>  at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  at java.lang.Thread.run(Thread.java:745)
>
> So I build the war with Maven -> build and checked for the jar file in
> WEB-INF/lib/ and found the resteasy-cache-core-3.0.9.Final.jar.
>
> What is going wrong? Or is the way on approaching the server-side cache
> implementation wrong?
>
> Thank you.
>
>
> ------
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Pool for javax.ws.rs.client.Client objects?

2014-10-29 Thread Bill Burke
By default, Resteasy only allows one connection per Client.  You have to 
use ResteadyClient(Builder) to expand this.  Other than that, it should 
be threadsafe.

Personally, I'd create the Client as an application-scoped CDI bean and 
inject it, or create one with SPring and inject it, or create one in a 
servlet listener and add it to ServletContext.  If you create per 
request, then you lose any socket connection pooling that Apache Http 
Client does.

On 10/27/2014 8:21 PM, Savvas Andreas Moysidis wrote:
> The question, I suppose, is whether Client implementations are
> thread-safe or not which is something that is not stipulated by the
> interface contract.
>
> If they are(something which is sort of implied by the javadoc), then you
> could maybe declare and use a single instance like the following? (in a
> JavaEE context)
>
> @Singleton
> public class SomeService {
>
>  private Client restClient;
>
>  @PostConstruct
>  private void init() {
>  restClient = ClientBuilder.newClient();
>  }
>  .
>  // Use restClient object here
>  .
>
>  @PreDestroy
>  private void cleanUp() {
>  restClient.close();
>  }
> }
>
> On 27 October 2014 23:24, Mario Diana  <mailto:mariodi...@gmail.com>> wrote:
>
> I'd be interested in hearing what common practice is regarding
> pooled Client objects, too. Do people use the Apache objects pool
> library? That's the only option I've heard of. Are there other
> mainstream solutions?
>
> Mario
>
>  > On Oct 27, 2014, at 12:39 PM, Rodrigo Uchôa
> mailto:rodrigo.uc...@gmail.com>> wrote:
>  >
>  > [...]
>
> > How should we implement a pool of Client objects in this scenario? Is 
> there a common solution?
> >
> > Regards,
> > Rodrigo Uchoa.
>
>
> 
> --
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
>
>
> ------
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] 3.0.9.Final released

2014-09-17 Thread Bill Burke
See here for details:

http://bill.burkecentral.com/2014/09/17/resteasy-3-0-9-released/

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] master should be buildable

2014-09-12 Thread Bill Burke
Master should be buildable now.  Please don't submit a PR without doing 
a full successful build.  Between Keycloak, conferences, and summer 
vacations, I should be able to spend more time on Resteasy now.

Much thanks to Ron and the community in holding things together while I 
was busy.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] ClientErrorInterceptor and JAX-RS 2.0 clients

2014-07-01 Thread Bill Burke
If you write a ClientResponseFilter you can do the processing there. 
The only thing is is that your exceptions need to extend 
ResponseProcessingException or they will be wrapped in one.

On 7/1/2014 4:19 AM, Peter Wright wrote:
> Hi Bill,
>
> I did, yes - this is the code:
>
> https://github.com/petergeneric/stdlib/blob/e09fc586edbee4d7ff3b5040742726e4bb9a595c/guice/restclient/src/main/java/com/peterphi/std/guice/restclient/resteasy/impl/ResteasyClientErrorInterceptor.java
>
> On 6/30/2014 5:17 PM, Bill Burke wrote:
>> What did you do in your clienterrorinterceptor? Convert it to an exception?
>>
>>
>> On 6/30/2014 12:48 PM, Peter Wright wrote:
>>> Hi,
>>>
>>> I’ve been using the (now deprecated) proxy client since resteasy 2. I’m
>>> using 3.0.7.Final and am wanting to use WebTarget to build the dynamic
>>> proxy using ResteasyClient.target(url).proxy(interface).
>>>
>>> I use a server-side ExceptionMapper that produces a structured
>>> representation of the exception which is then used by the client to
>>> produce more descriptive client-side errors about what failed on the
>>> server, which server and why. I had been using ClientErrorInterceptor
>>> for this, but I see that the new dynamic proxy client no longer uses
>>> ClientErrorInterceptor… is there a way to do this in the new dynamic
>>> proxy client? I’ve tried using a ReaderInterceptor and DynamicFeature
>>> but it doesn’t seem to get called when (for example) a 404 error is
>>> returned.
>>>
>>> Any pointers would be much appreciated.
>>>
>>> --
>>> Peter
>>>
>>>
>>> --
>>> Open source business process management suite built on Java and Eclipse
>>> Turn processes into business applications with Bonita BPM Community Edition
>>> Quickly connect people, data, and systems into organized workflows
>>> Winner of BOSSIE, CODIE, OW2 and Gartner awards
>>> http://p.sf.net/sfu/Bonitasoft
>>>
>>>
>>>
>>> ___
>>> Resteasy-users mailing list
>>> Resteasy-users@...
>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>>
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com
>
>>
>
>
>
> --
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] ClientErrorInterceptor and JAX-RS 2.0 clients

2014-06-30 Thread Bill Burke
What did you do in your clienterrorinterceptor?  Convert it to an exception?


On 6/30/2014 12:48 PM, Peter Wright wrote:
> Hi,
>
> I’ve been using the (now deprecated) proxy client since resteasy 2. I’m
> using 3.0.7.Final and am wanting to use WebTarget to build the dynamic
> proxy using ResteasyClient.target(url).proxy(interface).
>
> I use a server-side ExceptionMapper that produces a structured
> representation of the exception which is then used by the client to
> produce more descriptive client-side errors about what failed on the
> server, which server and why. I had been using ClientErrorInterceptor
> for this, but I see that the new dynamic proxy client no longer uses
> ClientErrorInterceptor… is there a way to do this in the new dynamic
> proxy client? I’ve tried using a ReaderInterceptor and DynamicFeature
> but it doesn’t seem to get called when (for example) a 404 error is
> returned.
>
> Any pointers would be much appreciated.
>
> --
> Peter
>
>
> --
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Stacktrace in logs when throwing WebApplicationException

2014-06-28 Thread Bill Burke
Resteasy logs these exceptions.  You'd ahve to filter out this in your
logger config.

On 6/24/2014 11:48 PM, Johnson, Shawn [USA] wrote:
> I am using Resteasy 2.3.3, bundled with JBoss-AS-7.1.3.  I'm trying to
> throw a new WebAppliationException, and the output (to the client) seems
> fine, but I'm left with an unwanted stack trace in my log.  I have a few
> other Exceptions mapped, and I was wondering if the mapping was somehow
> causing an issue ­ trying to wrap this Exception.
> 
> Simple example:
> 
> public class SimpleService {
> 
>   @GET
>   @Path("stuff")
>   public String getStuff(final @QueryParam("param1") String param1,
> @QueryParam("param2") String param2) throws ActionException {
>   if (param1==null && param2==null) {
>   throw new WebApplicationException();
>   }
> 
> I get the following exception: [WARN]
> org.jboss.resteasy.core.SynchronousDispatcher#error - failed to execute:
> javax.ws.rs.WebApplicationException
> 
> Any ideas what this error might mean?
> 
> 
> 
> --
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
> 

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Performance issue resteasy+s-ramp

2014-06-13 Thread Bill Burke
So, it should use the jaxb context cache.

Log a jira?  Timeframe for fix?  I promised Mark I'd meet any of your 
requirements so you could get off of Jersey.

On 6/13/2014 10:12 AM, Eric Wittmann wrote:
> We're using RE to provide the Atom API in our jboss overlord s-ramp
> implementation.  Something we've run into is a performance problem
> iterating over certain Atom Feeds.  In some circumstances each Entry in
> the atom Feed can wrap an additional jaxb object.  We get access to this
> via Entry's getAnyOtherJAXBObject.
>
> This all works great except that there is no JAXBContextFinder set on
> the Entry, so a new JAXBContext is created for each Entry.
>
> I think the root of this problem is here:
>
> https://github.com/resteasy/Resteasy/blob/master/jaxrs/providers/resteasy-atom/src/main/java/org/jboss/resteasy/plugins/providers/atom/AtomFeedProvider.java#L65-L68
>
> Perhaps the finder should be set on the Entry either in all cases or
> maybe only when Entry:getAnyOtherElement() returns a non-null?
>
> -Eric
>
> --
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Running ContainerWriteFilter *after* WriterInterceptor?

2014-06-09 Thread Bill Burke


On 6/7/2014 5:51 PM, Heiko W.Rupp wrote:
> Hey Bill,
>
> thanks for your reply.
>
> Am 07.06.2014 um 22:08 schrieb Bill Burke :
>
>> Unfortunately, the JAX-RS TCK expects that the MBW is not matched until
>> after the WriterInterceptor is invoked.   We used to match prior to
>
> What a c$%@!
>
>> invoking the interceptor chain...
>
> Which makes so much sense
>
>>
>> So, you have 2 options:
>>
>> 1. In your WriterInterceptor buffer the json marshalling, change the
>> content header, flush the buffer.
>
> I have this block in aroundWriteTo:
>
>  try {
>  context.proceed();
>  } finally {
>  context.getHeaders().get("Content-Type").clear();
>  
> context.getHeaders().putSingle("Content-Type",APPLICATION_JAVASCRIPT);
>  }
>


> But that header change is not recorded in the output.
> And when I understand you correctly above, this would be an issue anyway,
> because the changed header would influence the MBW matcher which runs after 
> the interceptor.
>

Headers get flushed and can't be changed after the entity has been 
written to the stream.

Again, you'll have to buffer the entity and rewrite it to the actual 
stream after you've changed the content-type header.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] question about CORS

2014-06-09 Thread Bill Burke
There is no good way to implement this in 2.3.x.  You would have to 
write a resource class to handle all preflight OPTIONS requests. 
Depending on how you want to validate origins, you'd have to write a 
PreProcessInterceptor and PostProcessInterceptor and @Context inject a 
HttpResponse or HttpRequest respectively.

FYI, 2.3.x is retired in the community and support and updates are only 
available by subscription.  3.0.x has been out for a year and can be 
installed on top of AS7 or EAP 6.x


On 6/9/2014 11:50 AM, Gervasio Amy wrote:
> Hello all,
>
> I'm a RESTEasy 2.3.5 version user and I experiencing some issues while
> trying to enable CORS.
> I'm using this CORS filter implementation
> <http://software.dzhuvinov.com/cors-filter.html> (which is basically a
> servlet filter) and it works well for successful responses, but when I
> have to handle errors through ExceptionMapper, which returns a new
> response (for ex. Response.status(Response.Status.FORBIDDEN).build()) it
> removes the CORS headers previously set by the filter mentioned.
>
> I saw there a new CorsFilter
> <https://github.com/resteasy/Resteasy/blob/70e918d9bbcd534ce177ae5b0a62b46408cf51e5/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/interceptors/CorsFilter.java>
>  created
> in 3.0.7 version, based on interceptors.
>
> So, my question is: how would I implement CORS in a application which
> uses previous version of RESTEasy?
>
> Thanks in advance,
>
> Gervasio
>
>
> --
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://www.hpccsystems.com
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Running ContainerWriteFilter *after* WriterInterceptor?

2014-06-07 Thread Bill Burke
Unfortunately, the JAX-RS TCK expects that the MBW is not matched until 
after the WriterInterceptor is invoked.   We used to match prior to 
invoking the interceptor chain...

So, you have 2 options:

1. In your WriterInterceptor buffer the json marshalling, change the 
content header, flush the buffer.

2. Write a special MBW that delegates to the JSON writer and sets the 
content header before doing this.

Make sense?

On 6/7/2014 1:00 PM, Heiko W.Rupp wrote:
> Hey,
>
> I have a use case where the user is requesting jsonp encoding e.g. via custom 
> media type or a .jsonw ending.
>
> Anyway. I can intercept the call and surround with "jsonp();" successfully, 
> but the returned
> content-type needs to be changed to "application/javascript".
>
> I could accept that as incoming type, but then RE is complaining about no 
> matching MessageBodyWriter.
>
> So I am thinking of using ContainerWriteFilter to re-write this, but the 
> calls seem to be
>
> MessageHandler method (@GET foo() {} )  (1)
> ContainerWriteFilter   (2)
>  (3)
> WriterInterceptor. (4)
> (5)
>
> So when I rewrite the content header in (2) a the mbw in (3) complains about 
> wrong type and
> in (4) I can not check if the desired content type is my custom one to 
> request the wrapping or not.
>
> So I would need to run a ContainerWriteFilter at (5) to rewrite the header 
> *after* the interceptor has run.
>
> In RHQ I solved that with a normal servlet filter, but it looks like this 
> does not work here because
> of Async processing (and rewriting the filter with an AsyncListener has its 
> own issues )
>
> Thanks
> Heiko
>
>
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Why no client.close()?

2014-05-29 Thread Bill Burke
THere is a finalize in ApacheHttpClient4Engine.  We actually have a unit 
test that tests GC for responses and clients.

But, you should never rely on finalize.  Its really bad practice.  The 
examples are a poor job on my end if they don't do close.

On 5/28/2014 5:16 PM, Guy Rouillier wrote:
> Thanks for the reply, Bill.  I cloned the RESTEasy repo so I could look
> at the latest source.  I see that ResteasyClient.java has a close()
> method, but no finalize().  So, I suppose the most conservative course
> of action would be to specifically invoke ResteasyClient.close() in a
> finally block for any code that creates an instance.
>
> On 5/28/2014 8:06 AM, Bill Burke wrote:
>> Oh, one more thing.  ResteasyClient does implement finalize and will
>> close during garbage collection.
>>
>> On 5/28/2014 12:49 AM, Guy Rouillier wrote:
>>> The RESTEasy documentation specifically says (section 48.3):
>>>
>>> "Finally, if your javax.ws.rs.client.Client class has created the engine
>>> automatically for you, you should call Client.close() and this will
>>> clean up any socket connections."
>>>
>>> Yet the overwhelming majority of examples I can find, including those
>>> shipped with RESTEasy, do not explicitly invoke Client.close().  Is this
>>> because resource cleanup will eventually be done automatically during
>>> garbage collection?
>>>
>>> We are using the ResteasyClient proxy approach, but that class extends
>>> Client, so I'm assuming the same discussion holds for the proxy.
>>>
>>> Thanks.
>>>
>>
>
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Why no client.close()?

2014-05-28 Thread Bill Burke
Oh, one more thing.  ResteasyClient does implement finalize and will 
close during garbage collection.

On 5/28/2014 12:49 AM, Guy Rouillier wrote:
> The RESTEasy documentation specifically says (section 48.3):
>
> "Finally, if your javax.ws.rs.client.Client class has created the engine
> automatically for you, you should call Client.close() and this will
> clean up any socket connections."
>
> Yet the overwhelming majority of examples I can find, including those
> shipped with RESTEasy, do not explicitly invoke Client.close().  Is this
> because resource cleanup will eventually be done automatically during
> garbage collection?
>
> We are using the ResteasyClient proxy approach, but that class extends
> Client, so I'm assuming the same discussion holds for the proxy.
>
> Thanks.
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Why no client.close()?

2014-05-28 Thread Bill Burke
The examples are bad examples of clean code.

On 5/28/2014 12:49 AM, Guy Rouillier wrote:
> The RESTEasy documentation specifically says (section 48.3):
>
> "Finally, if your javax.ws.rs.client.Client class has created the engine
> automatically for you, you should call Client.close() and this will
> clean up any socket connections."
>
> Yet the overwhelming majority of examples I can find, including those
> shipped with RESTEasy, do not explicitly invoke Client.close().  Is this
> because resource cleanup will eventually be done automatically during
> garbage collection?
>
> We are using the ResteasyClient proxy approach, but that class extends
> Client, so I'm assuming the same discussion holds for the proxy.
>
> Thanks.
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] RESTEasy Client in OSGi Environment

2014-05-23 Thread Bill Burke
ss.resteasy.specimpl.BuiltResponse.readEntity(_BuiltResponse.java:211_)
>
>at
> org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(_ClientInvocation.java:104_)
>
>... 18 more
>
> By debugging the included libraries, I tracked the problem down to the
> following location:
>
> ResteasyProviderFactory.java
>
> *protected* MessageBodyReader resolveMessageBodyReader(Class
> type, Type genericType, Annotation[] annotations, MediaType mediaType,
> MediaTypeMap> availableReaders)
>
> {
>
> List> readers =
> availableReaders.getPossible(mediaType, type);
>
> //logger.info(" getMessageBodyReader ***");
>
> *for*(SortedKey reader : readers)
>
> {
>
> //logger.info(" matching reader: " + reader.getClass().getName());
>
> *if*(reader.obj.isReadable(type, genericType, annotations, mediaType))
>
> {
>
> *return*(MessageBodyReader) reader.obj;
>
> }
>
> }
>
> *return**null*;
>
> }
>
> The problem is a little weired: The readers list of MessageBodyReader
> instances contains the
> org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlRootElementProvider,
> but the reader.obj.isReadable() method returns false for that reader.
>
> In another setup as a plain Maven project outside of the OSGi world, the
> the referred method reader.obj.isReadable() returns true and the same
> piece of code works.
>
> I am at the end of my knowledge… Do you guys have any hints?
>
> Best regards,
>
> Timo Rohrberg
>
>
> 
> Hinweis: Diese Email enthält evtl. vertrauliche und rechtlich geschützte
> Informationen. Sollten Sie nicht der richtige Adressat sein oder diese
> Email irrtümlich erhalten haben, informieren Sie bitte sofort den Absender,
> und löschen Sie anschließend diese E-Mail. Das unerlaubte Kopieren sowie
> die unbefugte Weitergabe des Inhalts dieser Email sind nicht gestattet.
>
> Attention: This e-mail may contain confidential and/or privileged
> information. If you are not the intended recipient or if you have received
> this e-mail in error, please notify the sender immediately and delete this
> e-mail. Any unauthorized copying, disclosure or distribution of the
> contents of this e-mail is strictly prohibited.
>
>
> --
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Injecting an EJB in a Resteasy Resource authenticated with OAuth 2.0

2014-05-23 Thread Bill Burke
ors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32)
>  [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
>   at 
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) 
> [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
>   at 
> org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
>  [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
>   at 
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) 
> [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
>   at 
> org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
>  [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
>   at 
> org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) 
> [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
>   at 
> org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173)
>  [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
>   at 
> org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) 
> [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
>   at 
> org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
>  [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
>   at 
> org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)
>  [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
>
> Could you help me, please?
>
> Thanks in advance!
> Inacio
>
> --
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Resteasy OAuth 2.0 Skeleton Key Example launchs javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

2014-05-13 Thread Bill Burke
BTW, take a look at keycloak.org

Its the new project I started for security.

On 5/13/2014 5:08 PM, Bill Burke wrote:
> You have to provide a truststore or disable the trust manager.
>
> On 5/13/2014 4:26 PM, JOSÉ INÁCIO DA SILVA JÚNIOR wrote:
>> Hi!
>>
>> I'm trying to implement SSO through Resteasy Skeleton Key.
>> I'm following the Chapter 39. OAuth 2.0 and Resteasy Skeleton Key of 
>> Resteasy Reference Guide.
>>
>> I generated my keystore with:
>>
>> keytool -genkey -alias mydomain -keyalg rsa -keystore realmDINF.jks
>>
>> then I exported my certificate with:
>>
>> keytool -exportcert -alias mydomain -keystore 
>> /opt/jboss-7.1.1.Final/standalone/configuration/realmDINF.jks -file 
>> /opt/jboss-7.1.1.Final/standalone/configuration/mydomain.cer
>>
>> then I imported my certificate into cacerts:
>>
>> keytool -import -alias mydomain -keystore cacerts -trustcacerts -file 
>> /opt/jboss-7.1.1.Final/standalone/configuration/mydomain.cer
>>
>>
>> The auth-server application e the customer-app applicaton were deployed
>>
>> When I access the customer-app application in my browser:
>>
>> https://localhost:8443/customer-app
>>
>> I see the login page and when I enter user and password I get the following 
>> exception:
>>
>> 17:09:35,499 ERROR [org.apache.catalina.connector.CoyoteAdapter] 
>> (http--127.0.0.1-8443-1) An exception or error occurred in the container 
>> during the request processing: javax.ws.rs.ProcessingException: Unable to 
>> invoke request
>>  at 
>> org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:287)
>>  [resteasy-client-3.0.7.Final.jar:]
>>  at 
>> org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:407)
>>  [resteasy-client-3.0.7.Final.jar:]
>>  at 
>> org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:195)
>>  [resteasy-client-3.0.7.Final.jar:]
>>  at 
>> org.jboss.resteasy.skeleton.key.as7.ServletOAuthLogin.resolveCode(ServletOAuthLogin.java:271)
>>  [skeleton-key-as7-3.0.7.Final.jar:]
>>  at 
>> org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.oauth(OAuthManagedResourceValve.java:273)
>>  [skeleton-key-as7-3.0.7.Final.jar:]
>>  at 
>> org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.authenticate(OAuthManagedResourceValve.java:175)
>>  [skeleton-key-as7-3.0.7.Final.jar:]
>>  at 
>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:455)
>>  [jbossweb-7.0.13.Final.jar:]
>>  at 
>> org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.invoke(OAuthManagedResourceValve.java:138)
>>  [skeleton-key-as7-3.0.7.Final.jar:]
>>  at 
>> org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
>>  [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
>>  at 
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
>>  [jbossweb-7.0.13.Final.jar:]
>>  at 
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>  [jbossweb-7.0.13.Final.jar:]
>>  at 
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>  [jbossweb-7.0.13.Final.jar:]
>>  at 
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) 
>> [jbossweb-7.0.13.Final.jar:]
>>  at 
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) 
>> [jbossweb-7.0.13.Final.jar:]
>>  at 
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
>>  [jbossweb-7.0.13.Final.jar:]
>>  at 
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) 
>> [jbossweb-7.0.13.Final.jar:]
>>  at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
>> Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
>>  at 
>> com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
>>  [jsse.jar:1.6]
>>  at 
>> org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128) 
>> [httpclient-4.2.1.jar:4.2.1]
>>  at 
>> org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
>>  [httpclient-4.2.1.jar:4.2.1]
>>  at 
>> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(Defau

Re: [Resteasy-users] Resteasy OAuth 2.0 Skeleton Key Example launchs javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

2014-05-13 Thread Bill Burke
uestDirector.java:479)
>  [httpclient-4.2.1.jar:4.2.1]
>   at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
>  [httpclient-4.2.1.jar:4.2.1]
>   at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
>  [httpclient-4.2.1.jar:4.2.1]
>   at 
> org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:283)
>  [resteasy-client-3.0.7.Final.jar:]
>   ... 16 more
>
> I've tried everything but I couldn't get authenticated in customer-app 
> application.
>
> Please, help me.
> What am I missing?
>
>
> Thanks in advance!
>
> --
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Client read timeouts on a call-by-call basis

2014-05-07 Thread Bill Burke
I assume you're using the old deprecated client api?

ProxyFactory allows you to pass in a ClientExecutor.  Create one of 
those, and pass it in.  Then you have a reference to it.

ApacheHttpClient4Executor executor = new ApacheHttpclient4Executor(...);

MyInterface proxy = ProxyFactory.create(MyInterface.class, "http:/base", 
executor);



On 5/7/2014 8:47 AM, David R Robison wrote:
> Thanks, if I am creating a new client each time (I'm using the
> ProxyFactory) then what is the proper way to release a proxy created by
> ProxyFactory? David
>
> David R Robison
> Open Roads Consulting, Inc.
> 103 Watson Road, Chesapeake, VA 23320
> phone: (757) 546-3401
> e-mail: drrobi...@openroadsconsulting.com
> web: http://openroadsconsulting.com
> blog: http://therobe.blogspot.com
> book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526
>
> On 5/7/2014 8:42 AM, Bill Burke wrote:
>> You would have to create a new ResteasyClient each time.  We use Apache
>> HttpClient under the covers, IIRC, you could only set it at socket
>> creation time, not per request.  I could be wrong though.
>>
>> On 5/6/2014 12:34 PM, David R Robison wrote:
>>> I am using the resteasy client to communicate with a digital camera.
>>> Most of the commands finish in about 300ms but some take over 2s. Is
>>> there a way to specify the read timeout for individual calls? I know I
>>> can set a global SO_TIMEOUT value but can I change it with wach call I make?
>>> Thanks, David
>>>
>
>
>
> This email communication (including any attachments) may contain confidential 
> and/or privileged material intended solely for the individual or entity to 
> which it is addressed.
> If you are not the intended recipient, please delete this email immediately.
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Client read timeouts on a call-by-call basis

2014-05-07 Thread Bill Burke
You would have to create a new ResteasyClient each time.  We use Apache 
HttpClient under the covers, IIRC, you could only set it at socket 
creation time, not per request.  I could be wrong though.

On 5/6/2014 12:34 PM, David R Robison wrote:
> I am using the resteasy client to communicate with a digital camera.
> Most of the commands finish in about 300ms but some take over 2s. Is
> there a way to specify the read timeout for individual calls? I know I
> can set a global SO_TIMEOUT value but can I change it with wach call I make?
> Thanks, David
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] deprecated classes in new version

2014-05-07 Thread Bill Burke
Assume anything deprecated is available in JAX-RS 2.0.

On 5/4/2014 2:47 PM, kishore das wrote:
> Hi,
>
> I have recently started using RestEasy and still working my ways through
> it.
>
> I could see that for a lot of deprecated classes, there is no suggestion
> in javadoc as to what should be used instead. It would be great help if
> you could provide this going forward.
>
> Regards
> Kishore
>
>
> --
> Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Client API Exception Mapper

2014-04-29 Thread Bill Burke
JAx-RS requires that any exception thrown in a filter should be wrapped 
by ResponseProcessingException.  So, I don't think you should be 
implementing this in a filter.

On 4/28/2014 3:52 PM, Rodrigo Uchôa wrote:
> Hi everyone!
>
> Is there a way, using the client API, to map HTTP response codes to
> Exceptions?
>
> I'm developing clients that make calls to REST endpoins. These endpoins
> return multiple response error codes. To make things easier on the
> client side, I would like to map these response codes to some of my
> custom client Exceptions. For instance, a response code 409 could map to
> a BusinessException and so on.
>
> To achieve this, my first instinct was to use a ClientResponseFilter. It
> even worked, but the JAX-RS runtime is wrapping my exceptions inside a
> *javax.ws.client.ResponseProcessingException*. Although that does not
> stop me, all these "arrangements" are making me wonder if I chose the
> right path.
>
> Summing up, is using a ClientReponseFilter the best way?
>
>
> --
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.  Get
> unparalleled scalability from the best Selenium testing platform available.
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] StringParameterUnmarshaller Issues

2014-04-29 Thread Bill Burke


On 4/29/2014 11:29 AM, Bill Burke wrote:
> SimpleDateFormat is not threadsafe.  Read the Javadoc.
>

BTW, unfortunately, I did not know SimpleDateFormat was not threadsafe 
and it is used as a singleton in 2.3.x codebase in a few places.  This 
has been fixed in 3.x.


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] StringParameterUnmarshaller Issues

2014-04-29 Thread Bill Burke
SimpleDateFormat is not threadsafe.  Read the Javadoc.

For StringParamUnmarshaller, Resteasy stores them in a map keyed by 
classname of the generic type:

For example:

class FooUnmarshaller implements StringParamUnmarshaller {}

FooUnmarshaller will be used to unmarshall Foo classes only.  No 
subclasses of Foo though!  That's just the limitation.

An unmarshaller instance is created *per method parameter*. 
setAnnotations is called with the annotations of that parameter.

So, if you had this:

@GET
public STring get(@Bar @HeaderParam("header") Foo arg1, @Stuff 
@HeaderParam("header") Foo arg2) {}

An instance of FooUnmarshaller would be instantiated for arg1.  ANother 
instance created for arg2.





On 4/28/2014 1:45 PM, Allen Gilbert wrote:
> Hello,
>
> Per
> http://docs.jboss.org/resteasy/docs/2.3.5.Final/userguide/html/StringConverter.html#StringParamUnmarshaller,
> I created a @DateFormat annotation for unmarshalling query parameters
> into Date objects. Initially, I thought it was working well, but once I
> started using more than one date format, I ran into trouble.
>
> The user guide states that a StringParameterUnmarshaller "is created per
> injector," but its JavaDoc says, "Instances of this class are created
> per parameter injection." I'm not sure what "created per injector"
> means, but I read "created per parameter injection" to mean that my
> custom unmarshaller should be instantiated per resource method call.
> This is consistent with the example in the user guide, which assumes
> that setAnnotations() is called for each request. Otherwise, only one
> date format could ever be registered, and also, DateFormatter would not
> be thread-safe.
>
> These are exactly the two issues I've run into: only one date format is
> ever used to unmarshal query parameters, so many of my resource methods
> fail because of wacky dates. Furthermore, when running at high load,
> date parsing sometimes fails when multiple threads access the same
> SimpleDateFormat instance. I've verified that the only
> time setAnnotations() is called on my custom parameter unmarshaller is
> during the very first request, as part of ResteasyDeployment.start().
>
> Is this "caching" of StringParameterUnmarshallers by design?
>
> -Allen
>
>
> --
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.  Get
> unparalleled scalability from the best Selenium testing platform available.
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] exception mappers and intercepting them?

2014-04-23 Thread Bill Burke
I would catch the upstream and handle it within code.

On 4/23/2014 3:36 PM, Tom Butt wrote:
> We currently use exception mappers, but I ran across an odd case.  We work as 
> a proxy to other systems, so if we get back a poorly formed response, we have 
> an exception mapper for JAXBUnmarshalException.  The problem is, if somebody 
> sends in (to us) a poorly formatted request, it also hits our mapper (as it's 
> the same exception.)  In this case, we would like the responses to be 
> different.  If the user sends in poorly formatted XML for example, we would 
> return a 400 response.  If we get a bad response from the call we make to the 
> upstream system, then we return a 502 response.  If I put this exception 
> mapper in place, we get all 502s.  Is there a way to differentiate?  Is this 
> a case where I shouldn't deal with the mapper and simply catch this exception 
> from the upstream system and throw a 502?  Thanks in advance!
> -Tom
>
> --
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Wrong build order?

2014-04-07 Thread Bill Burke
Thanks, i'll fix it tomorrow when I do a 3.0.8 release.

On 4/7/2014 9:32 PM, John D. Ament wrote:
> Hi
>
> Just noticed that in master right now, the code can't compile.  There's
> a new  resteasy-hibernatevalidator-provider module that depends on the
> resteasy-cdi module, however the resteasy-cdi module doesn't come until
> much later in the build.
>
> Likewise, Resteasy CDI doesn't compile because of:
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
> (default-compile) on project resteasy-cdi: Compilation failure:
> Compilation failure:
> [ERROR]
> /c:/resteasy/Resteasy/jaxrs/resteasy-cdi/src/main/java/org/jboss/resteasy/cdi/JaxrsInjectionTarget.java:[16,41]
> cannot find symbol
> [ERROR] symbol:   class GeneralValidatorCDI
> [ERROR] location: package org.jboss.resteasy.spi.validation
> [ERROR]
> /c:/resteasy/Resteasy/jaxrs/resteasy-cdi/src/main/java/org/jboss/resteasy/cdi/JaxrsInjectionTarget.java:[31,12]
> cannot find symbol
> [ERROR] symbol:   class GeneralValidatorCDI
> [ERROR] location: class org.jboss.resteasy.cdi.JaxrsInjectionTarget
> [ERROR]
> /c:/resteasy/Resteasy/jaxrs/resteasy-cdi/src/main/java/org/jboss/resteasy/cdi/JaxrsInjectionTarget.java:[39,23]
> cannot find symbol
> [ERROR] symbol:   class GeneralValidatorCDI
> [ERROR] location: class org.jboss.resteasy.cdi.JaxrsInjectionTarget
> [ERROR]
> /c:/resteasy/Resteasy/jaxrs/resteasy-cdi/src/main/java/org/jboss/resteasy/cdi/JaxrsInjectionTarget.java:[39,90]
> cannot find symbol
> [ERROR] symbol:   class GeneralValidatorCDI
> [ERROR] location: class org.jboss.resteasy.cdi.JaxrsInjectionTarget
> [ERROR]
> /c:/resteasy/Resteasy/jaxrs/resteasy-cdi/src/main/java/org/jboss/resteasy/cdi/JaxrsInjectionTarget.java:[42,57]
> cannot find symbol
> [ERROR] symbol:   class GeneralValidatorCDI
> [ERROR] location: class org.jboss.resteasy.cdi.JaxrsInjectionTarget
>
> Was this on purpose?
>
> John
>
>
> --
> Put Bad Developers to Shame
> Dominate Development with Jenkins Continuous Integration
> Continuously Automate Build, Test & Deployment
> Start a new project now. Try Jenkins in the cloud.
> http://p.sf.net/sfu/13600_Cloudbees
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Is there a way to prevent a @PathParam from being uri encoded?

2014-04-07 Thread Bill Burke
No, there's no workaround at the moment.  If you are able to upgrade to 
latest/greatest of Resteasy, I could add something in the 3.0.8 release 
that is tomorrow.

On 4/7/2014 7:32 PM, Scott Stark wrote:
>
> I have a client interface with a method like:
>
> public interface INSP {
> @PUT
> @Path("/{domain}/subscriptions/{endpoint}{resourcePath}")
> @Produces("application/json")
> public String subscribeEndpointResource(@PathParam("domain") String 
> domain,
>  @PathParam("endpoint") String endpoint,
>  @PathParam("resourcePath") String resourcePath);
> }
>
> A call like:
>
> nsp.subscribeEndpointResource("domain", "mbed-ethernet-1DE41", 
> "/303/0/5700");
>
> results in a request with the resourcePath component of the request URI being 
> encoded:
>
> 16:14:55,173 INFO  [org.jboss.devnation.iotbof.ejbs.NSPConnector] (default 
> task-11) mbed-ethernet-1DE41(/303/0/5700)=32.12, observable=true
>
> 16:14:55,174 INFO  [stdout] (default task-11) +++ Request(PUT) to: 
> http://red-hat-summit.cloudapp.net:8080/domain/subscriptions/mbed-ethernet-1DE41%2F303%2F0%2F5700
> 16:14:55,174 INFO  [stdout] (default task-11) --- Headers:
> 16:14:55,174 INFO  [stdout] (default task-11) Accept: application/json
> 16:14:55,174 INFO  [stdout] (default task-11) Authorization: Basic 
> YWRtaW46c2VjcmV0
> 16:14:55,174 INFO  [stdout] (default task-11) Accept-Encoding: gzip, 
> deflate
> 16:14:55,174 INFO  [stdout] (default task-11) --- End Headers:
> 16:14:55,175 INFO  [stdout] (default task-11) null
> 16:14:55,175 INFO  [stdout] (default task-11) --- End Body:
> 16:14:55,209 INFO  [stdout] (default task-11) +++ Response from: 
> http://red-hat-summit.cloudapp.net:8080/domain/subscriptions/mbed-ethernet-1DE41%2F303%2F0%2F5700,
>  status=Method Not Allowed
> 16:14:55,209 INFO  [stdout] (default task-11) --- Headers:
> 16:14:55,209 INFO  [stdout] (default task-11) Content-Type: 
> application/octet-stream
> 16:14:55,210 INFO  [stdout] (default task-11) Content-Length: 62
> 16:14:55,210 INFO  [stdout] (default task-11) Server: NSP/1.11.0-2
> 16:14:55,210 INFO  [stdout] (default task-11) --- End Headers:
> 16:14:55,210 WARN  [org.jboss.devnation.iotbof.ejbs.NSPConnector] (default 
> task-11) Failed to load mbed-ethernet-1DE41/303/0/5700 resource
> : javax.ws.rs.NotAllowedException: HTTP 405 Method Not Allowed
>   at 
> org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.handleErrorStatus(ClientInvocation.java:183)
>  [resteasy-client-3.0.6.Final.jar:]
>   at 
> org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:154)
>  [resteasy-client-3.0.6.Final.jar:]
>   at 
> org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:58)
>  [resteasy-client-3.0.6.Final.jar:]
>   at 
> org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:104)
>  [resteasy-client-3.0.6.Final.jar:]
>   at 
> org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:62)
>  [resteasy-client-3.0.6.Final.jar:]
>   at com.sun.proxy.$Proxy71.subscribeEndpointResource(Unknown Source)
>   at 
> org.jboss.devnation.iotbof.ejbs.NSPConnector.reload(NSPConnector.java:179) 
> [iotbof-ejb.jar:]
>
>
> The server is barfing on this because it is not uri decoding its incoming 
> request uris. I don't have any control over it, so is there a way to prevent 
> the resourcePath from being encoded?
>
> Its easy enough to work around by coding my own subscribeEndpointResource 
> utility method using the rest easy client classes, but it would be nice to 
> simply be able to use the generated
> web target proxy.
>
> --
> Put Bad Developers to Shame
> Dominate Development with Jenkins Continuous Integration
> Continuously Automate Build, Test & Deployment
> Start a new project now. Try Jenkins in the cloud.
> http://p.sf.net/sfu/13600_Cloudbees
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] multiple resource locator for same uri

2014-04-06 Thread Bill Burke
Resteasy cannot dispatch based on header, but I don't recommend a custom 
header anyways.  The best practice solution is to use URIs i.e. 
/v1.0/api and have your client driven by links.  You should also make 
your apis and media types backward compatible.  Its just good practice 
no matter what type of API, REST, Java, or whatever you're doing.

A custom header can often be removed by proxies.  For CORS requests, you 
also have to write custom code to handle custom headers on the server-side.


On 4/6/2014 8:06 AM, Aleš Bregar wrote:
> Hi,
>
> was going through docs on version 2.3.x but couldn't find appropriate
> answer on may issue.
>
> I would like to produce versioned api where uri does not change. The
> idea is to intercept resource locating before auto match happen and
> decide which method to invoke based on some custom header (eq.
> Api.Version=x).
>
> I have found that this can also be achieved by using Accept header
> (where version info may be stated) but I am not truly convinced due I
> would like to produce plain application/json.
>
> Or if my idea with custom header presented above is ok, how the scenario
> may be produced by using resteasy.
> PreProcess interceptor seems not right as it intercepts after regex
> match to method happen.
>
> Thank you in advance
>
>
>
>
>
> --
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] @OPTIONS / allowing cross-site scripting

2014-04-02 Thread Bill Burke
In 3.0.7 I implemented a CORS filter:

https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/interceptors/CorsFilter.java


On 4/2/2014 3:03 AM, Rajshekhar AndalaPisharam wrote:
> Andrew
>
> The best option is to make an exception mapper for
> DefaultOptionsMethodException and add the CORS headers within the
> toResponse method of the mapper. For example:
>
> @Provider
> public class OptionsMethodExceptionMapper implements
> ExceptionMapper{
>
>  @Override
>  public Response toResponse(DefaultOptionsMethodException exception) {
>
> Response.ResponseBuilder builder =Response.ok();
> //..here add CORS to headers of the builder
> return  builder.build();
>  }
>
>
> By doing this all your resources will have OPTIONS response with CORS
> headers.
>
> Thanks
>
> A.P. Rajshekhar
> 
> From: "andrew simpson" 
> To: resteasy-users@lists.sourceforge.net
> Sent: Tuesday, April 1, 2014 11:28:45 AM
> Subject: [Resteasy-users] @OPTIONS / allowing cross-site scripting
>
> I've hit a well-known problem with cross site scripting; I'd like to
> develop javascript locally, but using REST services hosted remotely
>
> http://stackoverflow.com/questions/14589031/ajax-request-with-jax-rs-resteasy-implementing-cors
>
> I've tried a number of ways of implementing an OPTIONS method that
> allows clients from other origins to collect, but none of them seem to
> work.  I've tried curl to confirm with curl, but don't see the
> access-control-* headers returned; my suspicion is that the @path
> directives are somehow not matching my request.
>
> Does anyone have a pointer to an example which works with a recent
> version of RestEasy (I'm using 3.0.6 and JBoss AS 7.1.1)
>
> Thanks..
>
> Andrew
>
>
> --
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] RestEasy 3.0.7 and Netty 4

2014-04-01 Thread Bill Burke
I added a chunked output stream in 3.0.7.  I guess the stream has bugs. 
  I guess I have to do a 3.0.8 release :)

On 4/1/2014 2:51 PM, John D. Ament wrote:
> Hmmm, so this is your output right?
>
> the data length you're describing is in bytes as well, right?
>
> I know I previously had this working in 3.0.6, could you check if your
> code works in 3.0.6?
>
>
> On Tue, Apr 1, 2014 at 2:40 PM, Cédric Chéneau  <mailto:cedric.chen...@gmail.com>> wrote:
>
> Hello,
>
> Just tried to upgrade to RestEasy 3.0.7 on my Netty 4 server, I'm
> facing problem writing json data with length over 1000.
>
> After debugging, there seems to be an infinite loop in method
> ChunkOutputStream.write(...)
>
> In fact, my json data size is over the maximum length defined in
> NettyHttpResponse constructor:
>
> os = new ChunkOutputStream(this, ctx, 1000);
>
> Perhaps I'm missing something.
>
> Best regards,
>
> Cdr35
>
>
>
>
> 
> --
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
>
>
> --
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Resteasy 3.0.7 released

2014-04-01 Thread Bill Burke
Youll have to upgrade Apache Client to 4.2.1 or higher too.

On 3/31/2014 10:48 PM, Ming Hsieh wrote:
> Hi All
>
> Just downloaded 3.0.7, followed the instructions in
> examples/oauth2-as7-example, updated modules, properties, configurations
> and standalone.xml tried to deploy.
>
> auth-server.war and database.war deployed ok.
> deployment failed at "customer-portal.war":
> 09:58:15,925 INFO  [org.jboss.as.server.deployment] (MSC service thread
> 1-4) JBA
> S015876: Starting deployment of "customer-portal.war"
> 09:58:16,008 ERROR [org.apache.catalina.core.StandardContext] (MSC
> service threa
> d 1-2) Context [/customer-portal] startup failed due to previous errors:
> java.la <http://java.la>
> ng.NoClassDefFoundError:
> org/apache/http/impl/conn/PoolingClientConnectionManage
> r
>  at
> org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.initDefaultEngi
> ne(ResteasyClientBuilder.java:428) [resteasy-client-3.0.7.Final.jar:]
>  at
> org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.build(ResteasyC
> lientBuilder.java:333) [resteasy-client-3.0.7.Final.jar:]
>  at
> org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.init(OA
> uthManagedResourceValve.java:115) [skeleton-key-as7-3.0.7.Final.jar:]
>  at
> org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.lifecyc
> leEvent(OAuthManagedResourceValve.java:66)
> [skeleton-key-as7-3.0.7.Final.jar:]
>  at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
> eSupport.java:115) [jbossweb-7.0.13.Final.jar:]
>  at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3
> 845) [jbossweb-7.0.13.Final.jar:]
>  at
> org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentS
> ervice.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
>  at
> org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se
> rviceControllerImpl.java:1811)
>  at
> org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont
> rollerImpl.java:1746)
>  at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
> java:1145) [rt.jar:1.7.0_25]
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> .java:615) [rt.jar:1.7.0_25]
>  at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
>
> I am Using jboss 7.1.1.Final, resteasy 3.0.7.Final and jdk 1.7.0_25.
>
> Digged into the documentation for httpcomponents
> https://hc.apache.org/httpcomponents-client-4.3.x/httpclient/apidocs/org/apache/http/impl/conn/PoolingClientConnectionManager.html
> it seems like PoolingClientConnectionManager is only available in
> version 4.2.
> jboss as 7.1.1.Final only includes httpcomponents version 4.1.2.
> Updated the httpcomponents in jboss (module.xml):
> 
>  
>  
>  
>
>  
>  
>  
>  
>  
>  
>
>  
>  
>      
>  
>  
>  
> 
>
> After that deployment success. So maybe the updated modules should be
> included resteasy download.
>
> For anybody that is interested in oauth2.
>
> Regards,
>
> Ming
>
>
>
> On Mon, Mar 31, 2014 at 11:30 PM, Bill Burke  <mailto:bbu...@redhat.com>> wrote:
>
> Ron fixed a few bugs in validation.  Netty improvements.  A few other
> bug fixes here and there.
>
> As usual, follow links from jboss.org/resteasy
> <http://jboss.org/resteasy> to download and view
> documentation and release notes.
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
> 
> --
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
>
>
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] Resteasy 3.0.7 released

2014-03-31 Thread Bill Burke
Ron fixed a few bugs in validation.  Netty improvements.  A few other 
bug fixes here and there.

As usual, follow links from jboss.org/resteasy to download and view 
documentation and release notes.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Client failover/loadbalancing

2014-03-26 Thread Bill Burke
We don't do it right now.  Maybe something like this?

ResteasyClient client = ...;

FailoverTarget target = client.failoverTarget()
   .addBase("http://localhost:8080";)
   .addBase("http://localhost:8081";)
   .addBase("http://localhost:8082";);

Then from Failovertarget you could do anything that a WebTarget could do.

Sound like a good API?  Feel like working on it? :)


On 3/26/2014 5:21 AM, Borut Bolčina wrote:
> Hello,
>
> is failover client support somewhere in the pipeline?
>
> Like http://cxf.apache.org/docs/jax-rs-failover.html
>
> How do you guys do it now?
>
> Regards,
> borut
>
>
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] ResteasyWebTarget target proxy fails

2014-03-10 Thread Bill Burke
t;
> 
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
>  > ___
>  > Resteasy-users mailing list
>  > Resteasy-users@lists.sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>
>  > https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
>
>
> --
>
> Ordercloud <http://www.ordercloud.co.za>Integrated Order Fulfillment SaaS
>
> Wessel Pieterse  | Co-Founder & Software Engineer
> +27 82 786 8336 | wes...@ordercloud.co.za
> <mailto:wes...@ordercloud.co.za>  | Twitter
> <http://twitter.com/pieterse_wessel> Linkedin
> <http://za.linkedin.com/in/wesselpieterse/> Skype <http://jimfromsa>
>
> Office: +27 21 808 9495  | www.ordercloud.co.za
> <http://www.ordercloud.co.za>
> Launch Lab, Admin A, Ryneveldt Street, Stellenbosch
>
>
>
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Maintaining cookies for stateful webservices

2014-03-09 Thread Bill Burke
I don't remember if cookie caching is on by default.  Resteasy client is 
based on Apache Http Client and you can definitely turn on cookie 
caching there.  I should probably add some high level Resteasy switch 
for this too.


On 3/9/2014 8:22 PM, John D. Ament wrote:
> Hi all,
>
> Assuming that I'm using the RESTeasy JAX-RS 2.0 client APIs with proxy
> support, is there a way to maintain cookies between requests?  Or is
> there a way to read cookies from the response and pass in as request
> params?
>
> John
>
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Can JAX-RS support an extension-method?

2014-02-28 Thread Bill Burke
: "8477KSHIU88",
>"locations": {
>   "location": [
>   {
>  "name": "dir1",
>  "value": "/dirs/dir1/1.2.3.txt"
>   },
>   {
>  "name": "dir2",
>  "value": "/dirs/dir2/1.2.3.txt"
>   }
>   ]
>}
> }
> }
>
> This output might be the same as a call to GET /file/{file_id}
>
> Am I getting the general idea?
>
> J
>
> ---
>
> From: Burke
>
> If you have a representation for the action, then it becomes a resource
> that you could possibly link to and retrieve. It becomes even more
> important to represent the action as a URL as you can then link to the
> action:
>
> {
> "car" : "honda",
> links : {
>"assemble" : "/cars/honda/assemble"
> }
> }
>
> The client then never has to know the URL scheme, only the data format.
>
> ---
>
> From: Coder
>
> Understood. It adds no value to extend a concept if some implementations
> can't make use of it.
>
> I struggle with the concept of putting the action in the URL because I
> have a hard time opening my mind to the idea of 'an action is a
> resource'. Hard for me to let go of the 'R' in URL in other words.
>
> If this is the defacto approach however, it makes sense to give client
> developers what they expect so it remains consistent and intuitive.
>
> Much thanks for your time, Bill. The advice is appreciated.
>
> J
>
> ---
>
> From: Burke
>
> I don't suggest that approach. Instead, put the action in the URL.
>
> i.e.
>
> POST /cars/honda/assemble
> Content-Type: application/work-order+json
>
> Some clients or servers and/or their APIs might have issues dealing with
> non-standard HTTP methods. Plus HTTP methods have well defined semantics
> that client developers will expect to be followed. i.e. PUT/GET/DELETE
> is supposed to be idempotent.
>
> ---
>
> From: Coder
>
> Wonderful! Thank you very much, this is exactly what I was hoping for. I
> was incorrectly assuming that the method had to be annotated with one of
> the pre-defined values. I am not sold, in general, on the idea of either
> treating resources as actions or as passing actions in as parameters, so
> this gives a very nice option. I suppose it should have occurred to me
> that I could just create a new annotation...
>
> Thanks,
>
> J
>
> ---
>
> From: Burke
>
> By extension-method you mean something like PATCH? Yes, JAX-RS supports
> that
>
> @HttpMethod("PATCH")
> public @interface PATCH{}
>
> ---
>
> From: Coder
>
> Can this be done?
>
> Similar to how WebDAV has PROPFIND, MOVE and COPY in addition to the
> standard GET, POST, DELETE and such.
>
> If so, a pointer to an example would be much appreciated.
>
>
>
>
> - Original Message -
> From: J Coder 
> To: resteasy-users@lists.sourceforge.net
> Sent: Tuesday, January 28, 2014 09:48 AM
> Subject: [Resteasy-users] Can JAX-RS support an extension-method?
>
> Can this be done?
>
> Similar to how WebDAV has PROPFIND, MOVE and COPY in addition to the
> standard GET, POST, DELETE and such.
>
> If so, a pointer to an example would be much appreciated.
>
>
>
>
>
> --
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] aligning rest-easy version in maven, local server, openshift

2014-02-22 Thread Bill Burke
You have to patch the servers in question unfortunately.

On 2/22/2014 5:48 AM, andrew simpson wrote:
>
> I've been using resteasy within my development environment, setting the
> version in my maven pom.xml file, updating the version there (currently
> on 3.0.4)
>
> I then test on a local JBoss version, jboss-as-7.1.1.Final, and until
> recently assumed I would be using the same resteasy version there, but
> apparently not.
>
> I also use a JBoss AS server at openshift to host this publicly.  I
> assume the same discrepancy applies there.
>
> Is there any way, via my Maven pom.xml file, that I can set and force
> the version to be consistent, across all three environments, or does
> updating the version on the servers require manual update of the class
> libraries?
>
> Thanks...
>
>
>
> <mailto:resteasy-users@lists.sourceforge.net>
>
>
> --
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Using Netty, RestEasy and Weld

2014-02-21 Thread Bill Burke
I'm also disappointed that it is nearly impossible to figure out to 
fully removed components from AS7/Wildfly.  But it is possible to fine 
tune its memory footprint by disabling subsystems you are not using. 
Not sure how far you can go with that though.  But "rolling your own app 
server" also requires you to write your own management too.

On 2/20/2014 9:10 PM, John D. Ament wrote:
> It's actually a lot more lightweight.  The minimum I can run the
> equivalent on AS7 on is ~ 180 mb in binaries, but throwing this
> together is about 32 mb (and compresses further when its packaged).
> I'm able to start the JVM on the bare minimum (~100mb on my linux VM)
> but AS7 with all I need is about 756mb.  When rolling out in the
> cloud, where all of my REST APIs are stateless, running with this
> configuration helps us get a lot more per node.
>
> There's still a little more I want to get working before I turn this
> into a PR, such as dynamic identification of providers.
>
> Thanks for the feedback, Bill.
>
> - John
>
> On Thu, Feb 20, 2014 at 8:58 PM, Bill Burke  wrote:
>> Great stuff, but still don't understand why you guys want to roll your own
>> app server.  Let me take a look.  You submitting a PR?
>>
>>
>> On 2/20/2014 8:49 PM, John D. Ament wrote:
>>>
>>> All,
>>>
>>> So, I finally put together the starts of making this more integrated
>>> with RestEasy.
>>>
>>> See the branch here:
>>> https://github.com/johnament/Resteasy/compare/RESTEASY-NETTY
>>>
>>> Basically, create a simple main program that starts up Netty and does
>>> a RestEasy Deployment, with Weld SE running.  Let me know your
>>> thoughts on the approach, I can add some docs about how to bring it up
>>> and obviously more tests.
>>>
>>> One thing I noticed is that it looks like master is now running CDI
>>> 1.1 API.  If this is the case, I think some more clean up should
>>> happen in the extension and injector factory.
>>>
>>> - John
>>>
>>> On Mon, Jan 20, 2014 at 7:55 PM, John D. Ament 
>>> wrote:
>>>>
>>>> Bill,
>>>>
>>>> Definitely.  I already sent you one on the CdiInjectorFactory bug I
>>>> saw in Netty.  ( https://issues.jboss.org/browse/RESTEASY-1009 )
>>>>
>>>> Another thing to think about is how to get an external
>>>> RequestDispatcher.  Right now, you have a lot of duplicate code in
>>>> Netty3 and Netty4 modules (it also looks like the netty4 module is
>>>> new).  Perhaps starting off with a Netty Base project and having each
>>>> extend from there would help?  The easiest way to handle
>>>> RequestDispatcher is to have a setter, if it's not set use the
>>>> default, otherwise use the provided one.
>>>>
>>>> - John
>>>>
>>>> On Mon, Jan 20, 2014 at 5:10 PM, Bill Burke  wrote:
>>>>>
>>>>> We would of course appreciate any PRs that could come out of this
>>>>> effort.
>>>>>
>>>>> On 1/19/2014 9:58 AM, John D. Ament wrote:
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> In case anyone's interested, I just put out a blog post on how you can
>>>>>> use RestEasy and the Netty Embedded Server with Weld.
>>>>>>
>>>>>>
>>>>>> http://john-ament.blogspot.com/2014/01/bridging-netty-resteasy-and-weld.html
>>>>>>
>>>>>> and if you'd like to see the code:
>>>>>> https://github.com/johnament/resteasy-netty-cdi
>>>>>>
>>>>>> Please do let me know your thoughts.
>>>>>>
>>>>>> - John
>>>>>>
>>>>>>
>>>>>> --
>>>>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>>>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>>>>> Critical Workloads, Development Environments & Everything In Between.
>>>>>> Get a Quote or Start a Free Trial Today.
>>>>>>
>>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>>>>> ___
>>>>>> Resteasy-users mailing list
>>>>>> Resteasy-users@lists.sourceforge.net
>>>>&

Re: [Resteasy-users] Using Netty, RestEasy and Weld

2014-02-20 Thread Bill Burke
Great stuff, but still don't understand why you guys want to roll your 
own app server.  Let me take a look.  You submitting a PR?

On 2/20/2014 8:49 PM, John D. Ament wrote:
> All,
>
> So, I finally put together the starts of making this more integrated
> with RestEasy.
>
> See the branch here:
> https://github.com/johnament/Resteasy/compare/RESTEASY-NETTY
>
> Basically, create a simple main program that starts up Netty and does
> a RestEasy Deployment, with Weld SE running.  Let me know your
> thoughts on the approach, I can add some docs about how to bring it up
> and obviously more tests.
>
> One thing I noticed is that it looks like master is now running CDI
> 1.1 API.  If this is the case, I think some more clean up should
> happen in the extension and injector factory.
>
> - John
>
> On Mon, Jan 20, 2014 at 7:55 PM, John D. Ament  wrote:
>> Bill,
>>
>> Definitely.  I already sent you one on the CdiInjectorFactory bug I
>> saw in Netty.  ( https://issues.jboss.org/browse/RESTEASY-1009 )
>>
>> Another thing to think about is how to get an external
>> RequestDispatcher.  Right now, you have a lot of duplicate code in
>> Netty3 and Netty4 modules (it also looks like the netty4 module is
>> new).  Perhaps starting off with a Netty Base project and having each
>> extend from there would help?  The easiest way to handle
>> RequestDispatcher is to have a setter, if it's not set use the
>> default, otherwise use the provided one.
>>
>> - John
>>
>> On Mon, Jan 20, 2014 at 5:10 PM, Bill Burke  wrote:
>>> We would of course appreciate any PRs that could come out of this effort.
>>>
>>> On 1/19/2014 9:58 AM, John D. Ament wrote:
>>>> Hi all,
>>>>
>>>> In case anyone's interested, I just put out a blog post on how you can
>>>> use RestEasy and the Netty Embedded Server with Weld.
>>>>
>>>> http://john-ament.blogspot.com/2014/01/bridging-netty-resteasy-and-weld.html
>>>>
>>>> and if you'd like to see the code:
>>>> https://github.com/johnament/resteasy-netty-cdi
>>>>
>>>> Please do let me know your thoughts.
>>>>
>>>> - John
>>>>
>>>> --
>>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>>> Critical Workloads, Development Environments & Everything In Between.
>>>> Get a Quote or Start a Free Trial Today.
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>>> ___
>>>> Resteasy-users mailing list
>>>> Resteasy-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>>>
>>>
>>> --
>>> Bill Burke
>>> JBoss, a division of Red Hat
>>> http://bill.burkecentral.com
>>>
>>> --
>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>> Critical Workloads, Development Environments & Everything In Between.
>>> Get a Quote or Start a Free Trial Today.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>> ___
>>> Resteasy-users mailing list
>>> Resteasy-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Resteasy + Netty 4

2014-02-19 Thread Bill Burke
Docs suck sorry.  You could look at our testsuite example:

https://github.com/resteasy/Resteasy/tree/master/jaxrs/server-adapters/resteasy-netty4/src/test/java/org/jboss/resteasy/test

On 2/19/2014 6:09 PM, Ari King wrote:
> Hi,
>
> I'm interested in trying out Resteasy with Netty 4. I've looked at the
> Resteasy docs
> <https://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html/RESTEasy_Embedded_Container.html#d4e1408>,
> and while helpful was hoping for a fuller example. Does anyone know of
> any such examples?
>
> Thanks.
>
> -Ari
>
>
> --
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Proper way to handle uploading files via RestEasy/Netty

2014-02-18 Thread Bill Burke
Maybe?  :)

On 2/18/2014 11:56 AM, John D. Ament wrote:
> Hmmm.  So if I want to get an inputstream (because the object is
> actually something like a word doc), can I just plugin inputstream for
> MyClass?
>
> On Tue, Feb 18, 2014 at 9:49 AM, Bill Burke  wrote:
>> Upload via a browser?
>>
>> Server side:
>>
>>   @POST
>>   @Consumes(MediaType.MULTIPART_FORM_DATA)
>>   public Response uploadRealm(MultipartFormDataInput input) throws
>> IOException  {
>>   Map> uploadForm = input.getFormDataMap();
>>   List inputParts = uploadForm.get("file");
>>
>>   for (InputPart inputPart : inputParts) {
>>   inputPart.setMediaType(MediaType.APPLICATION_JSON_TYPE);
>>   MyClass rep = inputPart.getBody(new GenericType(){});
>>   }
>>   return Response.noContent().build();
>>   }
>>
>>
>> On 2/16/2014 1:17 PM, John D. Ament wrote:
>>> Hi all,
>>>
>>> Just wondering if there are any pointers to how to best handle a file
>>> upload via RestEasy's NettyJaxrsServer?  When I was doing it via an
>>> app server, it was easy because there was an HTTP request.  Would
>>> injecting @Context HttpServletRequest still work here?  I'm inclined
>>> to think not but would be curious of other opinions.
>>>
>>> John
>>>
>>> --
>>> Android apps run on BlackBerry 10
>>> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
>>> Now with support for Jelly Bean, Bluetooth, Mapview and more.
>>> Get your Android app in front of a whole new audience.  Start now.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
>>> ___
>>> Resteasy-users mailing list
>>> Resteasy-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>>
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com
>>
>> --
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>> ___
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Proper way to handle uploading files via RestEasy/Netty

2014-02-18 Thread Bill Burke
Upload via a browser?

Server side:

 @POST
 @Consumes(MediaType.MULTIPART_FORM_DATA)
 public Response uploadRealm(MultipartFormDataInput input) throws 
IOException  {
 Map> uploadForm = input.getFormDataMap();
 List inputParts = uploadForm.get("file");

 for (InputPart inputPart : inputParts) {
 inputPart.setMediaType(MediaType.APPLICATION_JSON_TYPE);
 MyClass rep = inputPart.getBody(new GenericType(){});
 }
 return Response.noContent().build();
 }


On 2/16/2014 1:17 PM, John D. Ament wrote:
> Hi all,
>
> Just wondering if there are any pointers to how to best handle a file
> upload via RestEasy's NettyJaxrsServer?  When I was doing it via an
> app server, it was easy because there was an HTTP request.  Would
> injecting @Context HttpServletRequest still work here?  I'm inclined
> to think not but would be curious of other opinions.
>
> John
>
> --
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Scan vs Spring

2014-02-11 Thread Bill Burke
I wish we could get a Resteasy contributor who was a heavy user of 
Spring to sort these types of issues out.

On 2/11/2014 3:14 AM, Jean-François HEROUARD wrote:
> Mixing auto-scan may lead to misunderstanding for maintenance of code. I
> agree scan should be possible, as long as you do not mix Spring features
> with Resteasy, especially bean lifecycle. Usually I inject business
> beans in resteasy WS using Spring IoC, @Autowired or @Inject annotations
> are ignored if REST URL handlers are not seen by Spring listener. Using
> more features of Spring will have some strange side effects if remote
> calls are not in a Spring context. After some tests and long time of
> debugging trying to understand why Spring is not fully usable (I
> remember a case where @Autowired was working but not some EL in @Value),
> I only configure Resteasy "Spring MVC integration" in the main app, and
> "Spring Integration" in Resteasy for test. For simple REST WS, I have
> another war, without any Spring dependency.
>
>
> 2014-02-06 20:41 GMT+01:00 Anthony Whitford  <mailto:anth...@whitford.com>>:
>
> I have a project that is using RestEasy -- there were 23 resources.
> The project was using "resteasy.scan.resources=true" in the web.xml.
>
> Now, I added another resource.  This time, we need Spring.
> So, I add the resteasy-spring dependency and update the web.xml,
> according to the docs:
>
> 
> http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html/RESTEasy_Spring_Integration.html
>
> Now, the boot fails because the "scan" can't coexist with Spring.
>   No problem, I can remove the scan  But then my original 23
> resources are not available.
>
> According to the documentation...
>
>> "RESTEasy will automatically scan for @Provider and JAX-RS
>> resource annotations on your bean class and register them as
>> JAS-RS resources."
>
> It would seem that I need to make the 23 resources Spring beans (Add
> a @Named annotation, for example), or else manually list them in my
> web.xml ("resteasy.resources"), or create an Application instance to
> register them...
>
> Ugh...  Why can't the RestEasy-Spring bootstrap automatically
> register the resources annotated with @Path?
>
> Or...  Why can't the SCAN coexist with Spring again?
>
>
>
> 
> --
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> 
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
>
>
> --
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Scan vs Spring

2014-02-07 Thread Bill Burke
Doesn't Spring have a scan facility?  Use that.

On 2/6/2014 2:41 PM, Anthony Whitford wrote:
> I have a project that is using RestEasy -- there were 23 resources.
> The project was using "resteasy.scan.resources=true" in the web.xml.
>
> Now, I added another resource.  This time, we need Spring.
> So, I add the resteasy-spring dependency and update the web.xml,
> according to the docs:
>
> http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html/RESTEasy_Spring_Integration.html
>
> Now, the boot fails because the "scan" can't coexist with Spring.  No
> problem, I can remove the scan  But then my original 23 resources
> are not available.
>
> According to the documentation...
>
>> "RESTEasy will automatically scan for @Provider and JAX-RS resource
>> annotations on your bean class and register them as JAS-RS resources."
>
> It would seem that I need to make the 23 resources Spring beans (Add a
> @Named annotation, for example), or else manually list them in my
> web.xml ("resteasy.resources"), or create an Application instance to
> register them...
>
> Ugh...  Why can't the RestEasy-Spring bootstrap automatically register
> the resources annotated with @Path?
>
> Or...  Why can't the SCAN coexist with Spring again?
>
>
>
>
> --
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Error marshaling w/ XmlAnyElement + Element Adapter - simple JBoss 7 + RESTEasy project

2014-02-03 Thread Bill Burke
You'll have to point out what resteasy version you are using so I can 
match the line numbers in you stack trace up.

On 2/3/2014 8:48 AM, Johnson, Shawn [USA] wrote:
> Hi All,
> First post, long-time lurker.  I have posted this same question to
> StackOverflow and not had any bites yet.  I've broken the issue down to
> the bare essentials – but I'm fairly clueless about where to go next.  I
> have posted the code here:
> https://bitbucket.org/johnson_shawn/stackoverflow-21471310 – Basically
> I'm trying to take a label/value object list and marshal it to
> Value Goes
> Here.  In a larger project with a crazy class path, it
> runs fine from the main.  When run through JBoss+RESTEasy I get the
> following (partial) stack:
>
> INFO [stdout]
> org.jboss.resteasy.plugins.providers.jaxb.JAXBMarshalException:
> javax.xml.bind.MarshalException 21:02:19,959
> INFO [stdout] - with linked exception: 21:02:19,959
> INFO [stdout] [com.sun.istack.SAXException2 21:02:19,959
> INFO [stdout] java.lang.NullPointerException] 21:02:19,959
> INFO [stdout] at
> org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.writeTo(AbstractJAXBProvider.java:148)
> 21:02:19,960
> INFO [stdout] at
> org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:117)
> 21:02:19,960
>
> More info here:
> http://stackoverflow.com/questions/21471310/error-when-more-than-one-item-to-list-of-objects-using-jaxbs-xmlanyelement-and
>
> Any ideas for debugging further or other brilliant answers will be
> greatly appreciated!
>
>
> --
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
>
>
>
> _______
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Fwd: Running JAX-RS 2.0 O'Reilly book samples on Tomcat..

2014-02-01 Thread Bill Burke
Tomcat 8 should support ServletContainerInitializer.  Please read the 
3.5 documentation you linked.  It works with Jetty, so I don't know why 
it wouldn't work with Tomcat.

On 2/1/2014 5:33 AM, Kapil Gambhir wrote:
> I am using Tomcat 8.x which is a servlet 3.1 container, so the
> expectation was that the example application should not require web.xml
> (as per the documentation on
> http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html_single/#d4e111).
> The document seems to suggest that this is required for pre 3.0 servlet
> containers.
>
> My bigger concern is that the app Path(i.e @ApplicationPath("/services")
> ) annotation in the ShoppingApplication class (which is extending the
> Application class) is ignored. So this path seems to be ignored totally
> and the URL for Customer is (/ex03_1/customers)
> <http://127.0.0.1:8080/ex03_1/customers> there is no "services" in this
> URL. Does that mean that this annotation is not useful.
>
> Kapil.
> <http://127.0.0.1:8080/ex03_1/customers>
>
> -- Forwarded message --
> From: *Weinan Li* mailto:l.wei...@gmail.com>>
> Date: Thu, Jan 16, 2014 at 5:31 PM
> Subject: Re: [Resteasy-users] Running JAX-RS 2.0 O'Reilly book samples
> on Tomcat..
> To: Kapil Gambhir mailto:kapil.gamb...@gmail.com>>
> Cc: resteasy-users@lists.sourceforge.net
> <mailto:resteasy-users@lists.sourceforge.net>
>
>
>
>
> --
> Weinan Li
>
>
> On Thursday, January 16, 2014 at 7:00 PM, Kapil Gambhir wrote:
>
>  > Hi,
>  > thanks for a prompt response, am using the JAX-RS v2, so the
> "oreilly-jaxrs-2.0-workbook/ex03_1”.
>  > I am able to run the example with the web.xml (http://web.xml)
> changes suggested by you, it made sense also but am wondering how the
> default example (shipped as a zip) worked on jetty (which is also a
> servlet container only, pretty much like Tomcat). The examples download
> has the Maven scripts which execute the test client using the Jetty and
> that works fine without the web.xml (http://web.xml) changes. Any idea
> on this one?
>  > my objective is to use a lightweight container to keep things simple
> and fast.
>
>
> I haven’t looked into details of Jetty, but the reason could only be
> that Jetty supports JAX-RS2.0 spec out of box.
>  >
>  >
>  > On Thu, Jan 16, 2014 at 11:20 AM, Weinan Li  <mailto:l.wei...@gmail.com> (mailto:l.wei...@gmail.com
> <mailto:l.wei...@gmail.com>)> wrote:
>  > > Hi Kapil,
>  > >
>  > > Are you using "oreilly-jaxrs-2.0-workbook/ex03_1” or
> "oreilly-workbook/ex03_1”? The former one can only be deployed in a
> JavaEE application server that supports JAX-RS 2.0 spec like WildFly,
> because it doesn’t have standalone settings in web.xml (http://web.xml).
> Please add following settings you web.xml (http://web.xml) if you want
> to deploy it in tomcat:
>  > >
>  > > 
>  > > Resteasy
>  > > 
>  > > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
>  > > 
>  > > 
>  > > javax.ws.rs.Application
>  > > 
>  > > com.restfully.shop.services.ShoppingApplication
>  > > 
>  > > 
>  > > 
>  > >
>  > > 
>  > > Resteasy
>  > > /*
>  > > 
>  > >
>  > >
>  > >
>  > > In addition, if ex03_1.war is deployed into tomcat correctly you
> should see the following log in catalina.out:
>  > >
>  > > resteasy.spi.ResteasyDeployment. Deploying
> javax.ws.rs.core.Application: class
> com.restfully.shop.services.ShoppingApplication
>  > > 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2]
> org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource
> com.restfully.shop.services.CustomerResource from Application class
> com.restfully.shop.services.ShoppingApplication
>  > >
>  > >
>  > > And then you can access it by http://127.0.0.1:8080/ex03_1/customers
>  > >
>  > > --
>  > > Weinan Li
>  > >
>  > >
>  > > On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote:
>  > >
>  > > > am trying to run the samples from the O'Reilly book (by Bill
> Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication
> deploys fine but when i try to POST a customer resource to
> /services/customers it gives me 404.
>  > > > I built the war from the Maven for Chapter 3 example (ex03_1) and
> deployed that war on Tomcat and the deployment (Tomcat startup console)
> shows messages of ShoppingApplication being deployed. 

Re: [Resteasy-users] jaxrs client proxies

2014-01-29 Thread Bill Burke
JAX_RS does not "merge" annotations between interfaces and classes. 
Either the jaxrs annotations are on the interface, or they are on the class.

On 1/29/2014 3:19 PM, Kristoffer Sjögren wrote:
> Hi
>
> Im trying to create a jaxrs client proxy from an interface that looks
> roughly like this.
>
> public interface SimpleService {
> @GET
> @Path("basic")
> @Produces("text/plain")
> String getBasic();
> }
>
> There is a service side implementation which is registered using the
> Application.getSingletons().
>
> @Path("/simple")
> public class SimpleJaxrs implements SimpleService {
> String getBasic() { ... }
> }
>
> The problem is that @Path method annotations on the interface is not
> inherited to the implementation so method endpoints are never registered.
>
> 1) I don't want to put a @Path annotation on the interface because that
> is the address to find an implementation. Its an interface so I want to
> have any number of implementations, right?
>
> 2) I do want to have @Path annotations on interface methods because its
> part of the interface contract. Having @Path annotations on the
> implementation is redundant because it already implements the interface.
>
> Does this make sense? Is it possible to do?
>
> Cheers,
> -Kristoffer
>
>
>
> --
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] RestEasy client in a multi-threaded invironment

2014-01-29 Thread Bill Burke
Yeah, docs fell through the cracks on that:

org.jboss.resteasy.util.BasicAuthHelper

org.jboss.resteasy.client.jaxrs.BasicAuthentication

You can use the filter if the same user is invoking in separate threads. 
  Otherwise you'll have to generate the header per request.

On 1/29/2014 1:17 PM, Gunnar Morling wrote:
> Basic Auth; Do you have a pointer to these filters/utilities? That
> sounds like what I need. Is there an example or test somewhere (couldn't
> find that in the ref guide)?
>
> Thanks,
>
> --Gunnar
>
>
>
>
>
> 2014/1/29 Bill Burke mailto:bbu...@redhat.com>>
>
> pre-emptive for what protocol?  Digest?  For basic auth, resteasy
> has a filter or utility methods you can use instead.
>
>
> On 1/29/2014 12:36 PM, Gunnar Morling wrote:
>
> I'm invoking an authenticated endpoint and am using HttpContext
> to pass
> in an AuthCache instance which is needed to enable pre-emptive
> authentication.
>
> Is there any alternative way for setting credentials and have them
> pre-emptively sent which doesn't require to touch HttpClient
> specifics?
>
> --Gunnar
>
>
>
> 2014/1/29 Bill Burke  <mailto:bbu...@redhat.com> <mailto:bbu...@redhat.com
> <mailto:bbu...@redhat.com>>>
>
>
>  What is the HttpContext used for anyways?  Never used it.  For
>  multithreaded access, I've wrote and used the extension
> methods to
>  ResteasyClientBuilder to configure connection pools and such.
>
>  I honestly am trying to hide Apache HTTP Client with
> Resteasy (and in
>  the future JAX-RS) apis.
>
>  On 1/29/2014 12:14 PM, Gunnar Morling wrote:
>   > Hi,
>   >
>   > I'm working with a RestEasy client (proxy) which should
> be accessible
>   > from several threads in parallel.
>   >
>   >  From the reference guide [1] I learned that I need to
> configure a
>   > custom ApacheHttpClient4Engine instance so it uses a
> thread-safe HTTP
>   > client connection manager. This works as expected but
> there is a
>   > constructor of ApacheHttpClient4Engine which takes a
> HttpContext and
>   > made me curious.
>   >
>   > HttpContext is not intended for multi-threaded access (see
>  comments on
>   > BasicHttpContext and SyncBasicHttpContext), but
>  ApacheHttpClient4Engine
>   > does not perform any sort of synchronization. Is there
> any way of
>   > passing a new context instance per request issued by the
> engine?
>   >
>   > Thanks,
>   >
>   > --Gunnar
>   >
>   > [1]
>   >
> 
> http://docs.jboss.org/__resteasy/docs/3.0.6.Final/__userguide/html_single/#__transport_layer
> 
> <http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html_single/#transport_layer>
>   >
>   >
>   >
>   >
>
> 
> --__--__--
>   > WatchGuard Dimension instantly turns raw network data
> into actionable
>   > security intelligence. It gives you real-time visual
> feedback on key
>   > security issues and trends.  Skip the complicated setup
> - simply
>  import
>   > a virtual appliance and go from zero to informed in seconds.
>   >
> 
> http://pubads.g.doubleclick.__net/gampad/clk?id=123612991&__iu=/4140/ostg.clktrk
> 
> <http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk>
>   >
>   >
>   >
>   > _
>   > Resteasy-users mailing list
>   > Resteasy-users@lists.__sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>
>  <mailto:Resteasy-users@lists.__sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>>
>
>   >
> https://lists.sourceforge.net/__lists/listinfo/resteasy-users
> <https://lists.sourceforge.net/lists/

Re: [Resteasy-users] RestEasy client in a multi-threaded invironment

2014-01-29 Thread Bill Burke
pre-emptive for what protocol?  Digest?  For basic auth, resteasy has a 
filter or utility methods you can use instead.

On 1/29/2014 12:36 PM, Gunnar Morling wrote:
> I'm invoking an authenticated endpoint and am using HttpContext to pass
> in an AuthCache instance which is needed to enable pre-emptive
> authentication.
>
> Is there any alternative way for setting credentials and have them
> pre-emptively sent which doesn't require to touch HttpClient specifics?
>
> --Gunnar
>
>
>
> 2014/1/29 Bill Burke mailto:bbu...@redhat.com>>
>
> What is the HttpContext used for anyways?  Never used it.  For
> multithreaded access, I've wrote and used the extension methods to
> ResteasyClientBuilder to configure connection pools and such.
>
> I honestly am trying to hide Apache HTTP Client with Resteasy (and in
> the future JAX-RS) apis.
>
> On 1/29/2014 12:14 PM, Gunnar Morling wrote:
>  > Hi,
>  >
>  > I'm working with a RestEasy client (proxy) which should be accessible
>  > from several threads in parallel.
>  >
>  >  From the reference guide [1] I learned that I need to configure a
>  > custom ApacheHttpClient4Engine instance so it uses a thread-safe HTTP
>  > client connection manager. This works as expected but there is a
>  > constructor of ApacheHttpClient4Engine which takes a HttpContext and
>  > made me curious.
>  >
>  > HttpContext is not intended for multi-threaded access (see
> comments on
>  > BasicHttpContext and SyncBasicHttpContext), but
> ApacheHttpClient4Engine
>  > does not perform any sort of synchronization. Is there any way of
>  > passing a new context instance per request issued by the engine?
>  >
>  > Thanks,
>  >
>  > --Gunnar
>  >
>  > [1]
>  >
> 
> http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html_single/#transport_layer
>  >
>  >
>  >
>  >
> 
> --
>  > WatchGuard Dimension instantly turns raw network data into actionable
>  > security intelligence. It gives you real-time visual feedback on key
>  > security issues and trends.  Skip the complicated setup - simply
> import
>  > a virtual appliance and go from zero to informed in seconds.
>  >
> 
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
>  >
>  >
>  >
>  > ___
>  > Resteasy-users mailing list
>  > Resteasy-users@lists.sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>
>  > https://lists.sourceforge.net/lists/listinfo/resteasy-users
>  >
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
> 
> --
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> 
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] RestEasy client in a multi-threaded invironment

2014-01-29 Thread Bill Burke
What is the HttpContext used for anyways?  Never used it.  For 
multithreaded access, I've wrote and used the extension methods to 
ResteasyClientBuilder to configure connection pools and such.

I honestly am trying to hide Apache HTTP Client with Resteasy (and in 
the future JAX-RS) apis.

On 1/29/2014 12:14 PM, Gunnar Morling wrote:
> Hi,
>
> I'm working with a RestEasy client (proxy) which should be accessible
> from several threads in parallel.
>
>  From the reference guide [1] I learned that I need to configure a
> custom ApacheHttpClient4Engine instance so it uses a thread-safe HTTP
> client connection manager. This works as expected but there is a
> constructor of ApacheHttpClient4Engine which takes a HttpContext and
> made me curious.
>
> HttpContext is not intended for multi-threaded access (see comments on
> BasicHttpContext and SyncBasicHttpContext), but ApacheHttpClient4Engine
> does not perform any sort of synchronization. Is there any way of
> passing a new context instance per request issued by the engine?
>
> Thanks,
>
> --Gunnar
>
> [1]
> http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html_single/#transport_layer
>
>
>
> --
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Oauth2 with RestEasy behind an AWS Load Balancer

2014-01-27 Thread Bill Burke
Right now, once the HTTP session is authenticated, the token is not used 
to check timeouts.  It relies on the application's HTTP Session settings 
to handle timeout.  Not sure if that is the right approach or not.

BTW, check out keycloak.org.  We've taken this stuff to the next level.

On 1/26/2014 3:24 PM, james truty wrote:
> Hi Weinan,
>
> The AWS load balancer sends an X-Forwarded-Proto header to the Jboss
> server in the backed, which Jboss is able to use if I add this valve and
> option to my jboss-web.xml:
>  
>  org.apache.catalina.valves.RemoteIpValve
>  
>  protocolHeader
>  x-forwarded-proto
>  
>  
> This allows Jboss to handle the original https request, and Resteasy to
> proceed with proper authorization. Thanks for the help! The only issue I
> see now is that the Bearer token that I get back by using client
> credentials and BASIC auth does not expire when I set it to - even if I
> set it to 1 minute in the RestEasy settings. It is still allowed after
> it should have timed out. Is there another way that I should be setting
> or enforcing the token timeout?
>
> Thanks,
> James
>
>
> On Sat, Jan 25, 2014 at 6:07 AM, Weinan Li  <mailto:l.wei...@gmail.com>> wrote:
>
> Hi James,
>
> Sorry I’m not familiar with AWS load balancer. I know that mod_jk
> supports to pass client SSL information to backend JBoss server and
> the application in JBoss server could use the information to do
> their work. And mod_jk is using standard AJPv13 protocol to forward
> the client SSL information to backend JBoss servers. If AWS load
> balancer supports AJPv13 protocol, it should also be able to pass
> the SSL information to JBoss.
>
> --
> Weinan Li
>
>
> On Saturday, January 25, 2014 at 6:55 AM, james truty wrote:
>
>  > I am trying to use RestEasy in Jboss as a central auth server to
> authenticate REST calls behind an AWS load balancer. Ideally, this
> load balancer would communicate to the Jboss server over HTTP (not
> https) as the SSL part is handled at the load balancer level before
> hitting the auth server in the backend. In this case, the Jboss
> server has no knowledge of the SSL Cert or the HTTPS request. Is it
> possible to use RestEasy for auth in this scenario? Without the SSL
> connector configured through JBoss, I don't have access to the
> necessary OAUTH urls.
>  >
>  > Thanks,
>  > James
>  >
> 
> --
>  > CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>  > Learn Why More Businesses Are Choosing CenturyLink Cloud For
>  > Critical Workloads, Development Environments & Everything In Between.
>  > Get a Quote or Start a Free Trial Today.
>  >
> 
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>  >
>  > ___
>  > Resteasy-users mailing list
>  > Resteasy-users@lists.sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>
> (mailto:Resteasy-users@lists.sourceforge.net
> <mailto:Resteasy-users@lists.sourceforge.net>)
>  > https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
>
>
>
>
> --
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] Keycloak SSO Alpha 1 Released

2014-01-23 Thread Bill Burke
Keycloak is an SSO auth server and appliance for web applications and 
RESTful web services.  It can act as a Social Broker for Social Login 
via Google, Twitter, and Facebook.  It has a nice admin console UI for 
managing a variety of security metadata and much much more...

Please view my blog for more details on features, videos, downloads, and 
documentation:

http://bill.burkecentral.com/2014/01/23/keycloak-sso-released-alpha-1/

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] generating oauth1.0a from rs client

2014-01-23 Thread Bill Burke
Have you checked this out?

http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html/Authentication.html#d4e1730

I've never used it, but it may help.

On 1/23/2014 8:39 AM, andrew simpson wrote:
>
> I'd like to test rest services which implement oauth1.0a.
>
> What's the best way to generate the CLIENT oauth1.0a headers necessary
> to do this?
>
> I've seen how to manually construct a client request with oauth headers
> (https://github.com/ams10961/siwtjsf) but am not sure whether I can
> manipulate all the headers correctly when making the client calls from a
> rs client in an arquillian test...
>
> Has anyone managed to do this, or are there rs clients that will
> generate the oauth headers that I could use from an arquillian test?
>
> Thanks..
>
> Andrew
>
> https://github.com/ams10961/siwtjsf
>
> import javax.ws.rs.client.Client;
> import javax.ws.rs.client.ClientBuilder;
> import javax.ws.rs.client.Entity;
> import javax.ws.rs.client.WebTarget;
> import javax.ws.rs.core.MediaType;
> import javax.ws.rs.core.Response;
>
>
>
> --
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Using Netty, RestEasy and Weld

2014-01-20 Thread Bill Burke
We would of course appreciate any PRs that could come out of this effort.

On 1/19/2014 9:58 AM, John D. Ament wrote:
> Hi all,
>
> In case anyone's interested, I just put out a blog post on how you can
> use RestEasy and the Netty Embedded Server with Weld.
>
> http://john-ament.blogspot.com/2014/01/bridging-netty-resteasy-and-weld.html
>
> and if you'd like to see the code:
> https://github.com/johnament/resteasy-netty-cdi
>
> Please do let me know your thoughts.
>
> - John
>
> --
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Running JAX-RS 2.0 O'Reilly book samples on Tomcat..

2014-01-16 Thread Bill Burke
The examples use Jetty.  Its probably just a context path issue.

On 1/16/2014 12:50 AM, Weinan Li wrote:
> Hi Kapil,
>
> Are you using "oreilly-jaxrs-2.0-workbook/ex03_1” or 
> "oreilly-workbook/ex03_1”? The former one can only be deployed in a JavaEE 
> application server that supports JAX-RS 2.0 spec like WildFly, because it 
> doesn’t have standalone settings in web.xml. Please add following settings 
> you web.xml if you want to deploy it in tomcat:
>
> 
> Resteasy
> 
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
> 
> 
> javax.ws.rs.Application
> 
> com.restfully.shop.services.ShoppingApplication
> 
> 
> 
>
> 
> Resteasy
> /*
> 
>
>
>
> In addition, if ex03_1.war is deployed into tomcat correctly you should see 
> the following log in catalina.out:
>
> resteasy.spi.ResteasyDeployment. Deploying javax.ws.rs.core.Application: 
> class com.restfully.shop.services.ShoppingApplication
> 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] 
> org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource 
> com.restfully.shop.services.CustomerResource from Application class 
> com.restfully.shop.services.ShoppingApplication
>
>
> And then you can access it by http://127.0.0.1:8080/ex03_1/customers
>
> --
> Weinan Li
>
>
> On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote:
>
>> am trying to run the samples from the O'Reilly book (by Bill Burke) on 
>> Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine 
>> but when i try to POST a customer resource to /services/customers it gives 
>> me 404.
>> I built the war from the Maven for Chapter 3 example (ex03_1) and deployed 
>> that war on Tomcat and the deployment (Tomcat startup console) shows 
>> messages of ShoppingApplication being deployed. What am i missing, dont see 
>> any error message or any clue around what could be going wrong.
>>
>> Thanks in anticipation,
>> Kapil.
>> --
>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>> Critical Workloads, Development Environments & Everything In Between.
>> Get a Quote or Start a Free Trial Today.
>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>
>> ___
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net 
>> (mailto:Resteasy-users@lists.sourceforge.net)
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
>
>
> --
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Set up authorization on methods based on roles

2014-01-09 Thread Bill Burke
> "resteasy.role.based.security" if we use EJBs, and that is my case.
> However, I didn't found any example or description about what to do in
> that case.
>
>
> --
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] 3.0.6 released

2013-12-11 Thread Bill Burke
Resteasy 3.0.6.Final has been released today.  This is a maintenance 
release.  Netty 4 JAX-RS 2.0 Async APIs actually work now!  As usual, 
check out http://jboss.org/resteasy for how to download the distro and 
view documentation.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Right time to use @Encoded?

2013-12-11 Thread Bill Burke
Not sure you understand what @Encoded does.  It just means you want the 
RAW parameter.  For example  "/Hello World" must be encoded as 
"/Hello%20World"

So, if you had "/{text}"

@PathParam("text") String decoded,
@Encoded @PathParam("text") String encoded

decoded = "Hello World"
encoded = "Hello%20World"

If you are worried about XSS, then you should probably:

a) Not have REST services that output application/javascript
b) Implement CORS in your app.

On 12/10/2013 6:48 AM, John D. Ament wrote:
> Hi all,
>
> Wanted to get your opinions.  What is the right time to use @Encoded?
>   Purely from a security scan standpoint, a number of places in my
> coded were picked up for XSS, and I'm wondering if annotating these
> endpoints with @Encoded would help.
>
> John
>
> --
> Sponsored by Intel(R) XDK
> Develop, test and display web and hybrid apps with a single code base.
> Download it for free now!
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Premature response commiting

2013-12-02 Thread Bill Burke
There's really not anything you can do about this at the Resteasy/JAX-RS 
level.  Buffering responses can also be VERY BAD for performance so 
Resteasy (and really JAX-RS) writes directly to the network output 
stream when marshalling via Jackson.

Depending on what servlet container you are using, you may be able to 
configure it to buffer responses so that if an exception is thrown in 
serialization the response can be reset.

On 11/30/2013 12:52 PM, Przemyslaw Wesolek wrote:
> Hello,
>
> I'm exposing my application via RESTEasy 3.0.5Final with Jackson JSON
> provider. The serialization is still being written, so sometimes bugs
> creep out. Most often it is some exception being thrown by the Jackson
> serializer.
>
> However, at the moment it happens, the response is already commited,
> status code set to 200 and partial response is being written to the
> output. This is Very Bad Thing, as from the client perspective the 200
> status code means everything went OK, but the JSON is broken.
>
> For example, if the Jackson can't serialize field "abc", the resulting
> JSON looks like:
>
>> {
>>// some fields serialized correctly by Jackson, like:
>>"ok_field": 1,
>>// ...
>>// and then the erronous one, the name without a value:
>>"abc"}
>
>
> This is because of the setStatus() call being in ServerResponseWriter in
> line 70:
>
>>response.setStatus(jaxrsResponse.getStatus());
>
> while the serialization (and an exception throw) being in line 99:
>
>>writerContext.proceed();
>
> Is there any way I can defer committing anything in the response until
> the whole response body is prepared?
>
> Regards,
> Przemek
>
>
> --
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] @FormParam attributes not filled in @PUT method

2013-11-27 Thread Bill Burke
Are you sure this is a problem with Resteasy?  Your link references Jersey.

On 11/27/2013 11:04 AM, Charif Mauricio Nadir wrote:
> Hi people I want to send @FormParams using a PUT method. But the mapped
> attributes are never filled. I read here [1] that FormsParams only work
> with POST method, can you confirm that?
> Thanks in advance.
>
> Mauricio Ch.
>
> [1]
> http://stackoverflow.com/questions/5964122/jax-rs-with-jersey-passing-form-parameters-to-put-method-for-updating-a-resourc
>
>
> --
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] How to setup RESTEasy with CDI and Netty?

2013-11-26 Thread Bill Burke
Submit a pull request, i'll take a look

On 11/26/2013 7:05 PM, John D. Ament wrote:
> Bill,
>
> Actually from looking at the current impl, I have a fairly small
> trivial change.  It would only work in CDI 1.1 though.  I could
> probably implement it using reflection to avoid the compilation
> change, if you're interested in taking the contribution.  This would
> use standard CDI look up in an SE environment.
>
> John
>
> On Tue, Nov 26, 2013 at 6:06 PM, Bill Burke  wrote:
>>
>>
>> On 11/26/2013 4:17 PM, Christian Helmbold wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>>> John D. Ament  schrieb am 20:23 Dienstag,
>>>> 26.November 2013:
>>>>>
>>>>> I assumed this would happen, based on Bill's email.
>>>
>>>
>>> You're right. This happend after adding the following line to my startup
>>> code:
>>>
>>>
>>> deployment.setInjectorFactoryClass(org.jboss.resteasy.cdi.CdiInjectorFactory.class.getName());
>>>
>>>> you'll probably
>>>> need to extend the CdiInjectorFactory to use your own BeanManager.
>>>
>>>
>>> I wonder why
>>> http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034
>>> seems to be so simple.
>>>
>>> Sounds like Weld and RESTEasy are simply not built for what I want to do!
>>> The philosophie seems to be: use the whole application server or use
>>> something else. My idea was to create a small configuration which could be
>>> restarted very fast during development. I've done something similar with
>>> Guice and Jersey. But Wildfly should start pretty fast, so this could be
>>> better than trying to do the configuration myself.
>>>
>>
>> I would dive into this, but I don' thave the cycles at this time.  Its just
>> a matter of gettin Weld initialized in a SE environment, and then tweaking
>> the CdiInjectorFactory.
>>
>>
>> There is a Resteasy Guice adapter too.
>>
>>
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] How to setup RESTEasy with CDI and Netty?

2013-11-26 Thread Bill Burke


On 11/26/2013 4:17 PM, Christian Helmbold wrote:
>
>
>
>
>
>> John D. Ament  schrieb am 20:23 Dienstag, 
>> 26.November 2013:
>>> I assumed this would happen, based on Bill's email.
>
> You're right. This happend after adding the following line to my startup code:
>
> deployment.setInjectorFactoryClass(org.jboss.resteasy.cdi.CdiInjectorFactory.class.getName());
>
>> you'll probably
>> need to extend the CdiInjectorFactory to use your own BeanManager.
>
> I wonder why 
> http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034
>  seems to be so simple.
>
> Sounds like Weld and RESTEasy are simply not built for what I want to do! The 
> philosophie seems to be: use the whole application server or use something 
> else. My idea was to create a small configuration which could be restarted 
> very fast during development. I've done something similar with Guice and 
> Jersey. But Wildfly should start pretty fast, so this could be better than 
> trying to do the configuration myself.
>

I would dive into this, but I don' thave the cycles at this time.  Its 
just a matter of gettin Weld initialized in a SE environment, and then 
tweaking the CdiInjectorFactory.


There is a Resteasy Guice adapter too.


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Replacing ProxyFactory with RestEasyWebTarget does not work

2013-11-26 Thread Bill Burke
This does not work?

LicenseList list = response.readEntity(LicenseList.class);

You could also try this:

LicenseList list = response.readEntity(new 
GenericType>() {}).getValue();

javax.ws.rs.core.GenericType

On 11/26/2013 4:00 PM, Gabriella Turek wrote:
> No, I've tried that, it does not work. I get the following error:
>
> java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast to
> nz.org.riskscape.license.rest.domain.LicenseList
>  at
> nz.org.riskscape.license.rest.RiskScapeLicenseServiceTest.testGetExpiredLic
> enses(RiskScapeLicenseServiceTest.java:102)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:5
> 7)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
> l.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:606)
>
>
> --
> Dr Gabriella Turek
> Sr. Software Engineer, Systems Development Team
> NIWA Auckland, New Zealand
> Tel: +64 9 3754645
> www.niwa.co.nz
> NIWA - Enhancing the benefit of New Zealand¹s natural resources.
>
>
>> Date: Tue, 26 Nov 2013 15:51:56 -0500
>> From: Bill Burke 
>> Subject: Re: [Resteasy-users] Replacing ProxyFactory with
>>RestEasyWebTarget does not work
>> To: resteasy-users@lists.sourceforge.net
>> Message-ID: <529509ec.3000...@redhat.com>
>> Content-Type: text/plain; charset=windows-1252; format=flowed
>>
>> This is a Resteasy Client -> JAX-RS 2.0 mismatch migration problem.
>>
>> Replace:
>>
>> response.getEntity()
>>
>> with:
>>
>> response.readEntity(String.class);
>>
>> replace String.class to whatever class you want to marshal to.
>> getEntity() returns null if you haven't unmarshalled anything with
>> readEntity().
>>
>>
>>
>> On 11/26/2013 2:59 PM, Gabriella Turek wrote:
>>> After upgrading from Resteasy 2.4 to 3.0.5, none of my client calls work
>>> anymore. The entity which I am expecting (as simple as a String) is
>>> always null. In debug mode I can see it being set in the Response object
>>> on the server side, but on the client side the entity in the Response is
>>> null.
>>> Here is an example call:
>>>
>>> The interface:
>>>
>>> |   /**
>>>  * @return all expired licenses
>>>  */
>>> @GET
>>> @ClientResponseType(entityType=  LicenseList.class)
>>> @Path("/expired")
>>> @Produces(MediaType.APPLICATION_XML)
>>> public  Response  getExpiredLicenses();|
>>>
>>> The implementation:
>>>
>>> |   /**
>>>  * @return all expired licenses
>>>  */
>>> @Override
>>> public  Response  getExpiredLicenses()  {
>>>   try  {
>>> LicenseList  list=  LicensesDBUtil.getExpiredLicenses();
>>> Response  resp=  Response.ok().entity(list).build();
>>> return  resp;
>>>   }  catch  (SQLException  e)  {
>>> LOG.error("Error getting expired licenses :"  +  e.getMessage());
>>> return
>>> Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type
>>> (MediaType.TEXT_PLAIN).build();
>>>   }|
>>>
>>> The test call :
>>>
>>> |   @Test
>>> public  void  testGetExpiredLicenses()  throws  Exception  {
>>>   ResteasyClientBuilder  rsb=  new  ResteasyClientBuilder();
>>>   ResteasyClient  rsc=  rsb.build();
>>>   ResteasyWebTarget  target=  rsc.target(BASEURL);
>>>   return  target.proxy(RiskScapeLicenseService.class);
>>>   Response  response=  client.getExpiredLicenses();
>>>   assertTrue(HttpResponseCodes.SC_OK==  response.getStatus());
>>>   @SuppressWarnings("unchecked")
>>>   JAXBElement  element=  (JAXBElement)
>>> response.getEntity();
>>>   LicenseList  list=  element.getValue();
>>>   assertEquals(4,  list.getLicenses().size());
>>>   for  (License  lic:  list.getLicenses())  {
>>> assertTrue((new
>>> Date()).after(DateUtils.parseDate(lic.getValidTo(),  new  String[]  {
>>> "-MM-dd"  })));
>>>   }
>>> }|
>>>
>>> My web.xml file:
>>>
>>> |
>>> http://www.w3.org/2001/XMLSchema-instance";
>>> xmlns="http://java.sun.com/xml/ns/javaee&quo

Re: [Resteasy-users] Replacing ProxyFactory with RestEasyWebTarget does not work

2013-11-26 Thread Bill Burke
s.
> --
> Please consider the environment before printing this email.
> NIWA is the trading name of the National Institute of Water &
> Atmospheric Research Ltd.
>
>
> --
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] How to setup RESTEasy with CDI and Netty?

2013-11-25 Thread Bill Burke
I've never tried using CDI in Java SE.  Really depend on the 
implementation of CDI I suppose.  You'd have to manually set up CDI, 
then set the 
deployment.setInjectorFactoryClass(org.jboss.resteasy.cdi.CdiInjectoryFactory.class.getName());

Also, our impl only works with Weld.

On 11/25/2013 3:49 PM, Christian Helmbold wrote:
> Hi!
>
>
> How can I setup RESTEasy (3.0.5) with CDI and Netty in a Java SE environment?
>
> Simply putting the resteasy-cdi module on the class path doesn't work (as 
> suggested in 
> http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034).
>
> Here is my startup class:
>
> @Singleton
> public class App {
>
>public void printHello(
>@Observes ContainerInitialized event, @Parameters List 
> parameters)
>throws Exception {
>  NettyJaxrsServer netty = new NettyJaxrsServer();
>  netty.setDeployment(new ResteasyDeployment());
>  netty.setPort(8000);
>  netty.setRootResourcePath("");
>  netty.setSecurityDomain(null);
>  netty.start();
>}
> }
>
> I have a root resource in my example project which should be discovered by 
> weld automatically. But if I load the resource I get:
> javax.ws.rs.NotFoundException: Could not find resource for full path: 
> http://localhost:8000/
>
> I'm using the following libs:
>
>
> What do I have to do to setup RESTEasy with CDI and Netty (or Undertow would 
> be fine too)?
>
>
> --
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] generating HREFs

2013-11-19 Thread Bill Burke
UriInfo.getBaseUri()
UriInfo.getBaseUriBuilder()



On 11/19/2013 2:47 AM, andrew simpson wrote:
> Does anyone have any guidance about generating hrefs including the
> server address with RestEasy
> I'd like to generate someting like:
> href: 'http://api.domain.com/objects/12345'
> but infer 'api.domain.com <http://api.domain.com>' rather than hard-code
> it..
> Thanks..
> Andrew
>
>
> --
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] My new book: RESTFul Java with JAX-RS 2.0

2013-11-12 Thread Bill Burke
http://bill.burkecentral.com/2013/11/12/my-new-book-restful-java-with-jax-rs-2-0/


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Status of "templating" support in RESTEasy

2013-11-07 Thread Bill Burke
We've been using Freemarker + Resteasy in one of the projects I'm 
working on, but not sure the level of integration you could do with it. 
  Right now we just generate a string using Freemarker and send that in 
the JAX-RS response.

On 11/7/2013 1:12 PM, Paul K Moore wrote:
> Hi all,
>
> First post here, so please feel free to redirect if appropriate.
>
> I’m in the process of moving from Glassfish to WildFly (following
> Oracle’s recent announcement!) and am trying to understand the level of
> support for templating engines.
>
> I found SeamRest <http://www.seamframework.org/Seam3/RESTModuleHome>,
> which looked interesting, but apparently development of SeamRest has
> been halted.  It wasn’t obvious whether this was a recent event, but the
> GitHub repo indicates a degree of staleness (2 years).
>
> The SeamFramework <http://www.seamframework.org/> home page indicates
> that (whilst many projects are moving to DeltaSpike) SeamRest is / will
> be integrated with RESTEasy.
>
> The RESTEasy documentation is somewhat silent on the issue of
> “templating”, and certainly there’s no mention of Velocity / Freemarker etc.
>
> I’ve also had a cursory look through the RESTEasy Jira, but couldn’t
> find anything that looked like a placeholder for the migration effort
> from Seam.
>
> So, I’m confused!  Where should I be looking for templating support in
> the WildFly ecosystem?  If it’s aspirational for RESTEasy, are there any
> current plans / timelines?  Is there somewhere else I should be looking?
>
> Thanks in advance
>
> Paul
>
>
> --
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
>
>
>
> _______
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] How do I find out which version of JAXRS a version of RestEasy supports?

2013-10-31 Thread Bill Burke
Resteasy 3.0 or greater, JAX-RS 2.0.  Earlier JAX-RS 1.1.

On 10/31/2013 11:28 AM, Mike Miller wrote:
> For example, we are running RestEasy 2.3.5 – so how can I tell which
> version of JAX-RS that supports?   Where do I look?
>
>
>
> --
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Announcing Arquillian REST extension.

2013-10-28 Thread Bill Burke
Have you seen our proxy extension? (This exists in 2.3.x too)

http://docs.jboss.org/resteasy/docs/3.0.4.Final/userguide/html/RESTEasy_Client_Framework.html#d4e2101

I guess I just don't understand what problem you are trying to solve 
with this extension.



On 10/28/2013 5:56 PM, Jakub Narloch wrote:
> Hi RESTEasy users,
>
> We would like to inform you that the JBoss Arquillian universe just
> extended with completly new extension that was designed to ease the
> testing of JAX-RS based web services:
> http://arquillian.org/blog/2013/10/28/arquillian-extension-rest-1-0-0-Alpha1/
>
> One of of it's unique features is the integration with Arquillian Warp
> that does allow to intercept the state of the service running and verify
> it in a test that is being executed in the application container.
>
> We were hoping that you could give a try and give us as much feedback as
> possible. We also welcome any contributions to the newly developed
> extension.
>
> Thanks,
> Jakub Narloch
>
>
> --
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] CORS support needed?

2013-10-28 Thread Bill Burke
Not really hard to add yourself:

Read this:

http://www.html5rocks.com/en/tutorials/cors/

What we could add to resteasy is a filter that takes a list of allowed 
origins and handles preflight and simple requests.  But, it would be 
really simple to add it yourself.

On 10/28/2013 11:01 AM, Mike Miller wrote:
> We are using RestEasy 2.3.5.
>
> I read thru a couple threads on the mailing list and trying to figure
> out if we need CORS support for our usage.   Just looking for some
> verification or validation.
>
> We are exposing  a lot of our services thru resteasy and the expectation
> is that our resources will be called from mobile applications using Ajax
> to call the services.   We support calls for GET, PUT, POST and DELETE
> consuming and producing both json and xml.  Testing from the Chrome
> Advanced Rest Client works great but once we start trying to make jQuery
> (or other Javascript) AJAX calls from web pages, we run into problems.
> We can start Chrome with the “—disable-web-security” command line
> parameter but I know that’s not real solution.To correctly support
> these remote ajax calls do we need to provide some type of CORS support?
>
>
>
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Sloppy Pull Requests == Broken Builds

2013-10-24 Thread Bill Burke
There may be permgen/memory issues with the CI build too.  I thought I 
had cleaned this up a few weeks ago by upgrading the 
maven-compiler-plugin, but this seems to have regressed and builds are 
requiring gigabytes of ram to pass.  I haven't had time to track this 
down yet.

On 10/24/2013 4:52 AM, Matthias Wessendorf wrote:
> did a rebase and the new build now failed here:
>
> Failed tests:   
> testConnectionCleanupErrorNoGC(org.jboss.resteasy.test.client.ApacheHttpClient4Test):
>  expected:<30> but was:<20>
>
>
>
>
> https://travis-ci.org/matzew/Resteasy/builds/12973751
>
>
> -M
>
>
> On Thu, Oct 24, 2013 at 10:25 AM, Anthony Whitford  <mailto:anth...@whitford.com>> wrote:
>
> /Thumbs up!/
>
> The particular build problem (unable to download dependency) is
> resolved now as the invalid repository declaration has been fixed.
>
> Note that the pom.xml files don't mention a SNAPSHOT version, so
> running a build the way things are right now, every time it rebuilds
> version 3.0.5.Final...
> (Doesn't sound so /final/, does it?)  If 3.0.5 has been finalized,
> shouldn't the version be 3.0.6-SNAPSHOT now?
>
>
>
>
> On Oct 23, 2013, at 12:03 AM, Matthias Wessendorf  <mailto:mat...@apache.org>> wrote:
>
>> Hi,
>>
>> if you like, here is a PR to enable travis based builds:
>>
>> https://github.com/resteasy/Resteasy/pull/400
>>
>> Pretty simple, as a start - can be improved
>>
>> -M
>>
>>
>> On Wed, Oct 23, 2013 at 2:54 AM, Bill Burke > <mailto:bbu...@redhat.com>> wrote:
>>
>> Two PRs from two different contributors broke the build.
>>  Please do a
>> full build before you commit!  Each person who has broken the
>> build owes
>> me 1 beer per minute I wasted cleaning up after your
>> mess...sloppy,
>> sloppy...
>>
>> I know we should have an integrated GIT/Jenkins CI build, but
>> I just
>> don't have time to set it up or maintain it.  Besides, its
>> more fun to
>> bully people into buying me beers.
>>
>> Bill
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com <http://bill.burkecentral.com/>
>>
>> 
>> --
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application
>> performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more.
>> Get the most from
>> the latest Intel processors and coprocessors. See abstracts
>> and register >
>> 
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
>> ___
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> <mailto:Resteasy-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>
>>
>>
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>> 
>> --
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get
>> the most from
>> the latest Intel processors and coprocessors. See abstracts and
>> register >
>> 
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk___
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> <mailto:Resteasy-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>
>
> --
> October Webinars: Code for Performance
> Fre

Re: [Resteasy-users] Sloppy Pull Requests == Broken Builds

2013-10-24 Thread Bill Burke
I don't see this problem.  This is a Garbage Collector test, so it is 
possible that the CI build machine will have intermittent failures for 
this test.

On 10/24/2013 4:52 AM, Matthias Wessendorf wrote:
> did a rebase and the new build now failed here:
>
> Failed tests:   
> testConnectionCleanupErrorNoGC(org.jboss.resteasy.test.client.ApacheHttpClient4Test):
>  expected:<30> but was:<20>
>
>
>
>
> https://travis-ci.org/matzew/Resteasy/builds/12973751
>
>
> -M
>
>
> On Thu, Oct 24, 2013 at 10:25 AM, Anthony Whitford  <mailto:anth...@whitford.com>> wrote:
>
> /Thumbs up!/
>
> The particular build problem (unable to download dependency) is
> resolved now as the invalid repository declaration has been fixed.
>
> Note that the pom.xml files don't mention a SNAPSHOT version, so
> running a build the way things are right now, every time it rebuilds
> version 3.0.5.Final...
> (Doesn't sound so /final/, does it?)  If 3.0.5 has been finalized,
> shouldn't the version be 3.0.6-SNAPSHOT now?
>
>
>
>
> On Oct 23, 2013, at 12:03 AM, Matthias Wessendorf  <mailto:mat...@apache.org>> wrote:
>
>> Hi,
>>
>> if you like, here is a PR to enable travis based builds:
>>
>> https://github.com/resteasy/Resteasy/pull/400
>>
>> Pretty simple, as a start - can be improved
>>
>> -M
>>
>>
>> On Wed, Oct 23, 2013 at 2:54 AM, Bill Burke > <mailto:bbu...@redhat.com>> wrote:
>>
>> Two PRs from two different contributors broke the build.
>>  Please do a
>> full build before you commit!  Each person who has broken the
>> build owes
>> me 1 beer per minute I wasted cleaning up after your
>> mess...sloppy,
>> sloppy...
>>
>> I know we should have an integrated GIT/Jenkins CI build, but
>> I just
>> don't have time to set it up or maintain it.  Besides, its
>> more fun to
>> bully people into buying me beers.
>>
>> Bill
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com <http://bill.burkecentral.com/>
>>
>> 
>> --
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application
>> performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more.
>> Get the most from
>> the latest Intel processors and coprocessors. See abstracts
>> and register >
>> 
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
>> ___
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> <mailto:Resteasy-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>
>>
>>
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>> 
>> --
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get
>> the most from
>> the latest Intel processors and coprocessors. See abstracts and
>> register >
>> 
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk___
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> <mailto:Resteasy-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>
>
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and mor

Re: [Resteasy-users] Broken Build

2013-10-22 Thread Bill Burke
Maybe a JDK encryption problem?  Do you need to upgrade to full JDK crypto?

On 10/23/2013 12:13 AM, Anthony Whitford wrote:
> I retrieved a fresh Clone and see that the original issue has been
> resolved, but am now running into an issue with the Crypto module:
>
> Failed tests:
> testEncryptedInput(org.jboss.resteasy.test.security.smime.IntegrationTest):
> expected:<204> but was:<500>
>
> testEncryptedSignedInput(org.jboss.resteasy.test.security.smime.IntegrationTest):
> expected:<204> but was:<500>
>
> Tests in error:
>testBody(org.jboss.resteasy.test.security.smime.EnvelopedTest): key
> invalid in message.
>
> testFromPythonGenerated(org.jboss.resteasy.test.security.smime.EnvelopedTest):
> key invalid in message.
>
> testFromPythonGenerated2(org.jboss.resteasy.test.security.smime.EnvelopedTest):
> key invalid in message.
>
> testEncryptedOutput2(org.jboss.resteasy.test.security.smime.IntegrationTest):
> org.bouncycastle.cms.CMSException: key invalid in message.
>
> testEncryptedSignedOutput(org.jboss.resteasy.test.security.smime.IntegrationTest):
> org.bouncycastle.cms.CMSException: key invalid in message.
>
> Tests run: 77, Failures: 2, Errors: 5, Skipped: 0
>
> [INFO]
> 
> [INFO] Reactor Summary:
> [INFO]
> [INFO] RESTEasy JAX-RS ... SUCCESS [1.017s]
> [INFO] Embedded Servlet Container  SUCCESS [6.367s]
> [INFO] JAX-RS Core API ... SUCCESS [3.753s]
> [INFO] RESTEasy JAX-RS Test Data . SUCCESS [2.763s]
> [INFO] RESTEasy JAX-RS Implementation  SUCCESS [56.316s]
> [INFO] RESTEasy JAX-RS Client  SUCCESS [2.279s]
> [INFO] RESTEasy JAX-RS Client/Server Testsuite ... SUCCESS [31.325s]
> [INFO] Resteasy JAXB Provider  SUCCESS [10.398s]
> [INFO] Resteasy Jettison Provider  SUCCESS [5.119s]
> [INFO] Resteasy FastInfoSet Provider . SUCCESS [0.753s]
> [INFO] Test All JAXB providers ... SUCCESS [7.083s]
> [INFO] Resteasy Jackson Provider . SUCCESS [4.071s]
> [INFO] Resteasy Jackson Provider . SUCCESS [4.084s]
> [INFO] Resteasy JSON-P EE7 Provider .. SUCCESS [2.021s]
> [INFO] Test Jackson and JAXB Coexistence . SUCCESS [2.445s]
> [INFO] Resteasy Atom Provider  SUCCESS [3.384s]
> [INFO] Resteasy Multipart Provider ... SUCCESS [6.768s]
> [INFO] Resteasy YAML Provider  SUCCESS [2.169s]
> [INFO] Resteasy HTML Provider  SUCCESS [0.560s]
> [INFO] Resteasy HTML test  SUCCESS [0.462s]
> [INFO] Resteasy Hibernate Validator Provider . SUCCESS [6.223s]
> [INFO] Resteasy Validator Provider BV 1.1  SUCCESS [7.649s]
> [INFO] Resteasy Providers  SUCCESS [0.019s]
> [INFO] RESTEasy Maven Import . SUCCESS [0.021s]
> [INFO] RESTEasy Cache Core ... SUCCESS [7.202s]
> [INFO] RESTEasy Cache  SUCCESS [0.016s]
> [INFO] Resteasy Guice  SUCCESS [2.620s]
> [INFO] RESTEasy Crypto ... FAILURE [14.057s]
> [INFO] RESTEasy JAX-RS OAuth . SKIPPED
>
> Note that my build is running on Mac OS X 10.9, Java 7 Update 45, and
> Maven 3.0.5.
>
>
>
> On Oct 22, 2013, at 5:50 PM, Bill Burke  <mailto:bbu...@redhat.com>> wrote:
>
>> Should be fixed now.  I rolled in your SSLContext fix too.
>>
>> On 10/22/2013 7:25 PM, Bill Burke wrote:
>>> Yes, I know.   Working on it.
>>>
>>> On 10/22/2013 3:01 PM, Anthony Whitford wrote:
>>>> I cloned the latest repository from Github:
>>>>
>>>> But when I try to build it (mvn install), it fails:
>>>>
>>>> Tests in error:
>>>>testParse1(org.jboss.resteasy.test.finegrain.resource.CookieTest): 
>>>> Index:
>>>> 0, Size: 0
>>>>testParse2(org.jboss.resteasy.test.finegrain.resource.CookieTest): 
>>>> Index:
>>>> 0, Size: 0
>>>>
>>>> Tests run: 633, Failures: 0, Errors: 2, Skipped: 2
>>>>
>>>> [INFO]
>>>> 
>>>> [INFO] Reactor Summary:
>>>> [INFO]
>>>>

Re: [Resteasy-users] Broken Build

2013-10-22 Thread Bill Burke
Should be fixed now.  I rolled in your SSLContext fix too.

On 10/22/2013 7:25 PM, Bill Burke wrote:
> Yes, I know.   Working on it.
>
> On 10/22/2013 3:01 PM, Anthony Whitford wrote:
>> I cloned the latest repository from Github:
>>
>> But when I try to build it (mvn install), it fails:
>>
>> Tests in error:
>> testParse1(org.jboss.resteasy.test.finegrain.resource.CookieTest): 
>> Index: 0, Size: 0
>> testParse2(org.jboss.resteasy.test.finegrain.resource.CookieTest): 
>> Index: 0, Size: 0
>>
>> Tests run: 633, Failures: 0, Errors: 2, Skipped: 2
>>
>> [INFO] 
>> 
>> [INFO] Reactor Summary:
>> [INFO]
>> [INFO] RESTEasy JAX-RS ... SUCCESS [0.847s]
>> [INFO] Embedded Servlet Container  SUCCESS [5.664s]
>> [INFO] JAX-RS Core API ... SUCCESS [3.313s]
>> [INFO] RESTEasy JAX-RS Test Data . SUCCESS [3.350s]
>> [INFO] RESTEasy JAX-RS Implementation  FAILURE [46.047s]
>> [INFO] RESTEasy JAX-RS Client  SKIPPED
>>
>> I am trying to run this on a Mac using Maven 3.0.5 and Java 6 Update 65.
>>
>> Is this working for others?
>> Is there some special setup required?
>>
>>
>>
>> --
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
>> the latest Intel processors and coprocessors. See abstracts and register >
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
>> ___
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] Sloppy Pull Requests == Broken Builds

2013-10-22 Thread Bill Burke
Two PRs from two different contributors broke the build.  Please do a 
full build before you commit!  Each person who has broken the build owes 
me 1 beer per minute I wasted cleaning up after your mess...sloppy, 
sloppy...

I know we should have an integrated GIT/Jenkins CI build, but I just 
don't have time to set it up or maintain it.  Besides, its more fun to 
bully people into buying me beers.

Bill

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Broken Build

2013-10-22 Thread Bill Burke
Yes, I know.   Working on it.

On 10/22/2013 3:01 PM, Anthony Whitford wrote:
> I cloned the latest repository from Github:
>
> But when I try to build it (mvn install), it fails:
>
> Tests in error:
>testParse1(org.jboss.resteasy.test.finegrain.resource.CookieTest): Index: 
> 0, Size: 0
>testParse2(org.jboss.resteasy.test.finegrain.resource.CookieTest): Index: 
> 0, Size: 0
>
> Tests run: 633, Failures: 0, Errors: 2, Skipped: 2
>
> [INFO] 
> 
> [INFO] Reactor Summary:
> [INFO]
> [INFO] RESTEasy JAX-RS ... SUCCESS [0.847s]
> [INFO] Embedded Servlet Container  SUCCESS [5.664s]
> [INFO] JAX-RS Core API ... SUCCESS [3.313s]
> [INFO] RESTEasy JAX-RS Test Data . SUCCESS [3.350s]
> [INFO] RESTEasy JAX-RS Implementation  FAILURE [46.047s]
> [INFO] RESTEasy JAX-RS Client  SKIPPED
>
> I am trying to run this on a Mac using Maven 3.0.5 and Java 6 Update 65.
>
> Is this working for others?
> Is there some special setup required?
>
>
>
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Client Framework not honoring connection timeouts

2013-10-22 Thread Bill Burke
Then initialize the Reseasy client with the Http client you created in 
the example.

On 10/22/2013 11:27 AM, Borut Bolčina wrote:
> Hi, this simple program which uses the same httpclient 4.3 works as
> expected. The timeout is respected. After 4 seconds you
> get java.net.SocketTimeoutException: Read timed out.
>
> So the bug is not with httpclient.
>
>
> import java.io.IOException;
>
> import org.apache.commons.lang.time.StopWatch;
> import org.apache.http.client.ClientProtocolException;
> import org.apache.http.client.config.RequestConfig;
> import org.apache.http.client.methods.CloseableHttpResponse;
> import org.apache.http.client.methods.HttpGet;
> import org.apache.http.config.SocketConfig;
> import org.apache.http.impl.client.CloseableHttpClient;
> import org.apache.http.impl.client.HttpClients;
> import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
>
> public class Main2 {
> static Logger logger = LoggerFactory.getLogger(Main2.class);
>
> public static void main(String[] args) {
> logger.info <http://logger.info>("Starting HttpClient test.");
> SocketConfig socketConfig = SocketConfig.custom()
> .setTcpNoDelay(true)
> .setSoKeepAlive(true)
> .setSoReuseAddress(true)
> .build();
> PoolingHttpClientConnectionManager connManager = new
> PoolingHttpClientConnectionManager();
> connManager.setMaxTotal(100);
> connManager.setDefaultMaxPerRoute(100);
> connManager.setDefaultSocketConfig(socketConfig);
> RequestConfig defaultRequestConfig = RequestConfig.custom()
> .setSocketTimeout(4000)
> .setConnectTimeout(2000)
> .setConnectionRequestTimeout(1000)
> .setStaleConnectionCheckEnabled(true)
> .build();
> CloseableHttpClient httpClient = HttpClients.custom()
> .setDefaultRequestConfig(defaultRequestConfig)
> .setConnectionManager(connManager)
> .build();
> String host = "http://fake-response.appspot.com/?sleep=7";;
> HttpGet httpget = new HttpGet(host);
> CloseableHttpResponse response = null;
> StopWatch sw = new StopWatch();
> try {
> sw.start();
> response = httpClient.execute(httpget);
> System.out.println(response.getProtocolVersion());
> System.out.println(response.getStatusLine().getStatusCode());
> System.out.println(response.getStatusLine().getReasonPhrase());
> System.out.println(response.getStatusLine().toString());
> } catch (ClientProtocolException e) {
> e.printStackTrace();
> } catch (IOException e) {
> e.printStackTrace();
> } finally {
> try {
> sw.stop();
> System.out.println(sw);
> response.close();
> } catch (IOException e) {
> e.printStackTrace();
> }
> }
> }
> }
>
> Best regards,
> borut
>
>
> 2013/10/11 Bill Burke mailto:bbu...@redhat.com>>
>
> Might be an Apache issue.  Maybe try the timeout without Resteasy and
> just an Apache call?
>
> On 10/11/2013 6:37 AM, Borut Bolčina wrote:
>  > Hello,
>  >
>  > what is wrong with the code below? When using RestEasy Proxy
> Framework
>  > it seems the client is not using the configuration for connection
> timeouts.
>  >
>  > At line 54 there is a test url which returns response after 7
> seconds,
>  > but the call is not aborted as one might expect.
>  >
>  > package si.najdi.httpclient;
>  >
>  > import javax.ws.rs.ProcessingException;
>  > import javax.ws.rs.core.Response;
>  >
>  > import org.apache.http.client.config.RequestConfig;
>  > import org.apache.http.config.SocketConfig;
>  > import org.apache.http.impl.client.CloseableHttpClient;
>  > import org.apache.http.impl.client.HttpClients;
>  > import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
>  > import org.jboss.resteasy.client.jaxrs.ResteasyClient;
>  > import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
>  > import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
>  > import
> org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine;
>  > import org.slf4j.Logger;
>  > import org.slf4j.LoggerFactory;
>  >
>  > public class Main {
>  >
>  > static Logger logger = LoggerFactory.getLogger(Main.class);
>  > public static void main(String[] args) {
>  > logger.info <http://logger.info> <http://logger.info>("Starting
> HttpClient test.");
>  > SocketConfig socketConfig = SocketConfig.custom()
>  > .setTcpNoDelay(true)
>  > .setSoKeepAl

Re: [Resteasy-users] Resteasy Client does not properly handle Server exception, rendering Client inoperable

2013-10-21 Thread Bill Burke
I cannot accept this pull request as it will break JAX-RS TCK tests.  If 
you want to add a configuration switch to automatically close the 
connection, thats fine, but the default needs to keep it open as this is 
required by the specification.

On 10/21/2013 4:52 PM, Anthony Whitford wrote:
> I created a fix for this issue by modifying the error handling of the
> ClientInvocation.extractResult method.
>
> See Pull Request: https://github.com/resteasy/Resteasy/pull/397
>
> My primary concern about catching WebApplicationException all over the
> place is that it seems to violate Separation of Concerns.  A user of the
> interface is not responsible for allocating or managing the connection,
> so why should it be responsible for closing it?  As a user of the
> interface, it may not even be clear that it is an RPC call -- that is
> some of the beauty of the abstraction.
>
> Note that in my example, the error message still comes through as
> text/html...  But the status code is 500.  I am merely focused on not
> violating the underlying Apache Client state.
>
> Please review.  Thank you,
>
> Anthony
>
>
>
> On Oct 17, 2013, at 2:10 PM, Bill Burke  <mailto:bbu...@redhat.com>> wrote:
>
>> Unfortunately, you are responsible for cleaning up the connection
>> yourself.  You must do:
>>
>> try {
>>
>>... do something with client ...
>>
>> } catch (WebApplicationException ex) {
>>
>> ex.getResponse().close();
>>
>> }
>>
>> This is because the response may contain an entity that the user wants
>> to access.  I'm pretty sure we're not allowed to automatically close the
>> underlying Response object.
>>
>>
>> On 10/17/2013 10:01 AM, Anthony Whitford wrote:
>>> I discovered a particularly nasty problem using the Resteasy Client
>>> Framework and have documented it in the issue tracker:
>>> https://issues.jboss.org/browse/RESTEASY-963
>>>
>>> In a nutshell, if a Client Proxy instance makes a call to the service
>>> and the service throws an exception, the Client is now rendered
>>> inoperable because the underlying connection is not adequately reset.
>>>
>>> A sample project is included with the issue that demonstrates the
>>> problem.  Note that there is a scenario (when a connection pool no
>>> longer has a valid connection available) where the call becomes FROZEN!
>>>
>>> If I had to guess on the solution, I would say that the invoke method
>>> of ClientInvoker needs to catch the exception and release the underlying
>>> connection in the event of an exception.
>>>
>>> https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-client/src/main/java/org/jboss/resteasy/client/jaxrs/internal/proxy/ClientInvoker.java#L104
>>>
>>> I think this is similar to the issue raised by John D. Ament on the
>>> 15th.  (Resteasy should automatically clean up
>>> the connection, but this can not be limited to a GC event because we
>>> have no control over GC events.)
>>>
>>> I look forward to seeing this fixed as this is a serious stability risk.
>>>  Thank you,
>>>
>>> Anthony
>>>
>>>
>>>
>>> --
>>> October Webinars: Code for Performance
>>> Free Intel webinars can help you accelerate application performance.
>>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the
>>> most from
>>> the latest Intel processors and coprocessors. See abstracts and
>>> register >
>>> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
>>>
>>>
>>>
>>> ___
>>> Resteasy-users mailing list
>>> Resteasy-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>>
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com
>>
>> --
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the
>> most from
>> the latest Intel processors and coprocessors. See abstracts and register >
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
>> ___
>> Resteasy-users

Re: [Resteasy-users] getMediaType() Exception

2013-10-21 Thread Bill Burke
pom
>>  import
>>  
>>  
>>  
>>
>>
>>  
>>  org.jboss.spec.javax.ws.rs
>>  jboss-jaxrs-api_1.1_spec
>>  provided
>>  
>>
>>
>>  
>>  org.jboss.resteasy
>>  resteasy-client
>>  3.0.4.Final
>>  
>>
>>
>> java version "1.6.0_27"
>> OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.2)
>> OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mod
>>
>> --
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
>> from
>> the latest Intel processors and coprocessors. See abstracts and register >
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
>> ___
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>
>
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Resteasy Client does not properly handle Server exception, rendering Client inoperable

2013-10-17 Thread Bill Burke
Unfortunately, you are responsible for cleaning up the connection 
yourself.  You must do:

try {

... do something with client ...

} catch (WebApplicationException ex) {

ex.getResponse().close();

}

This is because the response may contain an entity that the user wants 
to access.  I'm pretty sure we're not allowed to automatically close the 
underlying Response object.


On 10/17/2013 10:01 AM, Anthony Whitford wrote:
> I discovered a particularly nasty problem using the Resteasy Client
> Framework and have documented it in the issue tracker:
> https://issues.jboss.org/browse/RESTEASY-963
>
> In a nutshell, if a Client Proxy instance makes a call to the service
> and the service throws an exception, the Client is now rendered
> inoperable because the underlying connection is not adequately reset.
>
> A sample project is included with the issue that demonstrates the
> problem.  Note that there is a scenario (when a connection pool no
> longer has a valid connection available) where the call becomes FROZEN!
>
> If I had to guess on the solution, I would say that the invoke method
> of ClientInvoker needs to catch the exception and release the underlying
> connection in the event of an exception.
>
> https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-client/src/main/java/org/jboss/resteasy/client/jaxrs/internal/proxy/ClientInvoker.java#L104
>
> I think this is similar to the issue raised by John D. Ament on the
> 15th.  (Resteasy should automatically clean up
> the connection, but this can not be limited to a GC event because we
> have no control over GC events.)
>
> I look forward to seeing this fixed as this is a serious stability risk.
>   Thank you,
>
> Anthony
>
>
>
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Resetting connection?

2013-10-16 Thread Bill Burke
You should be calling ClientResponse.releaseConnection() after you are 
done with the ClientResponse.  Resteasy should automatically clean up 
the connection, but this only happens on a GC.

In JAX-RS 2.0 you are also required to call Response.close().

On 10/15/2013 5:15 PM, John D. Ament wrote:
> I've seen this error lots of times:
>
> Caused by: java.lang.IllegalStateException: Invalid use of
> BasicClientConnManager: connection still allocated.
> Make sure to release the connection before allocating another one.
>  at 
> org.apache.http.impl.conn.BasicClientConnectionManager.getConnection(BasicClientConnectionManager.java:161)
>  at 
> org.apache.http.impl.conn.BasicClientConnectionManager$1.getConnection(BasicClientConnectionManager.java:138)
>  at 
> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:455)
>  at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
>  at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
>  at 
> org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor.execute(ApacheHttpClient4Executor.java:182)
> [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
>  at 
> org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:39)
> [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
>  at 
> org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor.execute(AcceptEncodingGZIPInterceptor.java:40)
> [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
>  at 
> org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:45)
> [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
>  at 
> org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:443)
> [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
>  at 
> org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:677)
> [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
>  at 
> org.jboss.resteasy.client.core.ClientInvoker.invoke(ClientInvoker.java:111)
> [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
>
> When trying to use the resteasy client.  However, how do I reset
> connection as is indicated in here when I'm using a proxy object?
>
> John
>
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> _______
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] POST method always returns "Error status 401 Unauthorized"

2013-10-14 Thread Bill Burke
Maybe because your REST service requires authentication?

On 10/14/2013 2:54 PM, Nuwan Bandara wrote:
> Can someone help me on this?
>
> Thanks.
>
>
> On Fri, Oct 11, 2013 at 1:15 PM, Nuwan Bandara  <mailto:mail.nu...@gmail.com>> wrote:
>
> Hi,
>
> I use the following code to call a web service using POST and always
> get "POST method always returns "Error status 401 Unauthorized""
>
> Can someone help me to figure out what I do wrong in the bellow code?
>
> Thanks in advance,
> Nuwan
>
>
> *FYI: webServiceUrl:
> 
> http://apitest.collabrx.com/oncovar/V1-0-7?client_id=XXX&command=submit_sample*
>
>  public Document post(String webServiceUrl, String data) throws
> ExternalResourceConnectorException {
>  logger.debug("Posting data to URL: " + webServiceUrl);
>  SAXReader saxReader = new SAXReader();
>  Document document = null;
>  StringBuffer responseMsg = new StringBuffer();
>  try {
>  ClientRequest request = new ClientRequest(webServiceUrl);
>  request.accept("application/xml");
>  request.body(MediaType.APPLICATION_XML, data); // data
> to be identified.
>  ClientResponse response =
> request.post(String.class);
>  //Object response =  request.post().getEntity(new
> GenericType(){});
>  if (response.getStatus() != 200) {
>  throw new RuntimeException("Failed : HTTP error
> code : " + response.getStatus());
>  }
>  BufferedReader br = new BufferedReader(new
> InputStreamReader(new ByteArrayInputStream(response.getEntity()
>  .getBytes(;
>  String output;
>  while ((output = br.readLine()) != null) {
>  responseMsg.append(output);
>  }
> logger.info <http://logger.info>("External web service response: "+
> responseMsg.toString());
>  document = saxReader.read(new
> StringReader(responseMsg.toString()));
>  }
>  catch (ClientProtocolException e) {
>  throw new ExternalResourceConnectorException(e);
>  }
>  catch (IOException e) {
>  throw new ExternalResourceConnectorException(e);
>  }
>  catch (Exception e) {
>  throw new ExternalResourceConnectorException(e);
>  }
>  return document;
>  }
>
>
>
>
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Client Framework not honoring connection timeouts

2013-10-11 Thread Bill Burke
Might be an Apache issue.  Maybe try the timeout without Resteasy and 
just an Apache call?

On 10/11/2013 6:37 AM, Borut Bolčina wrote:
> Hello,
>
> what is wrong with the code below? When using RestEasy Proxy Framework
> it seems the client is not using the configuration for connection timeouts.
>
> At line 54 there is a test url which returns response after 7 seconds,
> but the call is not aborted as one might expect.
>
> package si.najdi.httpclient;
>
> import javax.ws.rs.ProcessingException;
> import javax.ws.rs.core.Response;
>
> import org.apache.http.client.config.RequestConfig;
> import org.apache.http.config.SocketConfig;
> import org.apache.http.impl.client.CloseableHttpClient;
> import org.apache.http.impl.client.HttpClients;
> import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
> import org.jboss.resteasy.client.jaxrs.ResteasyClient;
> import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
> import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
> import org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
>
> public class Main {
>
> static Logger logger = LoggerFactory.getLogger(Main.class);
> public static void main(String[] args) {
> logger.info <http://logger.info>("Starting HttpClient test.");
> SocketConfig socketConfig = SocketConfig.custom()
> .setTcpNoDelay(true)
> .setSoKeepAlive(true)
> .setSoReuseAddress(true)
> .build();
> PoolingHttpClientConnectionManager connManager = new
> PoolingHttpClientConnectionManager();
> connManager.setMaxTotal(100);
> connManager.setDefaultMaxPerRoute(100);
> connManager.setDefaultSocketConfig(socketConfig);
> RequestConfig defaultRequestConfig = RequestConfig.custom()
> .setSocketTimeout(2000)
> .setConnectTimeout(100)
> .setConnectionRequestTimeout(3000)
> .setStaleConnectionCheckEnabled(true)
> .build();
> CloseableHttpClient httpClient = HttpClients.custom()
> .setDefaultRequestConfig(defaultRequestConfig)
> .setConnectionManager(connManager)
> .build();
> ApacheHttpClient4Engine apacheHttpClient4Engine = new
> ApacheHttpClient4Engine(httpClient);
> ResteasyClient client = new
> ResteasyClientBuilder().httpEngine(apacheHttpClient4Engine).build();
> //String host = "http://httpstat.us/400";;
> String host = "http://fake-response.appspot.com/?sleep=7";;
> ResteasyWebTarget newsWebTarget = client.target(host);
> NewsClient newsClient = newsWebTarget.proxy(NewsClient.class);
> boolean ok = false;
>
> Response response = null;
> try {
> logger.info <http://logger.info>("Calling...");
> response = newsClient.clickIncrement("666");
> logger.info <http://logger.info>("...returning");
>
> if (response.getStatus() == Response.Status.OK.getStatusCode()) {
> String line = (String) response.readEntity(String.class);
> logger.info <http://logger.info>("Response line: " + line);
> } else {
> String failMessage = response.getStatusInfo().getStatusCode() + " " +
> response.getStatusInfo().getReasonPhrase();
> logger.warn("Failed call. Reason: " + failMessage);
> }
> } catch (ProcessingException e) {
> logger.warn("Exception incrementing click counter." + e);
> } finally {
> if (response != null) {
> response.close();
> }
> }
>  }
> }
>
>
> Here is the client interface if it matters:
>
> import javax.ws.rs.DefaultValue;
> import javax.ws.rs.GET;
> import javax.ws.rs.Path;
> import javax.ws.rs.PathParam;
> import javax.ws.rs.core.Response;
>
> public interface NewsClient {
>
>  @GET
>  //@Path("clickcounter/news/{newsId}")
>  Response clickIncrement(@PathParam("newsId") @DefaultValue("123")
> String newsId);
> }
>
>
> The log output:
> [12:05:46] INFO  [si.najdi.httpclient.Main]: Starting HttpClient test.
> [12:05:47] DEBUG
> [org.jboss.resteasy.plugins.providers.DocumentProvider]: Unable to
> retrieve config: expandEntityReferences defaults to true
> [12:05:47] DEBUG
> [org.jboss.resteasy.plugins.providers.DocumentProvider]: Unable to
> retrieve config: expandEntityReferences defaults to true
> [12:05:47] INFO  [si.najdi.httpclient.Main]: Calling...
> [12:05:54] INFO  [si.najdi.httpclient.Main]: ...returning
> [12:05:54] INFO  [si.najdi.httpclient.Main]: Response line:
> {"response":"This request has finsihed sleeping for 7 seconds"}
>
>
> Best regards,
> borut
>
>
>
> --
> October Webinar

Re: [Resteasy-users] Subtle Jackson Change

2013-10-01 Thread Bill Burke
Its probably some setting in Jackson you'll have to set.  Not sure. 
You'll have to track it down in the Jackson documentation.  Resteasy is 
only a very very very very thin wrapper around Jackson.

On 10/1/2013 11:21 AM, Mark Jenkins wrote:
> Hi,
>
> We have a lazy loaded list in a JAXB (XJC created) DTO such that the
> list only gets created when the ‘get’ method is called.
>
> If nothing is added to the list then the member variable will be /null/.
>
> With the 2.3.2 jackson-provider, /null/ lists were returned as an empty
> array /[]/. With the 3.0.3 jackson-provider null lists are returned as
> /null/.
>
> As an example using the following as source
>
> 
>
> Converted in  2.3.2
>
>  "assignedUsers": {
>
>  "user": []
>
>  },
>
> Converted in  3.0.3
>
>  "assignedUsers": {
>
>  "user": null
>
>  },
>
> If possible we would like to maintain the old interface behaviour. Any
> ideas?
>
> Thanks Mark
>
>
> 
>
> The information contained in this email may contain confidential or
> legally privileged information. If you are not the intended recipient
> any disclosure, copying, distribution or taking any action on the
> contents of this information may be unlawful. If you have received this
> email in error, please delete it from your system and notify us
> immediately. Any views expressed in this message are those of the
> individual sender, except where the message states otherwise. IDBS takes
> no responsibility for any computer virus which might be transferred by
> way of this email and recommends that you subject any incoming E-mail to
> your own virus checking procedures. We may monitor all E-mail
> communication through our networks. If you contact us by E-mail, we may
> store your name and address to facilitate communication.
>
>
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Subresource for target class has no jax-rs annotations

2013-09-26 Thread Bill Burke
AuthorizationRestService.webserviceTest() does not have a @POST 
annotation on it.  If you annotate a class with JAX-RS annotations, it 
will not use the interface's annotations at all and you must redeclare 
everything in the class.

On 9/26/2013 8:07 AM, yashar Bizhanzadeh wrote:
>
> I am trying to call a webservice method via a proxy but I have got an
> error message that says: "Subresource for target class has no jax-rs
> annotations.: org.jboss.resteasy.core.ServerResponse"
>
> Here is my server class
>
> |@Path("/authorizationCheck")
> public class AuthorizationRestService implements AuthorizationService  {
>
>@Override
>  @Path("/webserviceTest")
>  public Response webserviceTest(){
>  TestDTO  x = new TestDTO();
>  x.setFieldOne("");
>  x.setFieldTwo("");
>  Response res = Response.ok(x).build();
>  return res;
>
>
>  }
> }
> |
>
> with a an interface like this
>
> |@Path("/authorizationCheck")
> public interface AuthorizationService {
>
>  @POST
>  @Path("/webserviceTest")
>  public Response webserviceTest();
> }
> |
>
> and my return object wrapped in response
>
> |@XmlRootElement
> @XmlAccessorType(XmlAccessType.FIELD)
> public class TestDTO {
>
>  private String fieldOne;
>
>  private String fieldTwo;
>
>  public String getFieldOne() {
>  return fieldOne;
>  }
>
>  public void setFieldOne(String fieldOne) {
>  this.fieldOne = fieldOne;
>  }
>
>  public String getFieldTwo() {
>  return fieldTwo;
>  }
>
>  public void setFieldTwo(String fieldTwo) {
>  this.fieldTwo = fieldTwo;
>  }
>
>
>
> }
> |
>
> and finally my client class
>
> |@Stateful
> @Scope(ScopeType.CONVERSATION)
> @Name("authorizationCheckService")
> public class AuthorizationCheckService {
>
>  public void testWebservice(){
>  RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
>  AuthorizationService  proxy =
>  ProxyFactory.create(AuthorizationService.class,
>  ApplicationConfig.WORKFLOWSERVER_URL + 
> "services/authorizationCheck/webserviceTest");
>  Response response =   proxy.webserviceTest();
>  return;
>
>
>
>  }
> }
> |
>
> what I am doing wrong here , any help will be appreciated.
>
> Regards
> //Yashar
>
>
>
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] LightweightBrowserCache substitution

2013-09-16 Thread Bill Burke
Thanks, i'll add a JIRA for this.  Apologies...

But:

https://github.com/resteasy/Resteasy/blob/3.0.4.Final/jaxrs/resteasy-jaxrs-testsuite/src/test/java/org/jboss/resteasy/test/nextgen/client/cache/ClientCacheTest.java

Gives an example.

It has been redesigned a little bit to use the new client API.  The new 
package is org.jboss.resteasy.client.jaxrs.cache.*

You register a BrowserCacheFeature

client.register(BrowserCacheFeature.class)

Or you can instantiate teh feature and initialize it with a BrowserCache 
of your choosing.

Also, ProxyFactory is now a part of ResteasyWebTarget.  This, I *DID* 
document:

http://docs.jboss.org/resteasy/docs/3.0.4.Final/userguide/html/RESTEasy_Client_Framework.html#d4e2101






On 9/16/2013 6:42 AM, Borut Bolčina wrote:
> Hello,
>
> The Javadoc says the whole package org.jboss.resteasy.client.cache is
> deprecated but it does not provide any information what to use instead.
> Very bad practice IMHO. The same lack of info is for
> org.jboss.resteasy.client.ProxyFactory.
>
> So what should we use instead of LightweightBrowserCache in the latest
> (3.0.4) incarnation of resteasy?
>
> Regards,
> Borut
>
>
> --
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] Resteasy 3.0.4 released

2013-09-05 Thread Bill Burke
Resteasy 3.0.4.Final has been released today.  Besides some bug fixes, 
this ended up being a major feature release specifically:

* Netty 4 integration thanks to Kristoffer Sjoegren
* Undertow integration
* JOSE JSON Web Encryption (JWE) Support
* A new Servlet 3.0 ServerContainerInitializer for Resteasy.  This 
allows you to take advantage of JAX-RS integration within a standalone 
Servlet 3.0 environment.  This means you can work solely with 
Application classes, use automatic scanning, and not have to write 
anything in your web.xml files for Tomcat and Jetty deployments!.
* I also published the new revised examples for my up-and-coming Restful 
Java With JAX-RS 2.0 book.

As usual, check out http://jboss.org/resteasy for how to download the 
distro and view documentation.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Confused on handling response containing collections in json

2013-09-04 Thread Bill Burke
Switch to Jackson on the server side.  We will be deprecating Jettison 
in the near future as it is buggy and not being well maintained. 
Jackson has all of what Jettison has and more...

But you are right, Jettison produces different JSON.

On 9/4/2013 3:27 PM, Mike Miller wrote:
> We are building a restful api, using 2.3.5 (although I don’t think the
> release level matters) and I am a bit confused on response handling
> within RestEasy:
>
> Right or wrong, we made most of our resource methods return Response,
> using the GenericEntity when we wanted to return a collection of
> objects.Testing up to now was in Chrome Advanced Rest Client.  We
> have our beans JAXB annotated and the resource ‘produces’ both
> application/xml and application/json.  For example:
>
> @GET
>
> @Produces({"application/json", "application/xml"})
>
> *public*Response find(@ContextUriInfo uriInfo)
>
> {
>
>setupQueryParms(uriInfo.getQueryParameters());
>
>List custList = *null*;
>
> *try*{
>
>   custList = listAllPaginated();
>
>} *catch*(FinderException e) {
>
>   Log./getInstance/().error("FinderException caught
> :", e );
>
>   throwException(Response.Status./NOT_FOUND/, "Error
> searching customers");
>
>}
>
>GenericEntity> entity =
> *new*GenericEntity>(custList) {};
>
> *return*Response./ok/(entity).build();
>
> }
>
> Now, as part of writing JUnit test cases, I wanted to take the response
> I get back and put it back to object form so that I can then do a set of
> asserts against the object or list of objects returned.   I downloaded
> Jackson version 1.9.11 and tried to serialize/marshal the json back to
> object form but keep getting the following error:
>
> Exception in thread "main"
> _org.codehaus.jackson.map.exc.UnrecognizedPropertyException_:
> Unrecognized field "Customer" (Class
> com.jda.portfolio.api.rest.base.Customer), not marked as ignorable
>
> at [Source: C:\PPOSDevelopment\Trunk\API\REST\Server\response.json;
> line: 1, column: 15] (through reference chain:
> com.jda.portfolio.api.rest.base.Customer["Customer"])
>
> Is there a difference between Jackson json and what RestEasy produces, from I 
> think Jettison?   I also took the example from User doc section 19.6.1 JSON 
> and JAXB collections/arrays
>
>
>
> [{"foo":{"@test":"bill"}},{"foo":{"@test":"monica}"}}] and tried to marshal 
> that back to object form – getting the same error.
>
>
>
> It seems like from Jackson, I would get something like:
>
> [{"@test":"bill"},{"@test":"monica}"}] for a List - the difference being 
> the {foo: } which looks like a wrapper for the object.
>
>
>
> I changed the code to return List instead of the Response with 
> GenericEntity including the List but the json looks the same.
>
>
>
> What am I doing wrong?
>
>
>
> Are we using the Response object incorrectly?  What’s really the difference 
> between returning List vs Response with the List in the 
> generic entity?
>
>
>
> I hope this is clear, but I can provide more details if needed.
>
>
>
>
>
>
>
> --
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Confused on handling response containing collections in json

2013-09-04 Thread Bill Burke
JSON is not a *Java* format.  It is a JavaScript Object Notation.

On 9/4/2013 4:54 PM, Mike Miller wrote:
> Thanks - will try that.   Just included the Jackson jar but that didn't make 
> it.
>
> One last question - don't mean to eat up all your time - but your statement,  
> "But you are right, Jettison produces different JSON."  How that be?  Isn't 
> JSON a spec such that there should be consistent output for a set of data?
>
> -Original Message-
> From: Bill Burke [mailto:bbu...@redhat.com]
> Sent: Wednesday, September 04, 2013 3:50 PM
> To: Mike Miller
> Cc: resteasy-users@lists.sourceforge.net
> Subject: Re: [Resteasy-users] Confused on handling response containing 
> collections in json
>
> Just don't include the jettison module and include all the jackson stuff.  
> Should work.
>
> On 9/4/2013 4:19 PM, Mike Miller wrote:
>> Sorry - we are JBoss 4.2.3.GA (still) with RestEasy 2.3.5.
>>
>> -Original Message-
>> From: Bill Burke [mailto:bbu...@redhat.com]
>> Sent: Wednesday, September 04, 2013 3:06 PM
>> To: Mike Miller
>> Cc: resteasy-users@lists.sourceforge.net
>> Subject: Re: [Resteasy-users] Confused on handling response containing
>> collections in json
>>
>> What is your server?  Tomcat? Jetty?  JBoss version?
>>
>> On 9/4/2013 4:02 PM, Mike Miller wrote:
>>> Okay, thanks - so how do I do that?  I see Chapter 21 (2.3.5) talks about 
>>> Maven but we aren't using maven.  Do  I just need to include the jar or is 
>>> there something in the web.xml that I need to add to include this 'provider?
>>>
>>> Also could someone please address my last question:
>>>
>>> "Are we using the Response object incorrectly?  What's really the 
>>> difference between returning List vs Response with the 
>>> List in the generic entity?"
>>>
>>> -Original Message-
>>> From: Bill Burke [mailto:bbu...@redhat.com]
>>> Sent: Wednesday, September 04, 2013 2:54 PM
>>> To: resteasy-users@lists.sourceforge.net
>>> Subject: Re: [Resteasy-users] Confused on handling response
>>> containing collections in json
>>>
>>> Switch to Jackson on the server side.  We will be deprecating Jettison in 
>>> the near future as it is buggy and not being well maintained.
>>> Jackson has all of what Jettison has and more...
>>>
>>> But you are right, Jettison produces different JSON.
>>>
>>> On 9/4/2013 3:27 PM, Mike Miller wrote:
>>>> We are building a restful api, using 2.3.5 (although I don't think
>>>> the release level matters) and I am a bit confused on response
>>>> handling within RestEasy:
>>>>
>>>> Right or wrong, we made most of our resource methods return
>>>> Response, using the GenericEntity when we wanted to return a collection of
>>>> objects.Testing up to now was in Chrome Advanced Rest Client.  We
>>>> have our beans JAXB annotated and the resource 'produces' both
>>>> application/xml and application/json.  For example:
>>>>
>>>> @GET
>>>>
>>>> @Produces({"application/json", "application/xml"})
>>>>
>>>> *public*Response find(@ContextUriInfo uriInfo)
>>>>
>>>>{
>>>>
>>>>   setupQueryParms(uriInfo.getQueryParameters());
>>>>
>>>>   List custList = *null*;
>>>>
>>>> *try*{
>>>>
>>>>  custList = listAllPaginated();
>>>>
>>>>   } *catch*(FinderException e) {
>>>>
>>>>  Log./getInstance/().error("FinderException
>>>> caught :", e );
>>>>
>>>>  throwException(Response.Status./NOT_FOUND/,
>>>> "Error searching customers");
>>>>
>>>>   }
>>>>
>>>>   GenericEntity> entity =
>>>> *new*GenericEntity>(custList) {};
>>>>
>>>> *return*Response./ok/(entity).build();
>>>>
>>>>}
>>>>
>>>> Now, as part of writing JUnit test cases, I wanted to take the
>>>> response I get back and put it back to object form so that I can then do a 
>>>> set of
>>>> asserts against the object or list of objects returned.   I downloaded
>&

Re: [Resteasy-users] Confused on handling response containing collections in json

2013-09-04 Thread Bill Burke
Just don't include the jettison module and include all the jackson 
stuff.  Should work.

On 9/4/2013 4:19 PM, Mike Miller wrote:
> Sorry - we are JBoss 4.2.3.GA (still) with RestEasy 2.3.5.
>
> -Original Message-
> From: Bill Burke [mailto:bbu...@redhat.com]
> Sent: Wednesday, September 04, 2013 3:06 PM
> To: Mike Miller
> Cc: resteasy-users@lists.sourceforge.net
> Subject: Re: [Resteasy-users] Confused on handling response containing 
> collections in json
>
> What is your server?  Tomcat? Jetty?  JBoss version?
>
> On 9/4/2013 4:02 PM, Mike Miller wrote:
>> Okay, thanks - so how do I do that?  I see Chapter 21 (2.3.5) talks about 
>> Maven but we aren't using maven.  Do  I just need to include the jar or is 
>> there something in the web.xml that I need to add to include this 'provider?
>>
>> Also could someone please address my last question:
>>
>> "Are we using the Response object incorrectly?  What's really the difference 
>> between returning List vs Response with the List in the 
>> generic entity?"
>>
>> -Original Message-
>> From: Bill Burke [mailto:bbu...@redhat.com]
>> Sent: Wednesday, September 04, 2013 2:54 PM
>> To: resteasy-users@lists.sourceforge.net
>> Subject: Re: [Resteasy-users] Confused on handling response containing
>> collections in json
>>
>> Switch to Jackson on the server side.  We will be deprecating Jettison in 
>> the near future as it is buggy and not being well maintained.
>> Jackson has all of what Jettison has and more...
>>
>> But you are right, Jettison produces different JSON.
>>
>> On 9/4/2013 3:27 PM, Mike Miller wrote:
>>> We are building a restful api, using 2.3.5 (although I don't think
>>> the release level matters) and I am a bit confused on response
>>> handling within RestEasy:
>>>
>>> Right or wrong, we made most of our resource methods return Response,
>>> using the GenericEntity when we wanted to return a collection of
>>> objects.Testing up to now was in Chrome Advanced Rest Client.  We
>>> have our beans JAXB annotated and the resource 'produces' both
>>> application/xml and application/json.  For example:
>>>
>>> @GET
>>>
>>> @Produces({"application/json", "application/xml"})
>>>
>>> *public*Response find(@ContextUriInfo uriInfo)
>>>
>>>   {
>>>
>>>  setupQueryParms(uriInfo.getQueryParameters());
>>>
>>>  List custList = *null*;
>>>
>>> *try*{
>>>
>>> custList = listAllPaginated();
>>>
>>>  } *catch*(FinderException e) {
>>>
>>> Log./getInstance/().error("FinderException
>>> caught :", e );
>>>
>>> throwException(Response.Status./NOT_FOUND/,
>>> "Error searching customers");
>>>
>>>  }
>>>
>>>  GenericEntity> entity =
>>> *new*GenericEntity>(custList) {};
>>>
>>> *return*Response./ok/(entity).build();
>>>
>>>   }
>>>
>>> Now, as part of writing JUnit test cases, I wanted to take the
>>> response I get back and put it back to object form so that I can then do a 
>>> set of
>>> asserts against the object or list of objects returned.   I downloaded
>>> Jackson version 1.9.11 and tried to serialize/marshal the json back
>>> to object form but keep getting the following error:
>>>
>>> Exception in thread "main"
>>> _org.codehaus.jackson.map.exc.UnrecognizedPropertyException_:
>>> Unrecognized field "Customer" (Class
>>> com.jda.portfolio.api.rest.base.Customer), not marked as ignorable
>>>
>>> at [Source: C:\PPOSDevelopment\Trunk\API\REST\Server\response.json;
>>> line: 1, column: 15] (through reference chain:
>>> com.jda.portfolio.api.rest.base.Customer["Customer"])
>>>
>>> Is there a difference between Jackson json and what RestEasy produces, from 
>>> I think Jettison?   I also took the example from User doc section 19.6.1 
>>> JSON and JAXB collections/arrays
>>>
>>>
>>>
>>> [{"foo":{"@test":"bill"}},{"foo":{"@test":"monica}"}}] and tried to marshal 
>>> that back to object form - getting the same error.
>>>

Re: [Resteasy-users] Confused on handling response containing collections in json

2013-09-04 Thread Bill Burke
What is your server?  Tomcat? Jetty?  JBoss version?

On 9/4/2013 4:02 PM, Mike Miller wrote:
> Okay, thanks - so how do I do that?  I see Chapter 21 (2.3.5) talks about 
> Maven but we aren't using maven.  Do  I just need to include the jar or is 
> there something in the web.xml that I need to add to include this 'provider?
>
> Also could someone please address my last question:
>
> "Are we using the Response object incorrectly?  What's really the difference 
> between returning List vs Response with the List in the 
> generic entity?"
>
> -Original Message-
> From: Bill Burke [mailto:bbu...@redhat.com]
> Sent: Wednesday, September 04, 2013 2:54 PM
> To: resteasy-users@lists.sourceforge.net
> Subject: Re: [Resteasy-users] Confused on handling response containing 
> collections in json
>
> Switch to Jackson on the server side.  We will be deprecating Jettison in the 
> near future as it is buggy and not being well maintained.
> Jackson has all of what Jettison has and more...
>
> But you are right, Jettison produces different JSON.
>
> On 9/4/2013 3:27 PM, Mike Miller wrote:
>> We are building a restful api, using 2.3.5 (although I don't think the
>> release level matters) and I am a bit confused on response handling
>> within RestEasy:
>>
>> Right or wrong, we made most of our resource methods return Response,
>> using the GenericEntity when we wanted to return a collection of
>> objects.Testing up to now was in Chrome Advanced Rest Client.  We
>> have our beans JAXB annotated and the resource 'produces' both
>> application/xml and application/json.  For example:
>>
>> @GET
>>
>> @Produces({"application/json", "application/xml"})
>>
>> *public*Response find(@ContextUriInfo uriInfo)
>>
>>  {
>>
>> setupQueryParms(uriInfo.getQueryParameters());
>>
>> List custList = *null*;
>>
>> *try*{
>>
>>custList = listAllPaginated();
>>
>> } *catch*(FinderException e) {
>>
>>Log./getInstance/().error("FinderException
>> caught :", e );
>>
>>throwException(Response.Status./NOT_FOUND/,
>> "Error searching customers");
>>
>> }
>>
>> GenericEntity> entity =
>> *new*GenericEntity>(custList) {};
>>
>> *return*Response./ok/(entity).build();
>>
>>  }
>>
>> Now, as part of writing JUnit test cases, I wanted to take the
>> response I get back and put it back to object form so that I can then do a 
>> set of
>> asserts against the object or list of objects returned.   I downloaded
>> Jackson version 1.9.11 and tried to serialize/marshal the json back to
>> object form but keep getting the following error:
>>
>> Exception in thread "main"
>> _org.codehaus.jackson.map.exc.UnrecognizedPropertyException_:
>> Unrecognized field "Customer" (Class
>> com.jda.portfolio.api.rest.base.Customer), not marked as ignorable
>>
>> at [Source: C:\PPOSDevelopment\Trunk\API\REST\Server\response.json;
>> line: 1, column: 15] (through reference chain:
>> com.jda.portfolio.api.rest.base.Customer["Customer"])
>>
>> Is there a difference between Jackson json and what RestEasy produces, from 
>> I think Jettison?   I also took the example from User doc section 19.6.1 
>> JSON and JAXB collections/arrays
>>
>>
>>
>> [{"foo":{"@test":"bill"}},{"foo":{"@test":"monica}"}}] and tried to marshal 
>> that back to object form - getting the same error.
>>
>>
>>
>> It seems like from Jackson, I would get something like:
>>
>> [{"@test":"bill"},{"@test":"monica}"}] for a List - the difference 
>> being the {foo: } which looks like a wrapper for the object.
>>
>>
>>
>> I changed the code to return List instead of the Response with 
>> GenericEntity including the List but the json looks the same.
>>
>>
>>
>> What am I doing wrong?
>>
>>
>>
>> Are we using the Response object incorrectly?  What's really the difference 
>> between returning List vs Response with the List in the 
>> generic entity?
>>
>>
>>
>> I hope this is clear, but I can provide more details if needed.
>>
>>
>>
>>
>>
>>
>>
>> 

Re: [Resteasy-users] Restricting json custom provider to a particular client

2013-09-04 Thread Bill Burke
Its up to you what the scope is.  But ugh...there's no nice way to do 
this in the ClientRequest API right now.  What you could use is a 
ClientRequestFactory:

ResteasyProviderFactory factory = new ResteasyProviderFactory();
factory.register(JsonProvider.class);

ApacheHttpClient4Executor executor = new ApacheHttpClient4Executor();

ClientRequestFactory requestFactory = new ClientRequestFactory(executor, 
factory);

ClientRequest request = requestFactory.createRequest(uri);



On 9/4/2013 8:55 AM, Rajshekhar AndalaPisharam wrote:
> Hi Bill
>
> If we create/initialize your own ResteasyProviderFactory, what will be the 
> scope of provider? Will it be request or application scope?
>
> As per our observation, it is application scope and which is causing problems 
> to other clients.
>
> Thanks
>
> A.P. Rajshekhar
>
> - Original Message -
> From: "Rajshekhar AndalaPisharam" 
> To: resteasy-users@lists.sourceforge.net
> Sent: Wednesday, September 4, 2013 1:02:19 PM
> Subject: Re: [Resteasy-users] Restricting json custom provider to a 
> particular client
>
> Hi Bill
>
> Thanks for your suggestion. We are using Resteasy 2.3.x.  We will get back to 
> you once we check this out.
>
> Regards
>
> A.P. Rajshekhar
>
>  Original Message 
> Subject:  Re: [Resteasy-users] Restricting json custom provider to a
> particular client
> Date: Thu, 29 Aug 2013 09:42:27 -0400
> From: Bill Burke 
> To:   resteasy-users@lists.sourceforge.net
>
>
>
> Not sure what you mean.  Which client api are you using?  Resteasy 2.3.x
> or JAX-RS 2.0 in Resteasy 3.0?
>
> In the former, you can create/initialize your own
> ResteasyProviderFactory.  In the latter, this automatically happens per
> Client you create.
>
> On 8/29/2013 9:16 AM, Rajshekhar AndalaPisharam wrote:
>>   Hi Bill,
>>
>>   We are using jacksonJsonProvider to  consume and produce json data in
>>   underscore format.
>>
>>   However when we are trying to integrate with 3rd party systems our
>>   custom provider is getting called and
>>   causing exceptions as 3rd party does not need underscore format.
>>
>>   Is there a way to restrict the custom provider to particular client ?
>>
>>   Thanks
>>
>>   A.P. Rajshekhar
>>
>>   
>> --
>>   Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>>   Discover the easy way to master current and previous Microsoft technologies
>>   and advance your career. Get an incredible 1,500+ hours of step-by-step
>>   tutorial videos with LearnDevNow. Subscribe today and save!
>>   http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
>>   ___
>>   Resteasy-users mailing list
>>   Resteasy-users@lists.sourceforge.net
>>   https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] RESTeasy equivalent for Jersey InjectableProvider

2013-09-04 Thread Bill Burke
Resteasy has an injection API internally, but we never exposed it. 
Nobody ever really asked us to.  If you have a glaring need, I could add 
it for the next release.

Bill

On 9/3/2013 4:58 PM, Jakub Narloch wrote:
> Hi,
>
> I was actually curiouse if there is a similar functionality in RESTeasy
> to the Jersey InjectableProvider? The interface basically allows to
> define provider for custom object injection.
>
> Thanks in advance,
> Jakub Narloch
>
> --
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Restricting json custom provider to a particular client

2013-08-29 Thread Bill Burke
Not sure what you mean.  Which client api are you using?  Resteasy 2.3.x 
or JAX-RS 2.0 in Resteasy 3.0?

In the former, you can create/initialize your own 
ResteasyProviderFactory.  In the latter, this automatically happens per 
Client you create.

On 8/29/2013 9:16 AM, Rajshekhar AndalaPisharam wrote:
> Hi Bill,
>
> We are using jacksonJsonProvider to  consume and produce json data in
> underscore format.
>
> However when we are trying to integrate with 3rd party systems our
> custom provider is getting called and
> causing exceptions as 3rd party does not need underscore format.
>
> Is there a way to restrict the custom provider to particular client ?
>
> Thanks
>
> A.P. Rajshekhar
>
> --
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Fwd: Regarding Ssl handshake during certificate authentication on jboss

2013-08-29 Thread Bill Burke
I have used certs successfully before.

On 8/29/2013 9:31 AM, Mukul Panwar wrote:
>
>
> Sent from my iPhone
>
> Begin forwarded message:
>
>> *From:* mailto:muku...@hcl.com>>
>> *Date:* August 29, 2013, 7:00:06 AM GMT+05:30
>> *To:* Bill Burke mailto:bbu...@redhat.com>>
>> *Cc:* > <mailto:resteasy-users@lists.sourceforge.net>>
>> *Subject:* *Regarding Ssl handshake during certificate authentication
>> on jboss*
>>
>> Hi Bill
>>
>> I have a resteasy client and doing post request . I also set the
>> keystore as trusted and cert key entries before sending the request.
>>
>> The server also having import the client key in their keystore
>> certificate.
>>
>> Means we are doing Two way mutual certificate authentication .
>>
>> The client and server doing handshake successfully . But for each
>> request there is a new handshake where as they should use the session
>> of first Ssl handshake. Please suggest about or give any reference for
>> this.
>>
>> Thanks
>> Mukul
>
>
>
> ::DISCLAIMER::
> 
>
> The contents of this e-mail and any attachment(s) are confidential and
> intended for the named recipient(s) only.
> E-mail transmission is not guaranteed to be secure or error-free as
> information could be intercepted, corrupted,
> lost, destroyed, arrive late or incomplete, or may contain viruses in
> transmission. The e mail and its contents
> (with or without referred errors) shall therefore not attach any
> liability on the originator or HCL or its affiliates.
> Views or opinions, if any, presented in this email are solely those of
> the author and may not necessarily reflect the
> views or opinions of HCL or its affiliates. Any form of reproduction,
> dissemination, copying, disclosure, modification,
> distribution and / or publication of this message without the prior
> written consent of authorized representative of
> HCL is strictly prohibited. If you have received this email in error
> please delete it and notify the sender immediately.
> Before opening any email and/or attachments, please check them for
> viruses and other defects.
>
> 
>
>
>
> --
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
>
>
>
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Adding Jackson as a provider to the client APIs

2013-08-28 Thread Bill Burke
I didn't realize this, but if you go to:

modules/system/layer/base/org/jboss/resteasy/resteasy-jackson-provider/main/module.xml

if you set the attribute "export=true" for all the jackson dependencies, 
then you're deployment will see jackson.  This is fixed in later 
versions of resteasy and resteasy installed on Wildfly/JBoss.

On 8/28/2013 4:21 PM, John D. Ament wrote:
> Bill,
>
> Yes.  I think I found the issue, had to hack up my deployment
> structure to bring in the necessary modules so I think it's better
> (i'm at least seeing exceptions from jackson now).
>
> Thanks,
>
> John
>
> On Wed, Aug 28, 2013 at 4:12 PM, Bill Burke  wrote:
>> The client is running inside EAP 6.1?
>>
>> On 8/28/2013 3:33 PM, John D. Ament wrote:
>>> Hi all
>>>
>>> I'm using RestEasy 2.3.6 (as a part of EAP 6.1).  I am using the
>>> client APIs and was wondering how to add a custom message body
>>> reader/writer?  The other REST server is using Jackson and has many
>>> bindings that are jackson specific.  I can't seem to add the
>>> JacksonJaxbJsonProvider to REST EASY, as a result the JSON's getting
>>> skewed.
>>>
>>> This is what I tried:
>>>
>>> ResteasyProviderFactory.getInstance().addMessageBodyWriter(JacksonJaxbJsonProvider.class);
>>> RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
>>>
>>> Thanks,
>>>
>>> John
>>>
>>> --
>>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>>> Discover the easy way to master current and previous Microsoft technologies
>>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>>> tutorial videos with LearnDevNow. Subscribe today and save!
>>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
>>> ___
>>> Resteasy-users mailing list
>>> Resteasy-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>>
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com
>>
>> --
>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>> Discover the easy way to master current and previous Microsoft technologies
>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>> tutorial videos with LearnDevNow. Subscribe today and save!
>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
>> ___
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] RESTEasy and netty

2013-08-28 Thread Bill Burke
JAX-RS is a stream, BIO, framework , so it is still using java.io.*. 
Can't get around this.  Its a buffer exchange between Netty and 
Resteasy.  Kristoffer just implemented Netty 4 support.  He also 
implemented support for JAX-RS 2.0 async APIs too.  The problem is 
though, even with those async apis, you're still doing streams and BIO.

On 8/28/2013 5:01 PM, Jan Algermissen wrote:
> Hi all, Bill,
>
> I saw you integrated  RESTEasy and netty[1].
>
> Can you point me to details how directly RESTEasy sits on top of netty?
>
> Is the integration just to enable use of netty as the container or si 
> RESTEasy actually taking advantage of the async approach?
>
> I am only about to dive into netty (needing to check JAX-RS suuport first :-) 
> so I cannot ask educated questions (nor look at the sources), but I have a 
> hunch that JAX-RS's request handling model sort of conflicts with async, 
> doesn't it? (Set aside AsyncResonse of course).
>
>
>
> Jan
>
> [1] 
> https://github.com/resteasy/Resteasy/tree/master/jaxrs/server-adapters/resteasy-netty
> --
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Adding Jackson as a provider to the client APIs

2013-08-28 Thread Bill Burke
The client is running inside EAP 6.1?

On 8/28/2013 3:33 PM, John D. Ament wrote:
> Hi all
>
> I'm using RestEasy 2.3.6 (as a part of EAP 6.1).  I am using the
> client APIs and was wondering how to add a custom message body
> reader/writer?  The other REST server is using Jackson and has many
> bindings that are jackson specific.  I can't seem to add the
> JacksonJaxbJsonProvider to REST EASY, as a result the JSON's getting
> skewed.
>
> This is what I tried:
>
> ResteasyProviderFactory.getInstance().addMessageBodyWriter(JacksonJaxbJsonProvider.class);
> RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
>
> Thanks,
>
> John
>
> --
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


  1   2   3   4   >