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] 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 mariodi...@gmail.com
 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
 rodrigo.uc...@gmail.com 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


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

  dependency
  groupIdorg.jboss.resteasy/groupId
  artifactIdresteasy-cache-core/artifactId
  version3.0.9.Final/version
  /dependency

 and added the context parameter to my web.xml

  context-param
  param-nameresteasy.server.cache.maxsize/param-name
  param-value1000/param-value
  /context-param

  context-param

 param-nameresteasy.server.cache.eviction.wakeup.interval/param-name
  param-value5000/param-value
  /context-param

  listener

 listener-classorg.jboss.resteasy.plugins.cache.server.ServletServerCache/listener-class
  /listener

 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


[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=157508191iu=/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-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] 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] 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-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 bbu...@redhat.com:

 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] 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)
 message body writer (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-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] 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] Injecting an EJB in a Resteasy Resource authenticated with OAuth 2.0

2014-05-23 Thread Bill Burke
.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 Client in OSGi Environment

2014-05-23 Thread Bill Burke
,
 MediaTypeMapSortedKeyMessageBodyReader availableReaders)

 {

 ListSortedKeyMessageBodyReader readers =
 availableReaders.getPossible(mediaType, type);

 //logger.info( getMessageBodyReader ***);

 *for*(SortedKeyMessageBodyReader reader : readers)

 {

 //logger.info( matching reader:  + reader.getClass().getName());

 *if*(reader.obj.isReadable(type, genericType, annotations, mediaType))

 {

 *return*(MessageBodyReaderT) 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] Resteasy OAuth 2.0 Skeleton Key Example launchs javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

2014-05-13 Thread Bill Burke
:]
   ... 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] 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(DefaultClientConnectionOperator.java:180)
  [httpclient-4.2.1.jar:4.2.1]
  at 
 org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
  [httpclient-4.2.1.jar:4.2.1]
  at 
 org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
  [httpclient-4.2.1.jar:4.2.1]
  at 
 org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.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

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:
 #149; 3 signs your SCM is hindering your productivity
 #149; Requirements for releasing software faster
 #149; 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:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; 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:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; 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
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:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; 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] 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] 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] 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.JaxrsInjectionTargetT
 [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.JaxrsInjectionTargetT
 [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.JaxrsInjectionTargetT
 [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.JaxrsInjectionTargetT

 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] 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
 ExceptionMapperDefaultOptionsMethodException{

  @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 andrew10...@gmail.com
 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 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):
 module xmlns=urn:jboss:module:1.1 name=org.apache.httpcomponents
  properties
  property name=jboss.api value=private/
  /properties

  resources
  resource-root path=httpclient-4.3.3.jar/
  resource-root path=httpcore-4.3.2.jar/
  resource-root path=httpmime-4.3.3.jar/
  !-- Insert resources here --
  /resources

  dependencies
  module name=javax.api/
  module name=org.apache.commons.codec/
  module name=org.apache.commons.logging/
  module name=org.apache.james.mime4j/
  /dependencies
 /module

 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 bbu...@redhat.com
 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] 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=121054471iu=/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=121054471iu=/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=121051231iu=/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=121051231iu=/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=123612991iu=/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=123612991iu=/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
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 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
  
  
  
  
 
 --
   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=123612991iu=/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=123612991iu=/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=123612991iu=/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 bbu...@redhat.com 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 bbu...@redhat.com
 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=123612991iu=/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/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

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=123612991iu=/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=123612991iu=/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=119420431iu=/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=119420431iu=/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=119420431iu=/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
 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=119420431iu=/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=119420431iu=/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=111408631iu=/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=84349831iu=/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=84349831iu=/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=84349351iu=/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=84349351iu=/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
 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=84349351iu=/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=84349351iu=/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 john.d.am...@gmail.com 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=84349351iu=/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 ListString 
 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=63431311iu=/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=63431311iu=/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=63431311iu=/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=63431311iu=/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=60136231iu=/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=60136231iu=/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
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 anth...@whitford.com
 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 mat...@apache.org
 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 bbu...@redhat.com
 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=60135991iu=/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=60135991iu=/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=60135991iu=/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=60135991iu=/4140/ostg.clktrk

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=60135991iu=/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=60135991iu=/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
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 bbu...@redhat.com
 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]
 [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

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 bbu...@redhat.com
 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=60135031iu=/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=60135031iu=/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=60135991iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


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

 assignedUsers/

 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=60134791iu=/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=60134791iu=/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=58041151iu=/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=58041151iu=/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=58040911iu=/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=58040911iu=/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-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 randa...@redhat.com
 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 bbu...@redhat.com
 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=58040911iu=/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=58040911iu=/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 ListCustomer vs Response with the 
 ListCustomer 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());

   ListCustomer custList = *null*;

 *try*{

  custList = listAllPaginated();

   } *catch*(FinderException e) {

  Log./getInstance/().error(FinderException
 caught :, e );

  throwException(Response.Status./NOT_FOUND/,
 Error searching customers);

   }

   GenericEntityListCustomer entity =
 *new*GenericEntityListCustomer(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 ListFoo - the difference 
 being the {foo: } which looks like a wrapper for the object.



 I changed the code to return ListCustomer instead of the Response with 
 GenericEntity including the ListCustomer 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 ListCustomer vs Response with the 
 ListCustomer

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());

ListCustomer custList = *null*;

 *try*{

   custList = listAllPaginated();

} *catch*(FinderException e) {

   Log./getInstance/().error(FinderException caught
 :, e );

   throwException(Response.Status./NOT_FOUND/, Error
 searching customers);

}

GenericEntityListCustomer entity =
 *new*GenericEntityListCustomer(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 ListFoo - the difference being 
 the {foo: } which looks like a wrapper for the object.



 I changed the code to return ListCustomer instead of the Response with 
 GenericEntity including the ListCustomer 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 ListCustomer vs Response with the ListCustomer 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=58041391iu=/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=58041391iu=/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:* muku...@hcl.com mailto:muku...@hcl.com
 *Date:* August 29, 2013, 7:00:06 AM GMT+05:30
 *To:* Bill Burke bbu...@redhat.com mailto:bbu...@redhat.com
 *Cc:* resteasy-users@lists.sourceforge.net
 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=58040911iu=/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=58040911iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Versions...

2013-08-19 Thread Bill Burke
If I knew, i'd tell you...but I don't...I've requested it be available 
for EAP 6.1

On 8/19/2013 9:25 AM, Friso Vrolijken wrote:
 Hi all,

 Does anybody know when a RestEasy 3.x version will be available in a standard 
 JBoss EAP release?

 Groeten,

 Friso

 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/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

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/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 refresh tokens?

2013-08-19 Thread Bill Burke
They haven't been implemented yet, sorry.  We're kind of limited with 
what we can do with refresh tokens as the AS7 OAuth2 integration is not 
a full-fledged auth-server that is aware of oauth.  It is bascially a 
small layer on top of JBoss Login Modules so there's a limited amount of 
information we can store.  So any implementation of refresh tokens would 
have to put a lot of trust in the OAuth client.

BTW, we're taking this OAuth/SSO stuff and starting a new project:

jboss.org/keycloak

It will take what we have in Resteasy to a new level.  We're also 
implementing a full auth-server that will also support social logins 
(Facebook et. al.)

The links for the source, wiki, and email lists are live if you want to 
participate in discussions, but we don't plan on an initial release 
until September/October.




On 8/19/2013 10:28 AM, Doug Toppin wrote:
 As I understand it, refresh tokens can be requested along with a token
 after authentication and can be used to automatically continue a session
 when the token expires.  I see a few references in the RestEasy
 3.0.2.Final code to them (getters and setters) but I don't see them
 actually be used.   Are refresh tokens as defined by the OAuth2 spec
 fully implemented?

 Doug



 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/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

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] RESTEasy 3.x with JBoss AS 6.x

2013-08-19 Thread Bill Burke
Resteasy 3 should work. What is your problem?

On 8/19/2013 4:36 PM, Daniel Kirkdorffer wrote:
 I'm trying to determine how to get a JAX-RS 2.0 RESTEasy based web
 service (within a WAR) configured for deployment on JBoss AS 6, but I'm
 having trouble finding information about how to do so.

 Is this a supported configuration, or do I have to use JAX-RS 1.x if I'm
 running against JBoss AS 6?

 Any help would be appreciated.

 Thanks,

 Dan

 ---
 /Daniel Kirkdorffer/
 /danki...@comcast.net/ mailto:danki...@comcast.net



 --
 Introducing Performance Central, a new site from SourceForge and
 AppDynamics. Performance Central is your source for news, insights,
 analysis and resources for efficient Application Performance Management.
 Visit us today!
 http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/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

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] java.lang.NoSuchMethodError: javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/BootstrapConfiguration

2013-08-13 Thread Bill Burke
remove the validation jars from your deployment:

*validator*.jar

On 8/13/2013 3:25 AM, 刘日新 wrote:
 HI, all.

 This is a NOSuchMethodError occurred with resteasy 3.0.2, 3.0.5, my
 local web server was tomcat 7.9, jdk: oracle jdk 7.

 The scraps of web.xml:

 servlet

 servlet-name_Resteasy_/servlet-name

 servlet-class

  org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher

 /servlet-class

 /servlet

 servlet-mapping

 servlet-name_Resteasy_/servlet-name

 url-pattern/rest/*/url-pattern

 /servlet-mapping

 context-param

 param-nameresteasy.servlet.mapping.prefix/param-name

 param-value/rest/param-value

 /context-param

 context-param

 param-nameresteasy.scan.resources/param-name

 param-valuetrue/param-value

 /context-param

 The detail of exception stack was:

 SEVERE: Exception starting filter
 org.jboss.resteasy.plugins.server.servlet.Filter30Dispatcher

 java.lang.NoSuchMethodError:
 javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/BootstrapConfiguration;

  at
 org.jboss.resteasy.plugins.validation.ValidatorContextResolver.getContext(_ValidatorContextResolver.java:73_)

  at
 org.jboss.resteasy.plugins.validation.ValidatorContextResolver.getContext(_ValidatorContextResolver.java:30_)

  at
 org.jboss.resteasy.spi.ResteasyProviderFactory$1.getContext(_ResteasyProviderFactory.java:2154_)

  at
 org.jboss.resteasy.core.ResourceMethodInvoker.init(_ResourceMethodInvoker.java:115_)

  at
 org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(_ResourceMethodRegistry.java:280_)

  at
 org.jboss.resteasy.core.ResourceMethodRegistry.register(_ResourceMethodRegistry.java:251_)

  at
 org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(_ResourceMethodRegistry.java:221_)

  at
 org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(_ResourceMethodRegistry.java:193_)

  at
 org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(_ResourceMethodRegistry.java:179_)

  at
 org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(_ResourceMethodRegistry.java:156_)

  at
 org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(_ResourceMethodRegistry.java:75_)

  at
 org.jboss.resteasy.spi.ResteasyDeployment.registration(_ResteasyDeployment.java:400_)

  at
 org.jboss.resteasy.spi.ResteasyDeployment.start(_ResteasyDeployment.java:241_)

  at
 org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(_ServletContainerDispatcher.java:112_)

  at
 org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.init(_FilterDispatcher.java:42_)

  at
 org.apache.catalina.core.ApplicationFilterConfig.initFilter(_ApplicationFilterConfig.java:281_)

  at
 org.apache.catalina.core.ApplicationFilterConfig.getFilter(_ApplicationFilterConfig.java:262_)

  at
 org.apache.catalina.core.ApplicationFilterConfig.init(_ApplicationFilterConfig.java:107_)

  at
 org.apache.catalina.core.StandardContext.filterStart(_StandardContext.java:4746_)

  at
 org.apache.catalina.core.StandardContext.startInternal(_StandardContext.java:5399_)

  at
 org.apache.catalina.util.LifecycleBase.start(_LifecycleBase.java:150_)

  at
 org.apache.catalina.core.ContainerBase$StartChild.call(_ContainerBase.java:1559_)

  at
 org.apache.catalina.core.ContainerBase$StartChild.call(_ContainerBase.java:1549_)

  at java.util.concurrent.FutureTask$Sync.innerRun(_FutureTask.java:334_)

  at java.util.concurrent.FutureTask.run(_FutureTask.java:166_)

  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:722_)

 八月13, 2013 3:24:04 下午org.apache.catalina.core.StandardContext
 startInternal

 SEVERE: Error filterStart

 Who could help me ? any advice will be appropriated.

 Best Regards.

 Rixin Liu



 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/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

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes

Re: [Resteasy-users] Why is GenericEntity an abstract class?

2013-08-13 Thread Bill Burke
THe sole purpose of GenericEntity (and GenericType) is Java type 
erasure.  Take this example:

ListCustomer list = ...;

return Response.ok(list).build();


With this, Resteasy has no clue about the generic type of list.  All 
it knows is that it is a java.util.List.  Java just doesn't let you 
derive the generic type at runtime.  GenericEntity/Type is a hack. 
Generic type information of extended superclasses *IS* stored and 
remembered by the java runtime.  So this anonymous class is using this 
trick to obtain generic type information.  Follow now?

On 8/13/2013 10:55 AM, Juergen Zimmermann wrote:
 When I need an instance of GenericEntity I've to create an object of an
 anonymous class derived from GenericEntity. Therefore, I'm wondering why
 GenericEntity isn't a concrete class? Any hint is appreciated.

 Regards,
 Juergen


 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/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

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Transfer security context to EJB layer

2013-08-12 Thread Bill Burke
It should transfer.

On 8/12/2013 9:01 AM, Jose Miguel Barone Mattos wrote:
 Hi!
 I want to know if it's possible to call an ejb service that inherits the
 security information from the web layer, when the rest service resides.

 thanks.




 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/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

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Unit Testing Exception Mappers

2013-08-09 Thread Bill Burke
Create a a ResteasyDeployment, add necessary components to it, call 
start() get the dispatch, create the mocks.

On 8/9/2013 10:51 AM, Adam Hotz wrote:
 Hi

 I'm using RestEasy to implement a web service. I was previously using
 the resteasy mock objects to mock requests and also to test my custom
 exception mappers. I was testing the mappers by adding them to a mock
 dispatcher as suggested by the answer to this stack overflow question:
 http://stackoverflow.com/questions/5866695/resteasy-server-mock-exceptionmapper-not-found
 i.e

 |dispatcher.getProviderFactory().addExceptionMapper(SomeExceptionMapper.class);|


 However a recent patch
 (https://github.com/resteasy/Resteasy/commit/16721d16b235ea7a6918ae8bdecb04b73bd59204)
 has changed the access modifier of addExceptionMapper from public to
 protected, which means that I can no longer do this. Is there a
 recommended alternative for including ExceptionMappers in my Unit Tests?

 Regards,
 Adam Hotz



 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/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

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/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.3 released

2013-08-06 Thread Bill Burke
Follow the links at http://jboss.org/resteasy to download and view 
release notes.  The was just a maintenance release fixing a few minor 
bugs in async and cookie parsing.

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

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] OAuth 2 skeleton key roles generated externally?

2013-07-26 Thread Bill Burke
Take a look at this class.  You may have to regenerate the principal and 
reset it for the catalina request and session.

https://github.com/resteasy/Resteasy/blob/master/jaxrs/security/skeleton-key-idm/skeleton-key-as7/src/main/java/org/jboss/resteasy/skeleton/key/as7/CatalinaSecurityContextHelper.java

  GenericPrincipal principal = new 
CatalinaSecurityContextHelper().createPrincipal(context.getRealm(), skp, 
roles);
  Session session = request.getSessionInternal(true);
  session.setPrincipal(principal);
  session.setAuthType(OAUTH);

I don't remember how JBossWeb does the servlet-tiers constraint checks. 
  This code is actually very nasty.  I figured it out once then never 
looked at it again.




On 7/25/2013 2:33 PM, Doug Toppin wrote:
 I'm using the Resteasy OAuth 2 skeleton key and would like to add my own 
 custom roles from an external source to the principal after the 
 authentication and managed resource valves have finished.  I am trying a 
 ValveBase class to be stacked along with the auth valves but because 
 GenericPrincipal roles are immutable I don't see a way to add to the list 
 once GP has been generated.  Am I missing something in how to do this?  I am 
 trying not to modify any skeleton key code and wanted it to be an add-on if 
 possible.  Suggestions/examples are appreciated.

 Doug


 --
 See everything from the browser to the database with AppDynamics
 Get end-to-end visibility with application monitoring from AppDynamics
 Isolate bottlenecks and diagnose root cause in seconds.
 Start your free trial of AppDynamics Pro today!
 http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/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

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Custom principal is not propagated to ejb session context (resteasy3 + oauth)

2013-07-11 Thread Bill Burke
You will not get your custom principal.  For BearerTokenAuth, it never 
touches the login module, so your custom principal will never be created 
and propagated.  The Principal is generated from the Token.

On 7/5/2013 4:48 AM, marcel rovira wrote:
 Hello,

 I'm using resteasy 3.0.1 Final with oauth in JBoss 6.1 EAP and my custom
 principal class is not propagated to sessioncontext in an EJB3.
 Oauth is configured as BearerTokenAuthenticator only

 My login-module configuration in standalone.xml to use extended login module

 login-module
 code=es.gc.epsilon.secure.api.shared.resources.MyDatabaseServerLoginModule
 flag=required
   module-option name=dsJndiName
 value=java:jboss/datasources/EpsilonXADS/
   module-option name=principalsQuery value=select PASSWORD from
 EP_USER where name=?/
   module-option name=rolesQuery value=select ROLE_NAME, 'Roles' from
 EP_USER_ROLE where USER_NAME = ?/
   module-option name=hashAlgorithm value=MD5/
   module-option name=hashEncoding value=base64/
   module-option name=unauthenticatedIdentity value=guest/
 /login-module

 My DatabaseServerLoginModule:

 public class MyDatabaseServerLoginModule extends DatabaseServerLoginModule {

@Override
protected java.security.Principal createIdentity(String username)
 throws Exception {

  System.out.println(createIdentity BEGIN);

  MyCustomPrincipal p = null;
  if (principalClassName == null) {
p = new MyCustomPrincipal(username);
  } else {
p = (MyCustomPrincipal) super.createIdentity(username);
  }

  return p;
}
 ...


 My custom principal


 public class MyCustomPrincipal extends SimplePrincipal implements
 Serializable {

private static final long serialVersionUID = 1L;

private String tenant;

public MyCustomPrincipal(String name) {
  super(name);
  // TODO Auto-generated constructor stub
}
 ...

 My oauth server configuration:

 jboss-web.xml
 jboss-web
  security-domainjava:/jaas/jaasEpsilon/security-domain
  valve

 class-nameorg.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve/class-name
  /valve
 /jboss-web


 My api rest configuration project:

 web.xml

   login-config
auth-methodBASIC/auth-method
realm-namejaasEpsilon/realm-name
   /login-config

security-constraint
web-resource-collection
 web-resource-nameAll resources/web-resource-name
 descriptionProtects all resources/description
 url-pattern/api/secure/*/url-pattern
 http-methodGET/http-method
 http-methodPOST/http-method
/web-resource-collection
auth-constraint
 role-nameadmin/role-name
 role-nameemployee/role-name
/auth-constraint
   /security-constraint
  context-param
param-nameresteasy.role.based.security/param-name
param-valuetrue/param-value
 /context-param
 jboss-deployment-structure

 jboss-deployment-structure
  deployment
  dependencies
  module name=org.jboss.resteasy.resteasy-jaxrs
 services=import/
  module name=org.jboss.resteasy.resteasy-jackson-provider
 services=import/
  module name=org.jboss.resteasy.skeleton-key/
  /dependencies
  /deployment
 /jboss-deployment-structure

 jboss-web.xml
 jboss-web
  valve

 class-nameorg.jboss.resteasy.skeleton.key.as7.BearerTokenAuthenticatorValve/class-name
  /valve
 /jboss-web


  From an EJB I extract principal info as

 @Resource(name = sessionContext)
 private SessionContext sctx;
 ...
 Principal principal = sctx.getCallerPrincipal();
 if (!(principal instanceof MyCustomPrincipal)) {
System.out.println(I expected a  +
 MyCustomPrincipal.class.getName() +  but got a 
  + principal.getClass().getName() +  instead !!);



 and the result is:
 I expected a es.gc.epsilon.secure.api.shared.resources.MyCustomPrincipal
 but got a org.jboss.resteasy.skeleton.key.SkeletonKeyPrincipal instead

 Is this a bug, is there another way to retrieve the caller principal, is
 there any wrong configuration?

 Thanks.

 Marcel.


 --
 This SF.net email is sponsored by Windows:

 Build for Windows Store.

 http://p.sf.net/sfu/windows-dev2dev



 ___
 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

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net

Re: [Resteasy-users] resteasy-jaxrs-3.0-beta-5 oauth2 example deploy to domain fail?

2013-06-05 Thread Bill Burke
I'll check it out.  JBoss Modules was a bit quirky. Probably user error 
though.

On 6/5/2013 11:55 AM, Doug Toppin wrote:
 I'm using resteasy-jaxrs-3.0-beta-5 and want to deploy the oauth2
 skeleton code examples into a JBoss EAP 6.0.1 domain and getting this
 error on the deploy (deploying via the cli and getting a rollback):

 11:17:00,567 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7)
 MSC01: Failed to start service
 jboss.module.service.deployment.auth-server.war.main:
 org.jboss.msc.service.StartException in service
 jboss.module.service.deployment.auth-server.war.main: JBAS018759:
 Failed to load module: deployment.auth-server.war:main
 at
 org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:92)
 [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
 at
 org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
 [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
 at
 org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
 [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 [rt.jar:1.7.0_17]
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 [rt.jar:1.7.0_17]
 at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
 Caused by: org.jboss.modules.ModuleNotFoundException: Module
 org.jboss.resteasy.security.smime.MultipartSignedReader:main is not
 found in local module loader @7bf5f379 (roots:
 /Users/dougtoppin/Desktop/JBoss/jboss-eap-6.0/modules)
 at
 org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126)
 [jboss-modules.jar:1.1.3.GA-redhat-1]
 at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275)
 [jboss-modules.jar:1.1.3.GA-redhat-1]
 at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222)
 [jboss-modules.jar:1.1.3.GA-redhat-1]
 at
 org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94)
 [jboss-modules.jar:1.1.3.GA-redhat-1]
 at org.jboss.modules.Module.addPaths(Module.java:851)
 [jboss-modules.jar:1.1.3.GA-redhat-1]
 at org.jboss.modules.Module.link(Module.java:1206)
 [jboss-modules.jar:1.1.3.GA-redhat-1]
 at org.jboss.modules.Module.relinkIfNecessary(Module.java:1235)
 [jboss-modules.jar:1.1.3.GA-redhat-1]
 at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:208)
 [jboss-modules.jar:1.1.3.GA-redhat-1]
 at
 org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:71)
 [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
 ... 5 more


 11:17:00,772 INFO  [org.jboss.as.server]
 (host-controller-connection-threads - 4) JBAS015870: Deploy of
 deployment auth-server.war was rolled back with failure message
 {JBAS014671: Failed services =
 {jboss.module.service.\deployment.auth-server.war\.main =
 org.jboss.msc.service.StartException in service
 jboss.module.service.\deployment.auth-server.war\.main: JBAS018759:
 Failed to load module: deployment.auth-server.war:main
  Caused by: org.jboss.modules.ModuleNotFoundException: Module
 org.jboss.resteasy.security.smime.MultipartSignedReader:main is not
 found in local module loader @7bf5f379 (roots:
 /Users/dougtoppin/Desktop/JBoss/jboss-eap-6.0/modules)},JBAS014771:
 Services with missing/unavailable dependencies =
 [jboss.deployment.unit.\auth-server.war\.POST_MODULE
 Missing[JBAS014861: one or more transitive dependencies]]}


 In a standalone deployment via maven the same warning occurs but maven
 does a force and the examples still work.  I have not been able to to do
 a force in domain mode and it rolls the deploy back.
 For domain mode I copied the mods from the standalone.xml to my
 domain.xml to try to try to get the example to work in domain mode.

 Has anyone seen and/or solved this?   I would appreciate any tips on
 what to do about this.

 tks
 Doug



 --
 How ServiceNow helps IT people transform IT departments:
 1. A cloud service to automate IT design, transition and operations
 2. Dashboards that offer high-level views of enterprise services
 3. A single system of record for all IT processes
 http://p.sf.net/sfu/servicenow-d2d-j



 ___
 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

--
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
___
Resteasy-users

Re: [Resteasy-users] Duplicate client_id query parameter in redirect url to OAuth SSO server.

2013-05-27 Thread Bill Burke
Looks like a benign bug :)

On 5/25/2013 6:33 PM, Charles wrote:
 Hi,

 When the browser is redirected to the SSO server for authentication of
 my jax-rs api, the url contains a duplicate of the client_id query
 parameter as shown below:

 https://sso.foobar.com/login.jsp?client_id=chickenfooclient_id=chickenfooredirect_uri=https%3A%2F%2Fapi.foobar.com%2Fv1%2Fsearch%2Fphotos%2Fcamera%2Fcanonstate=0%2Fd3d25f58-505c-43ef-9300-83111ea19fd5login=true
 https://sso.pixsteric.com/login.jsp?client_id=pixstericclient_id=pixstericredirect_uri=https%3A%2F%2Fapi.pixsteric.com%2Fv1%2Fsearch%2Fphotos%2Fcamera%2Fcanonstate=0%2Fd3d25f58-505c-43ef-9300-83111ea19fd5login=true

 Is this a bug?


 --
 Try New Relic Now  We'll Send You this Cool Shirt
 New Relic is the only SaaS-based application performance monitoring service
 that delivers powerful full stack analytics. Optimize and monitor your
 browser, app,  servers with just a few lines of code. Try New Relic
 and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may



 ___
 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

--
Try New Relic Now  We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app,  servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] ObjectMapper problems with Resteasy 3.0 beta5

2013-05-27 Thread Bill Burke
, entityStream);
 }

 }


 @Provider
 public class CustomObjectMapperProvider implements
 ContextResolverObjectMapper {
  private ObjectMapper mapper;
  public static final String DATE_FORMAT = -MM-dd HH:mm:ss;
  private Logger log = Logger.getLogger( this.getClass() );

  public CustomObjectMapperProvider() throws Exception {
  this.mapper = new ObjectMapper();
 mapper.registerModule( new Hibernate4Module().configure(
 Hibernate4Module.Feature.FORCE_LAZY_LOADING, false ) );
 mapper.setDateFormat( new SimpleDateFormat(DATE_FORMAT) );
 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
 mapper.setSerializationInclusion( Include.NON_NULL);
 mapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
 mapper.configure( MapperFeature.AUTO_DETECT_FIELDS, true );
 mapper.setAnnotationIntrospector( new JacksonAnnotationIntrospector() );
 log.info http://log.info( FooBar API CustomObjectMapperProvider
 initialized successfully );
  }
  public ObjectMapper getContext(Class? objectType) {
 log.info http://log.info( getMapper called );
  return mapper;
  }
 }


 But it seems my ObjectMapper context resolver isn't being called when an
 object mapper is needed.

 By the way, the source for the POJO involved in the exception can be
 found here:
 https://github.com/resteasy/Resteasy/blob/master/jaxrs/security/skeleton-key-idm/skeleton-key-core/src/main/java/org/jboss/resteasy/skeleton/key/representations/AccessTokenResponse.java


 Any help would be greatly appreciated.

 Thanks.


 --
 Try New Relic Now  We'll Send You this Cool Shirt
 New Relic is the only SaaS-based application performance monitoring service
 that delivers powerful full stack analytics. Optimize and monitor your
 browser, app,  servers with just a few lines of code. Try New Relic
 and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may



 ___
 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

--
Try New Relic Now  We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app,  servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Slow PUT request payload processing in client framework

2013-05-23 Thread Bill Burke
. Optimize and monitor your
 browser, app,  servers with just a few lines of code. Try New Relic
 and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may



 ___
 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

--
Try New Relic Now  We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app,  servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Resteasy 3.0-beta-4 oreilly-workbook-as7 ex11_1 example fails on AS 7.1.1.Final

2013-04-23 Thread Bill Burke


On 4/23/2013 1:28 PM, Tom Coleman wrote:


 On Apr 23, 2013, at 9:27 AM, Bill Burke wrote:

 First apologies.  This is a beta and I didn't really go through and
 manually test the examples that were not automated.  I'm currently
 working on greatly improving the JBoss examples so that you do not have
 to download or manually start a jboss instance.

 If I may make a suggestion...

 It would be good if you could include a working ear-ejb-war example for 
 AS7/EAP 6.
 I've really struggled with getting this type of application working in AS7, 
 and I'm not there yet.

 You talked about removing the ejb-integration example.  I don't think it 
 would be hard (for you)
 to package it as an AS7 test.

 I understand how you might want to showcase how simple you can make EJB 
 integration, but I think
 the ear-ejb-war example is an important one for those of us who are faced 
 with having to deploy
 applications currently running in competitive REST implementations.


FOr standard Java EE 6 integration, JAX-RS EJBs can only be in the 
WEB-INF/classes or a ejb-jar within WEB-INF/lib.  Any other deployment 
combination needs to do resteasy specific integration (the jndi ref 
stuff) and you're stuck with SLSBs only and parameter-only injection.


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

--
Try New Relic Now  We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app,  servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] JAX-RS 2.0: Properties for username and password

2013-04-22 Thread Bill Burke
It didn't make the spec.  Stupid right?  I tried, honestly I tried.  I 
was able to at least get SSL support in there.  For Resteasy you can 
either use Apache HTTp Client and set it up there.  I also have 
implement basic auth in a filter:

https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-client/src/main/java/org/jboss/resteasy/client/jaxrs/BasicAuthentication.java

Just do:

WebTarget target = ...;
target.register(new BasicAuthentication(username, password));

On 4/22/2013 6:58 AM, Juergen Zimmermann wrote:
 As I understand, the new client API of JAX-RS 2.0 provides a properties
 as follows:

 ClientBuilder.newClient().target(http://...;).getConfiguration().property(name,
 value);

 What are the property names for username and password when the server
 requires BASIC authentication?



 --
 Precog is a next-generation analytics platform capable of advanced
 analytics on semi-structured data. The platform includes APIs for building
 apps and a phenomenal toolset for data science. Developers can use
 our toolset for easy data analysis  visualization. Get a free account!
 http://www2.precog.com/precogplatform/slashdotnewsletter



 ___
 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

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] OAuth2 example - different roles per REST Method

2013-04-16 Thread Bill Burke
OAuth2 does not define the token format.  We have defined our own token 
format that transmits signed role-mapping metadata.

Check this out:

http://docs.jboss.org/resteasy/docs/3.0-beta-4/userguide/html/oauth2.html#d4e1454

An Oauth client in skeleton key can be assigned a set of roles that it 
is allowed to assume.  So, even though a specific user might have 
admin and user permissions, you can specify in the oauth client 
role mapping that the oauth client is only allowed to assume user 
permissions.  Please read the linked documentation and get back to this 
list if you have more questions.

FYI, because our OAuth2 code reuses and is built on top of JBoss's 
existing Security Domain APIs there's only so much flexibility that can 
be provided.  In the future, I have plans to leverage the new IDM API in 
AS8 so that you can do more complex role mappings and OAuth2 scopes . 
Right now you're limited to what the documentation specifies.  Please 
get back to me.  I want to know if what we have is good enough for now, 
or if it is unusable.

On 4/16/2013 9:17 AM, Doug Schnelzer wrote:
 Thanks.  As a follow up, I'd like to request a bearer token but limit
 the Roles identified in the bearer token.  I'm looking
 at org.jboss.resteasy.example.oauth.ProductDatabaseClient.  Would it be
 right to look that the Access Token Scope to try and accomplish this.
   What I'm trying to do is have a set of REST services protected using
 the @RolesAllowed and a less sensitive role.  Even though the Resource
 Owner may have access to more sensitive roles, I don't wan the bearer
 token being given to the client to have all of these roles.  I'm working
 my way through
 org.jboss.resteasy.skeleton.key.servlet.ServletOAuthClient and mapping
 to the OAuth2 spec, but would welcome any guidance pointing me in the
 right direction.


 --
 Precog is a next-generation analytics platform capable of advanced
 analytics on semi-structured data. The platform includes APIs for building
 apps and a phenomenal toolset for data science. Developers can use
 our toolset for easy data analysis  visualization. Get a free account!
 http://www2.precog.com/precogplatform/slashdotnewsletter



 ___
 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

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] OAuth2 example - different roles per REST Method

2013-04-16 Thread Bill Burke
So you want to specify user, client-id, and their credentials and get 
back a token that is limited to what the client-id is allowed to get? 
All in one request?  I don't have an API for this at the moment.

On 4/16/2013 11:50 AM, Doug Schnelzer wrote:
 So continuing to peel back the onion... and getting somewhere...

 Thanks for the pointers.  I re-read the docs especially around

 http://docs.jboss.org/resteasy/docs/3.0-beta-4/userguide/html/oauth2.html#d4e1454

 I noticed that the commerce-roles.properties for the current OAuth2
 examples has the following:

 bbu...@redhat.com mailto:bbu...@redhat.com=user,products
 admin=admin
 customer-portal=login
 product-portal=login
 third-party=oauth,*

 I see that the oauth-client-example project is using the client-id
 third-party which is specified in
 the org.jboss.resteasy.example.oauth.Bootstrap.contextInitialized().
   What I want to do is to get a bearer tokan programmatically as is done
 in as is done in the client-grant example
 (i.e. org.jboss.resteasy.example.oauth.ProductDatabaseClient.getProducts()
 ) but I want to specify the client-id so that I can limit the roles that
 are encoded in the bearer token.  My assumption is that
 since org.jboss.resteasy.example.oauth.ProductDatabaseClient.getProducts()
 is using basic authentication to the auth server that the bearer token
 returned will have all roles for bbu...@redhat.com
 mailto:bbu...@redhat.com.

 So my question is can I easily modify the
 ProductDatabaseClient.getProducts() so that I am specifying a client-id
 for the resulting bearer token and if so can you point at the right part
 of the API that I should be looking at?

 Thanks much,
 Doug

 On Tue, Apr 16, 2013 at 9:33 AM, Bill Burke bbu...@redhat.com
 mailto:bbu...@redhat.com wrote:

 OAuth2 does not define the token format.  We have defined our own token
 format that transmits signed role-mapping metadata.

 Check this out:

 
 http://docs.jboss.org/resteasy/docs/3.0-beta-4/userguide/html/oauth2.html#d4e1454

 An Oauth client in skeleton key can be assigned a set of roles that it
 is allowed to assume.  So, even though a specific user might have
 admin and user permissions, you can specify in the oauth client
 role mapping that the oauth client is only allowed to assume user
 permissions.  Please read the linked documentation and get back to this
 list if you have more questions.

 FYI, because our OAuth2 code reuses and is built on top of JBoss's
 existing Security Domain APIs there's only so much flexibility that can
 be provided.  In the future, I have plans to leverage the new IDM API in
 AS8 so that you can do more complex role mappings and OAuth2 scopes .
 Right now you're limited to what the documentation specifies.  Please
 get back to me.  I want to know if what we have is good enough for now,
 or if it is unusable.

 On 4/16/2013 9:17 AM, Doug Schnelzer wrote:
   Thanks.  As a follow up, I'd like to request a bearer token but limit
   the Roles identified in the bearer token.  I'm looking
   at org.jboss.resteasy.example.oauth.ProductDatabaseClient.  Would
 it be
   right to look that the Access Token Scope to try and accomplish this.
 What I'm trying to do is have a set of REST services protected
 using
   the @RolesAllowed and a less sensitive role.  Even though the
 Resource
   Owner may have access to more sensitive roles, I don't wan the bearer
   token being given to the client to have all of these roles.  I'm
 working
   my way through
   org.jboss.resteasy.skeleton.key.servlet.ServletOAuthClient and
 mapping
   to the OAuth2 spec, but would welcome any guidance pointing me in the
   right direction.
  
  
  
  

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



 --
 Precog is a next-generation analytics platform capable of advanced
 analytics on semi-structured data. The platform includes APIs for building
 apps and a phenomenal toolset for data science. Developers can use
 our toolset for easy data analysis  visualization. Get a free account!
 http://www2.precog.com/precogplatform/slashdotnewsletter



 ___
 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

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform

Re: [Resteasy-users] Resteasy 3.0-beta-4 ejb-integrtation-test fails on AS 7.1.1.Final

2013-04-11 Thread Bill Burke
: Deploy of deployment ejb-integration-test.ear was rolled back 
 with failure message {JBAS014671: Failed services = 
 {jboss.deployment.subunit.\ejb-integration-test.ear\.\ejb-test-3.0-beta-4.jar\.POST_MODULE
  = org.jboss.msc.service.StartException in service 
 jboss.deployment.subunit.\ejb-integration-test.ear\.\ejb-test-3.0-beta-4.jar\.POST_MODULE:
  Failed to process phase POST_MODULE of subdeployment 
 \ejb-test-3.0-beta-4.jar\ of deployment \ejb-integration-test.ear\}}
 19:33:48,547 INFO  [org.jboss.as.server.deployment] (MSC service thread 
 1-10) JBAS015877: Stopped deployment ejb-test-3.0-beta-4.jar in 13ms
 19:33:48,548 INFO  [org.jboss.as.server.deployment] (MSC service thread 
 1-14) JBAS015877: Stopped deployment ejb-test-war-3.0-beta-4.war in 14ms
 19:33:48,550 INFO  [org.jboss.as.server.deployment] (MSC service thread 
 1-13) JBAS015877: Stopped deployment ejb-integration-test.ear in 15ms


 --
 Precog is a next-generation analytics platform capable of advanced
 analytics on semi-structured data. The platform includes APIs for building
 apps and a phenomenal toolset for data science. Developers can use
 our toolset for easy data analysis  visualization. Get a free account!
 http://www2.precog.com/precogplatform/slashdotnewsletter
 ___
 Resteasy-users mailing list
 Resteasy-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/resteasy-users


 --
 Precog is a next-generation analytics platform capable of advanced
 analytics on semi-structured data. The platform includes APIs for building
 apps and a phenomenal toolset for data science. Developers can use
 our toolset for easy data analysis  visualization. Get a free account!
 http://www2.precog.com/precogplatform/slashdotnewsletter
 ___
 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

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] NettyJaxrsServer not injecting @CookieParam

2013-03-14 Thread Bill Burke
Hmmm, it should understand CookieParam.

Inject @Context HttpHeaders.  See if there are Cookie headers.  I'll 
try and reproduce on my end too.

On 3/14/2013 8:34 AM, paul.ti...@rbs.com wrote:
 Hi all,
 I was hoping someone would be able to help with an issue I'm having
 setting up an embedded NettyJaxrsServer (for the purpose of testing).
 Basically, I'm trying to write integration tests for a fairly simple
 REST service implemented using RESTeasy 2.3.5.  Testing using JUnit and
 REST-assured.
 Spawning up my service on JBoss and testing against the URL works fine,
 however I'd like to use an embedded server so the tests can be automated
 into the CI build.
 I initially started trying to use a TJWSEmbeddedJaxrsServer, however I
 encountered insurmountable (for me) difficulties related to security.
 My REST service is simple, however, the request sends a security token
 inside a cookie, which my server authorises against another service over
 https.  There is a truststore involved aswell, and basically I couldn't
 get past SSL related code explosions... probably related to the
 following snippet from the RESTEasy user guide:
 http://docs.jboss.org/resteasy/docs/2.3.5.Final/userguide/html/RESTEasy_Embedded_Container.html#d4e1366
 /The server can either host non-encrypted or SSL based resources, but
 not both./
 So, I tried my hand at using the NettyJaxrsServer.  I was expecting more
 of the same, but lo and behold, no SSL issues.  Sadly, life is not that
 kind, and my next stumbling block (and finally getting to the point of
 this email) is that the cookie in the request is not getting injected
 into my GET method:
 @GET()
 @Produces(MediaType.APPLICATION_JSON)
 @Path(data)
 public Response getData(@CookieParam(COOKIE_PARAMETER_NAME) String
 securityToken) { ... }
 Example REST-assured request:
 given().cookie(securityToken).get(serviceUrl).prettyPrint();
 This works fine using the TJWSEmbeddedJaxrsServer, and when hosted on
 JBoss, however when using the NettyJaxrsServer, securityToken is null
 (it is definitely present in the request).
 Does the NettyJaxrsServer not understand @CookieParam, or am I doing
 something wrong or not doing something I should?
 Any help is greatly appreciated.
 Thanks
 Paul

 ***

 The Royal Bank of Scotland plc. Registered in Scotland No 90312.
 Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
 Authorised and regulated by the Financial Services Authority. The
 Royal Bank of Scotland N.V. is authorised and regulated by the
 De Nederlandsche Bank and has its seat at Amsterdam, the
 Netherlands, and is registered in the Commercial Register under
 number 33002587. Registered Office: Gustav Mahlerlaan 350,
 Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and
 The Royal Bank of Scotland plc are authorised to act as agent for each
 other in certain jurisdictions.

 This e-mail message is confidential and for use by the addressee only.
 If the message is received by anyone other than the addressee, please
 return the message to the sender by replying to it and then delete the
 message from your computer. Internet e-mails are not necessarily
 secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland
 N.V. including its affiliates (RBS group) does not accept responsibility
 for changes made to this message after it was sent. For the protection
 of RBS group and its clients and customers, and in compliance with
 regulatory requirements, the contents of both incoming and outgoing
 e-mail communications, which could include proprietary information and
 Non-Public Personal Information, may be read by authorised persons
 within RBS group other than the intended recipient(s).

 Whilst all reasonable care has been taken to avoid the transmission of
 viruses, it is the responsibility of the recipient to ensure that the
 onward
 transmission, opening or use of this message and any attachments will
 not adversely affect its systems or data. No responsibility is accepted
 by the RBS group in this regard and the recipient should carry out such
 virus and other checks as it considers appropriate.

 Visit our website at www.rbs.com

 ***



 --
 Everyone hates slow websites. So do we.
 Make your web apps faster with AppDynamics
 Download AppDynamics Lite for free today:
 http://p.sf.net/sfu/appdyn_d2d_mar



 ___
 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

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics

Re: [Resteasy-users] NettyJaxrsServer not injecting @CookieParam

2013-03-14 Thread Bill Burke
With a simple test (a Resteasy client), CookieParam works, and Cookie is 
also in HttpHeaders.  Let me know what you find out.

On 3/14/2013 10:25 AM, Bill Burke wrote:
 Hmmm, it should understand CookieParam.

 Inject @Context HttpHeaders.  See if there are Cookie headers.  I'll
 try and reproduce on my end too.

 On 3/14/2013 8:34 AM, paul.ti...@rbs.com wrote:
 Hi all,
 I was hoping someone would be able to help with an issue I'm having
 setting up an embedded NettyJaxrsServer (for the purpose of testing).
 Basically, I'm trying to write integration tests for a fairly simple
 REST service implemented using RESTeasy 2.3.5.  Testing using JUnit and
 REST-assured.
 Spawning up my service on JBoss and testing against the URL works fine,
 however I'd like to use an embedded server so the tests can be automated
 into the CI build.
 I initially started trying to use a TJWSEmbeddedJaxrsServer, however I
 encountered insurmountable (for me) difficulties related to security.
 My REST service is simple, however, the request sends a security token
 inside a cookie, which my server authorises against another service over
 https.  There is a truststore involved aswell, and basically I couldn't
 get past SSL related code explosions... probably related to the
 following snippet from the RESTEasy user guide:
 http://docs.jboss.org/resteasy/docs/2.3.5.Final/userguide/html/RESTEasy_Embedded_Container.html#d4e1366
 /The server can either host non-encrypted or SSL based resources, but
 not both./
 So, I tried my hand at using the NettyJaxrsServer.  I was expecting more
 of the same, but lo and behold, no SSL issues.  Sadly, life is not that
 kind, and my next stumbling block (and finally getting to the point of
 this email) is that the cookie in the request is not getting injected
 into my GET method:
 @GET()
 @Produces(MediaType.APPLICATION_JSON)
 @Path(data)
 public Response getData(@CookieParam(COOKIE_PARAMETER_NAME) String
 securityToken) { ... }
 Example REST-assured request:
 given().cookie(securityToken).get(serviceUrl).prettyPrint();
 This works fine using the TJWSEmbeddedJaxrsServer, and when hosted on
 JBoss, however when using the NettyJaxrsServer, securityToken is null
 (it is definitely present in the request).
 Does the NettyJaxrsServer not understand @CookieParam, or am I doing
 something wrong or not doing something I should?
 Any help is greatly appreciated.
 Thanks
 Paul

 ***

 The Royal Bank of Scotland plc. Registered in Scotland No 90312.
 Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
 Authorised and regulated by the Financial Services Authority. The
 Royal Bank of Scotland N.V. is authorised and regulated by the
 De Nederlandsche Bank and has its seat at Amsterdam, the
 Netherlands, and is registered in the Commercial Register under
 number 33002587. Registered Office: Gustav Mahlerlaan 350,
 Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and
 The Royal Bank of Scotland plc are authorised to act as agent for each
 other in certain jurisdictions.

 This e-mail message is confidential and for use by the addressee only.
 If the message is received by anyone other than the addressee, please
 return the message to the sender by replying to it and then delete the
 message from your computer. Internet e-mails are not necessarily
 secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland
 N.V. including its affiliates (RBS group) does not accept responsibility
 for changes made to this message after it was sent. For the protection
 of RBS group and its clients and customers, and in compliance with
 regulatory requirements, the contents of both incoming and outgoing
 e-mail communications, which could include proprietary information and
 Non-Public Personal Information, may be read by authorised persons
 within RBS group other than the intended recipient(s).

 Whilst all reasonable care has been taken to avoid the transmission of
 viruses, it is the responsibility of the recipient to ensure that the
 onward
 transmission, opening or use of this message and any attachments will
 not adversely affect its systems or data. No responsibility is accepted
 by the RBS group in this regard and the recipient should carry out such
 virus and other checks as it considers appropriate.

 Visit our website at www.rbs.com

 ***



 --
 Everyone hates slow websites. So do we.
 Make your web apps faster with AppDynamics
 Download AppDynamics Lite for free today:
 http://p.sf.net/sfu/appdyn_d2d_mar



 ___
 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

Re: [Resteasy-users] Unable to find a MessageBodyReader of content-type text/html; charset=utf-8

2013-02-22 Thread Bill Burke
It looks like you are getting an error response from the server as the 
response body contains HTML, not the requested JSON you put in the accep 
theader.  Check the status to see if it is 200. If it is an error 
status, its probably HTML from the server
s error msg

On 2/22/2013 2:04 PM, Nuwan Bandara wrote:
 Hi,

 Thanks for your reply. Here's my code

 public ListAnalyteResult interpretResultListRemote(ListAnalyteResult
 analyteResultList) throws AREException {
  logger.debug(Start of interpretResultListRemote method);
  ListAnalyteResult interpretResultList;
  try {
  String
 wsURL=ServiceLocator.getInstance().getNichPROProperties().getProperty(REST_WS_ARE_PREFIX)
 + INTERPRET_RESULT_LIST;
  clientRequest = new ClientRequest(wsURL);
  clientRequest.accept(application/json);
  clientRequest.body(application/json, analyteResultList);
  interpretResultList =
 (ListAnalyteResult)clientRequest.post().getEntity(new
 GenericTypeListAnalyteResult(){});
 } catch (Exception e) {
  logger.error(AssayRuleEngineInvoker.class.getName() +
 :interpretResultListRemote:, e);
  throw new AREException(e);
  }
  logger.debug(End of interpretResultListRemote method);
  return interpretResultList;
  }

 Am I doing anything wrong here?

 On Thu, Feb 21, 2013 at 4:29 PM, Weinan Li l.wei...@gmail.com
 mailto:l.wei...@gmail.com wrote:



 --
 Weinan Li
 Sent with Sparrow http://www.sparrowmailapp.com/?sig

 On Friday, February 22, 2013 at 12:42 AM, Nuwan Bandara wrote:

 Hi,

 I am getting this error when I try to call one of the webservice
 in remote stateless session bean. I use JUnit to call the webservice.

 org.jboss.resteasy.client.ClientResponseFailure: Unable to find a
 MessageBodyReader of content-type text/html;charset=utf-8 and
 type
 
 java.util.Listcom.questdiagnostics.nichpro.assayruleengine.model.AnalyteResult

 btw, could you please provide some codes on how you are using the
 resteasy client  api?

 What could be the problem?

 Thanks,
 Nuwan
 
 --
 Everyone hates slow websites. So do we.
 Make your web apps faster with AppDynamics
 Download AppDynamics Lite for free today:
 http://p.sf.net/sfu/appdyn_d2d_feb
 ___
 Resteasy-users mailing list
 Resteasy-users@lists.sourceforge.net
 mailto:Resteasy-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/resteasy-users




 --
 Everyone hates slow websites. So do we.
 Make your web apps faster with AppDynamics
 Download AppDynamics Lite for free today:
 http://p.sf.net/sfu/appdyn_d2d_feb



 ___
 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

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Issue with injected ServletContext in Resteasy/SpringMVC setup

2013-02-06 Thread Bill Burke
log a jira please

On 2/6/2013 12:31 PM, Stephen Gargan wrote:
 I'm having an issue retrieving servlet parameters with a springmvc
 resteasy setup using 2.3.5.Final. A class that I have no control over
 uses the @Context to inject the ServletConfig so that it can look up an
 init-param. When this class asks the injected context for the param an
 exception  is thrown saying

 org.jboss.resteasy.spi.LoggableFailure: Unable to find contextual data
 of type: javax.servlet.ServletContext

 Digging in a little further showed that its a proxy for the
 ServletContext gets injected into the class; a
 ContextParameterInjector$GenericDelegatingProxy specifically. When the
 'getInitParameter' method is called on the proxy, it calls to the to the
 ResteasyProviderFactory to retrieve the ServletContext. This context is
 missing and so the above exception gets thrown.

  From what I can tell, it seems that the deploment gets configured
 differently using springmvc-resteasy.xml than it otherwise might with
 the plain ResteasyBootstrap. I'm thinking it boils down the the init
 method in the ServletContainerDispatcher, if the app is bootstrapped
 outside of spring it causes the following code to be run

 lines 86...89
 dispatcher.getDefaultContextObjects().put(Application.class, app);
 // push context data so we can inject it
 Map contextDataMap =
 ResteasyProviderFactory.getContextDataMap();

   contextDataMap.putAll(dispatcher.getDefaultContextObjects());

 And this makes the ServletContext available via the provider factory and
 subsequently for injection. When spring initializes the deployment the
 other path is taken and this is not called.

 I've condesed down my config into a simple maven based example to
 illustrate. Hopefully someone can point me in a direction that will help
 out here. I'm hoping there is some mechanism to configure resteasy via
 spring that will allow access to the ServletConfig. Any pointers will be
 very greatfully accepted. I'll happily provide any extra info that might
 be required to help troubleshoot.

 Thanks kindly,

 Regards

 Steve.

 p.s. apologies for the duplicated mails.


 --
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013
 and get the hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb



 ___
 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

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] POST Request URL Pattern

2013-02-01 Thread Bill Burke
Its ok to use query parameters as long as they are part of the identity 
of the resource.  IMO, don't use them to modify a resource.  Instead 
pass a representation with your POST.

On 2/1/2013 3:34 AM, Denica Gencheva wrote:
 On 01/02/2013, Nuwan Bandara mail.nu...@gmail.com wrote:
 Hi,

 I have a RESTeasy web service. It accept POST requests. As an example
 client will call the web service like this

 http://localhost:8080/n-tweb-comm-war/ws/updateResultIndicator;accessionNumber=1;analyteCode=2;workstation=3;siteCode=4;testIndicator=5;testStatus=66

 My question;

 1. is this a proper way to call POST web service?
 2. if not how should I design the URL for a POST request?

 Thanks,
 Nuwan


 Hi,
 1. If you mark the web service as @POST and the parametes as
 @FormParam (as it should be in a POST service) - no, this is not
 correct.
 2. The proper way is to put the parameters in the body. To do that you
 can use for example curl (http://curl.haxx.se/) : curl
 http://localhost:8080/n-tweb-comm-war/ws/updateResultIndicator; -d
 accessionNumber=1analyteCode=2workstation=3siteCode=4testIndicator=5testStatus=66
 or some browser add like
 https://addons.mozilla.org/en-US/firefox/addon/poster/;.

 --
 Everyone hates slow websites. So do we.
 Make your web apps faster with AppDynamics
 Download AppDynamics Lite for free today:
 http://p.sf.net/sfu/appdyn_d2d_jan
 ___
 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

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Resource annotation question

2013-01-18 Thread Bill Burke
Including a beans.xml may also do the trick.

On 1/18/2013 8:24 AM, Kurt T Stam wrote:
 Thanks,

 I see Ron uses @Resource in

 https://github.com/ronsigal/Resteasy/blob/89969d3b61c90da91f86ac221a2589c13e358521/jaxrs/arquillian/resteasy-cdi-ejb-test/src/main/java/org/jboss/resteasy/cdi/injection/ResourceProducer.java

 but this an EJB ( @ApplicationScoped), not a simple JAXRS endpoint. Do I
 have to use an EJB for @Resource to work?

 Thx,

 --Kurt

 On 1/18/13 3:54 AM, Weinan Li wrote:
 Ron has just submitted 10k+ examples on using CDI, EJB with RESTEasy!

 The code is here: https://github.com/resteasy/Resteasy/pull/236/files

 Feel free to refer to it! :-)

 --
 Weinan Li
 Sent with Sparrow http://www.sparrowmailapp.com/?sig

 On Friday, January 18, 2013 at 2:35 PM, Kurt T Stam wrote:

 Hi guys,

 Running on AS7 and RESTeasy 2.3.5, I'm trying to inject a mail session
 in my JAXRS endpoint using

 /**
 * The JAX-RS resource that handles notification specific tasks.
 *
 */
 @Path(/notify)
 public class NotificationResource {

 @Resource(mappedName=java:jboss/mail/Default)
 private Session mailSession;


 However the mailSession remains null, while the log indicate that
 'java:jboss/mail/Default' is bound.

 Do I have to set something in the web.xml http://web.xml for the
 Resource annotation to
 be executed?

 Thx,

 --Kurt

 --
 Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
 much more. Get web development skills now with LearnDevNow -
 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
 SALE $99.99 this month only -- learn more at:
 http://p.sf.net/sfu/learnmore_122812
 ___
 Resteasy-users mailing list
 Resteasy-users@lists.sourceforge.net
 mailto:Resteasy-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/resteasy-users




 --
 Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
 much more. Get web development skills now with LearnDevNow -
 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
 SALE $99.99 this month only -- learn more at:
 http://p.sf.net/sfu/learnmore_122812



 ___
 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

--
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Where to go for authorization examples?

2013-01-11 Thread Bill Burke
What do you actually want to do?  JAXRS security is left up to web 
container on the server side, and is fully implementation dependent on 
the client.

On the client side, its configuring Apache HC Client.  On the server 
side, its configuring web.xml and setting your web tier to do SSL/HTTPS.

On 1/11/2013 10:30 AM, Skriloff, Nicholas wrote:
 In the book, “Restful Java with JAXRS” there are examples up through
 chapter 11.  I need examples with tests for chapter 12, “Authentication
 and Authorization with JaxRS.”  Where can I get them?

 Sincerely,

 Nick Skriloff , ME , MCP, SCJP

 Information Technology Specialist

 Darden Information Services

 Voice 434 243 5025  Fax 434 243 2279

 skrilo...@darden.virginia.edu



 --
 Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
 much more. Get web development skills now with LearnDevNow -
 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
 SALE $99.99 this month only -- learn more at:
 http://p.sf.net/sfu/learnmore_122812



 ___
 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

--
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Multipart Form Data + multi-value part

2013-01-10 Thread Bill Burke


On 1/10/2013 9:41 AM, Eric Wittmann wrote:
 Greetings.

 I am trying to get a multi-value input part working in my resteasy
 service.  On the inbound side, I'm expecting a multipart/formdata post,
 where an input part named propertyName may appear multiple times.  I
 need to read that in as a Collection of some sort.  Some sample code
 that may or may not be right:

 @POST
 @Consumes(MediaType.MULTIPART_FORM_DATA)
 @Produces(MediaType.APPLICATION_ATOM_XML_FEED)
 public Feed queryFromPost(MultipartFormDataInput input) {
 String query = input.getFormDataPart(query,
   new GenericTypeString() { });
 SetString propNames = input.getFormDataPart(propertyName,
   new GenericTypeSetString() { });
 return doQuery(query, propNames);
 }


qyer is right, propNames is wrong.

You'll have to do

ListInputPart propNames = input.getFormDataMap().get(propertyName);

 I'm also using resteasy on the client-side.  Not sure how to submit the
 POST with multiple values.  Currently I have:

 String url = ...
 String query = ...
 SetString propertyNames = ...
 ClientRequest request = new ClientRequest(url);
 MultipartFormDataOutput formData = new MultipartFormDataOutput();
 formData.addFormData(query, query, MediaType.TEXT_PLAIN_TYPE);
 formData.addFormData(propertyName, propertyNames,
   MediaType.TEXT_PLAIN_TYPE);

The above will try to marshal a SetString into TEXT_PLAIN, which will 
call Set.toString().

 request.body(MediaType.MULTIPART_FORM_DATA_TYPE, formData);
 ClientResponseFeed response = request.post(Feed.class);

 Clearly this isn't right.  Any thoughts on how this should be done?


I'm not exactly sure what you're trying to do?  Why not just create your 
own json or XML media type and send that?  What are you using multipart?

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

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Query of RestEasy Media Parsing

2013-01-08 Thread Bill Burke
1) It is not a requirement to use a proxy
2) No reason you can't have a different proxy for your client
3) No reason you can't change your server-side class that implements 
this interface to have a getXML() and getJSON() methods.

IMO, I think what you all are doing is a hack.

On 1/8/2013 2:02 AM, Dieter Cailliau wrote:
 I use a ClientInterceptor for that (the code also takes care of basic
 auth, timeouts and ssh-without-hostname-verification).

  ApacheHttpClient4Executor ex = new
 ApacheHttpClient4Executor(getBasicAuthClient(LOGIN,PASS,
 application/json, null, new
 SingleClientConnManager(getSSHBypassScheme(443)),timeoutMs));
  return ProxyFactory.create(XYZ.class, https://; + host +
 href, ex);


  public static DefaultHttpClient getBasicAuthClient(final String
 login, final String pass, final String acceptType, final String
 contentType, ClientConnectionManager ccm, int timeoutMs) throws
 NoSuchAlgorithmException, KeyManagementException {
  DefaultHttpClient c2 = new DefaultHttpClient(ccm);
  c2.addRequestInterceptor(new HttpRequestInterceptor() {
  public void process(HttpRequest arg0, HttpContext arg1)
 throws HttpException, IOException {
  arg0.addHeader(Authorization,
 HTTPUtils.getBasicEncodedAuth(login, pass));
  arg0.addHeader(Accept, acceptType);
  if (contentType != null) {
  arg0.addHeader(ContentType,contentType);
  }
  }
  });
  HttpParams httpParams = c2.getParams();
  HttpConnectionParams.setConnectionTimeout(httpParams, timeoutMs);
  HttpConnectionParams.setSoTimeout(httpParams, timeoutMs);
  HttpConnectionParams.setSoReuseaddr(httpParams, true);

  c2.setParams(httpParams);
  return c2;
  }

  public static synchronized SchemeRegistry getSSHBypassScheme(int
 port) throws KeyManagementException, NoSuchAlgorithmException {
  if (schemeRegistry==null) {
  SSLSocketFactory sf = new SSLSocketFactory(getSSLContext(),
 SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER) {
  public java.net.Socket connectSocket(java.net.Socket
 arg0, java.net.InetSocketAddress arg1, java.net.InetSocketAddress arg2,
 HttpParams arg3) throws IOException ,java.net.UnknownHostException
 ,org.apache.http.conn.ConnectTimeoutException {
  int port = arg1.getPort();
  InetAddress addr = cache.get(arg1.getAddress());
  arg1 = new InetSocketAddress(addr,port);
  return super.connectSocket(arg0, arg1, arg2, arg3);
  };
  };
  Scheme httpsScheme = new Scheme(https, port, sf);
  schemeRegistry = new SchemeRegistry();
  schemeRegistry.register(httpsScheme);
  }
  return schemeRegistry;
  }



 2013/1/7 Bill Burke bbu...@redhat.com mailto:bbu...@redhat.com

 Why not just ditch using the proxy?  Or create a new different interface
 with the specs you want?  Overriding Exxecutor.exeucte() is a hack.

 On 1/7/2013 4:38 PM, kishore panda wrote:
  
   Hello,
  
   Query: How to ensure server sends JSON Media, when server is set
 with both Application_XML and Application_JSON Media Types (Produces
 annotation).
  
   I am executing a RESTEasy POC.
  
   I updated the server to accept and respond with both XML and JSON
 Media type.
  
 @POST
 @Path(/getData/)
 @Produces({MediaType.APPLICATION_XML,
 MediaType.APPLICATION_JSON})
 @Consumes({MediaType.APPLICATION_XML,
 MediaType.APPLICATION_JSON})
 public RestReqRes getData(Data request);
  
 In the client code, I have done this:
  
this.clientService =
 ProxyFactory.create(clientService.class, baseURL,
 getExecutor());
  
  
  and Override execute() method in ApacheHttpClient4Executor.
  
 request.accept(MediaType.APPLICATION_JSON);
 request.body(application/json, request.getBody());
 return super.execute(request);
  
  
   When the client is used to POST the Request, like
 clientService.getData(new Data());
  
   I found the below
   The accept header in the Request is updated with application/xml.
  
   This happens due to
   
 org.jboss.resteasy.client.core.marshallers.ClientMarshallerFactory.createMarshaller()
  method, which calls org.jboss.resteasy.util.getConsumes() method.
  
   The getConsumes() method returns the consume.value()[0] media
 type which is  'application/xml' in this case.
  
  
   When request.accept(MediaType.APPLICATION_JSON); is executed the
 accept header in the request is updated with
   'application/xml, application/json

Re: [Resteasy-users] Query of RestEasy Media Parsing

2013-01-07 Thread Bill Burke
Why not just ditch using the proxy?  Or create a new different interface 
with the specs you want?  Overriding Exxecutor.exeucte() is a hack.

On 1/7/2013 4:38 PM, kishore panda wrote:

 Hello,

 Query: How to ensure server sends JSON Media, when server is set with both 
 Application_XML and Application_JSON Media Types (Produces annotation).

 I am executing a RESTEasy POC.

 I updated the server to accept and respond with both XML and JSON Media type.

   @POST
   @Path(/getData/)
   @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
   @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
   public RestReqRes getData(Data request);

   In the client code, I have done this:

  this.clientService = ProxyFactory.create(clientService.class, baseURL,
   getExecutor());


and Override execute() method in ApacheHttpClient4Executor.

   request.accept(MediaType.APPLICATION_JSON);
   request.body(application/json, request.getBody());
   return super.execute(request);


 When the client is used to POST the Request, like
   clientService.getData(new Data());

 I found the below
 The accept header in the Request is updated with application/xml.

 This happens due to  
 org.jboss.resteasy.client.core.marshallers.ClientMarshallerFactory.createMarshaller()
  method, which calls org.jboss.resteasy.util.getConsumes() method.

 The getConsumes() method returns the consume.value()[0] media type which is  
 'application/xml' in this case.


 When request.accept(MediaType.APPLICATION_JSON); is executed the accept 
 header in the request is updated with
 'application/xml, application/json'

 Due to this the server always responds with xml format.

 Is there anyway I can override this so that the server responds JSON media as 
 per the request.

 Thank you,
 Malaya Kishore

 --
 Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
 MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
 with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
 MVPs and experts. SALE $99.99 this month only -- learn more at:
 http://p.sf.net/sfu/learnmore_122412
 ___
 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

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Jackson - not marked as ignorable

2013-01-05 Thread Bill Burke
You can also export jackson modules within resteasy-jaxrs module 
jboss-7.x/modules/org/jboss/resteasy/resteasy_jaxrs/modules.xml

On 1/4/2013 12:03 AM, András Csányi wrote:
 On 3 January 2013 17:40, András Csányi sayusi.a...@sayusi.hu wrote:
 On 3 January 2013 17:29, András Csányi sayusi.a...@sayusi.hu wrote:

 Oh, I got it! I had to add resteasy-jackson-provider something like this:

 dependency
groupIdorg.jboss.resteasy/groupId
artifactIdresteasy-jackson-provider/artifactId
version2.3.5.Final/version
  /dependency

 --
 --  Csanyi Andras (Sayusi Ando)  -- http://sayusi.hu --
 http://facebook.com/andras.csanyi
 --  Trust in God and keep your gunpowder dry! - Cromwell

 --
 Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
 much more. Get web development skills now with LearnDevNow -
 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
 SALE $99.99 this month only -- learn more at:
 http://p.sf.net/sfu/learnmore_122812
 ___
 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

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Query on resteasy Interceptor

2013-01-05 Thread Bill Burke


On 1/4/2013 4:56 AM, ignou_mca wrote:
 Hi folks,

 I am working on a poc using resteasy framework and  resteasy's
 MessageBodyWriterInterceptor

 the resource looks like this

  @GET
  @Path(/{id})
  public Response getUserDetails(@PathParam(id) String id);


 The business logic is implemented using a stateless ejb  below is the
 implementation


@Override
  public Response getUserDetails(HttpRequest request, String id) {

-  business logic ---

  ResponseBuilder builder = Response.ok());
  return builder.build();


  }


 The interceptor class code is mentioned below
 ==


 @Provider
 @ServerInterceptor
 public class ResponseInterceptor implements MessageBodyWriterInterceptor{
  private static final Logger logger =
 Logger.getLogger(ResponseInterceptor.class);
  ResponseBuilder builder = null;
  @Override
  public void write(MessageBodyWriterContext context) throws IOException,
 WebApplicationException {
  Object entity = context.getEntity();
  logger.debug(Response interceptor: +entity.getClass());

   if (entity != null) {

   if ( entity instanceof User){

 User entls = (User)entity;

 if (entls !=null  entls.getErrorCode()!=null) {

   if (entls.getErrorCode() == Status.BAD_REQUEST.getStatusCode()){

   logger.debug(Response interceptor: +entls.getErrorCode());
   throw new BadRequestException(Bad request,Response.status(400)
   .entity(entls).header(Bad request, 400)
.type(application/xml)
.build());


}



 My question are the following

 1. Whether it's good to create all the response from the interceptor class
 i.e . for htpp 200, 40*, 50* etc..or we should handle only exceptional cases
 which are then Handel by the Exception mappers


You should probably not do business login within interceptors.  For 
error conditions that are business logic, either handle them in your 
business logic (jaxrs methods) or throw an exception and write an 
exception mapper.


 2. What is the advantage of PostProcessorInterceptors over
 MessageBodyWriterInterceptor ?


MessageBodyXXXInterceptors are for intercepting and processing the 
marshalling and unmarshalling of http message bodies.  The will not be 
invoked if there is no http method body.  PostProcessInterceptors always 
get invoked after the jax-rs method call and befor marshalling.

 3. Could you please provide some sample use case?


The below blog is about JAX-RS 2.0 but the concepts map 1to1 to 
Resteasy's old interceptor model

http://bill.burkecentral.com/2011/05/24/interceptors-in-jax-rs-2-0/

If you can, switch to Resteasy 3.0 beta 1dardized interceptor model.


 4. out of Resteasy interceptor and  Ejb interceptor which one is good in terms
 of performance ?


resteasy interceptor is for massaging incoming and outgoing HTTP 
requests.  EJB interceptors are for massaging business logic.


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

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Client Framework and Subresource Locators

2012-12-15 Thread Bill Burke
What does that have to do with the client framework? The client 
framework is just a set of predefined interfaces you invoke on, which is 
different than the server where any object can be returned as a method.

On 12/15/2012 9:21 AM, Richard Cissee wrote:
 Hello,

 the client framework creates proxies for resource classes and now for
 subresource locators as well (see e.g. Issue 589). These are always
 created for the class indicated by the static return type of the
 respective method, e.g. for a resource locator with the method

 @Path({number})
 Chapter getChapter(@PathParam(number) int number)

 a proxy for Chapter.class is created and used. The jax-rs
 specification, however, states that An implementation MUST dynamically
 determine the class of object returned rather than relying on the static
 sub-resource locator return type (section 3.4.1). Thus, the server may
 actually use a subclass of Chapter, and process the request in a
 different manner than expected by the client framework.

 IMO, this basically means that Java interfaces alone cannot in all cases
 be used as the complete specification of the server's ReST interface,
 and consequently may be insufficient as basis for the client framework.
 Any thoughts on how to deal with this?

 Regards,
  Richard

 --
 LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
 Remotely access PCs and mobile devices and provide instant support
 Improve your efficiency, and focus on delivering more value-add services
 Discover what IT Professionals Know. Rescue delivers
 http://p.sf.net/sfu/logmein_12329d2d
 ___
 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

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Limit RestEasy to one war inside an ear?

2012-12-06 Thread Bill Burke


On 12/6/2012 4:39 AM, Heiko W.Rupp wrote:
 Hey Bill,

 Am 05.12.2012 um 22:37 schrieb Bill Burke:

 Java EE 6 doesn't support EJB + JAX-RS components that are not deployed
 under the WEB-INF/lib or WEB-INF/classes.  SO, you must move
 biz-stuff.jar into rest.war or create a JAX-RS service that delegates to
 the EJBs.

 I don't exactly understand this, as my set up works (except for that one case)
 perfectly. I have a rest.war I set some params that are picked up by RE and
 then a jar with all my rest endpoint implementation classes (SLSB with @Path 
 and so on).
 The REST stuff inside the jar gets activated by the presence of 
 @ApplicationPath on
 one of my application classes in the jar and then RE scans the EJBs and 
 provides
 endpoints for the ones decorated with @Path. Works nicely.

Where is the JAX-RS resource classes? Where is the Application class? 
Which jar?  And where is this jar in the EAR?

If AS7 is allowing you to deploy JAX-RS in a .jar that is *NOT* inside a 
WAR, then this is a huge huge bug.JAX-RS does not have a way to 
define security constraints so it is required to be deployed within a 
specific WEB application (.WAR).  Also, @ApplicationPath is not a 
context-root.  It is a servlet-mapping URL for a JAX-RS dispatcher servlet.


 But, Resteasy can support it your case with a special config switch.

 context-param
param-nameresteasy.jndi.resources/param-name
param-valueLibraryBean/local/param-value
 /context-param

 But here I have to manually list all the @Local classes manually and can't use
 the autoscan feature described above.


 My issue is now that I have several web-apps inside the .ear with
 different context roots and I want the REST-endpoint only be present
 below /rest and not in other places.


Then, the EJB jar needs to be put in the WEB-INF/lib of the WAR that has 
a /rest context-root. Or, you can use the technique above.  I would 
suggest deploying your EJBs with a WAR.



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

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] @Form and non-alpha map keys

2012-11-29 Thread Bill Burke
I don't see a reason why this couldn't be fixed.

On 11/29/2012 8:33 AM, Weinan Li wrote:
 Hi Bill,

 Do you think we could support '-' for map key?

 --
 Weinan Li


 On Tuesday, November 27, 2012 at 12:45 AM, John Reiter wrote:

 Hello,

 I'm having an issue with RESTEasy 2.3.4 with using @Form/@FormParam
 annotations to set values of a Map that uses UUIDs for its keys.  My
 classes basically look like this:

 @Controller
 @Path( /test )
 public class MyController
 {
 @Consumes( MediaType.APPLICATION_FORM_URLENCODED )
 @POST
 public ModelAndView setAssignments( @Form final MyForm myForm )
 throws URISyntaxException
 { ... }
 }

 public class MyForm
 {
 @Form( prefix = myMap )
 private MapString, Foo myMap = Maps.newHashMap();
 }

 public class Foo
 {
 @FormParam( bar )
 public void setBar( final String bar )
{ ... }
 }

 The request parameters that get submitted look like this:

 myMap[75736572-3100-505f-dac0-000745b8].bar
 myMap[b794c4a0-14b7-0130-c2da-20c9d04983db].bar
 etc.

 The Foo.bar properties never end up being set.  Stepping through with
 a debugger, the problem occurs in
 AbstractCollectionFormInjector.findMatchingPrefixesWithNoneEmptyValues():
 that method tries to find keys in the map that match a regex.  In this
 case, the regex is defined in MapFormInjector:

public MapFormInjector(Class collectionType, Class keyType, Class
 valueType, String prefix, ResteasyProviderFactory factory)
{
   super(collectionType, valueType, prefix, Pattern.compile(^ +
 prefix + \\[([a-zA-Z_]+)\\]), factory);
   keyInjector = new StringParameterInjector(keyType, keyType,
 null, Form.class, null, null, new Annotation[0], factory);
}

 And only allows alpha characters and underscores, which is obviously
 why my map isn't being populated.  I'm working around this right now
 by mapping temporary, alpha-only keys to the real ones and using those
 in my form then replacing them after the form is submitted.  Is there
 a way to get this regex changed to be something a little more
 lenient?  Really, is there any reason to disallow anything other than
 maybe brackets?

 If you want me to enter a JIRA issue for this, let me know.

 Thanks,
 John




 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 ___
 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

--
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] ClassLoading error follwoing upgrade from RestEasy 2.3.2 to 2.3.5 in JBoss AS7.1

2012-11-20 Thread Bill Burke
Ok, i've created a jira for this so that future versions of the patcher 
will set up the module dependencies correctly.

On 11/20/2012 11:56 AM, Bill Burke wrote:
 Did you have to export it?

 On 11/20/2012 11:04 AM, James Fellows wrote:

 You might have to export AC4 + commons from the resteasy module.  But
 adding the commons-io dependency might work too.  Let me know how it
 goes, and I'll update the patcher.

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



 Adding commons io to module.xml (for resteasy-jasxrs) appears to have
 done the trick.

 Thanks for the response,
 James.

 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 ___
 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

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Automatic Cookie Passing

2012-11-17 Thread Bill Burke
You'll have to configure the underlying Apache Http client 4 
DefaultHttpClient.  Javadoc should give you an idea.

On 11/17/2012 2:11 AM, Saravanabavagugan Vengadasundaram wrote:
 Hello All,

I am using the RESTEasy client framework for testing my web services.
 I have a login API that accepts user credentials and creates a session
 cookie. Subsequent to the call to this API, I can call other APIs in my
 system which will expect the session cookie to be passed back. I have
 two questions.

 1) Is there are way to set a configuration in RESTEasy client classes
 have all the cookies received in the first call to be pased back in
 subsequent calls.

 2) If #1 is not possible, is there a way to read a cookie from
 ClientResponse or using some other mechanism. I can then pass the cookie
 value using @CookieParam.

 Any help is highly appreciated.

 --
 regards,
 Saravanabavagugan
 Senior Software Engineer


 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov



 ___
 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

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Issue with using RegEx and Escaping in the @Param

2012-11-16 Thread Bill Burke


On 11/16/2012 4:30 PM, Ramesh Reddy wrote:
 Hi,

 I trying to integrate OData4J (http://code.google.com/p/odata4j) with
 Resteasy, so that I can provide OData services with in Teiid.

 OData4J uses @Paths like

 @Path({count: [$]count})= {uri}/$count
 @Path({first: \\$}value)= {uri}/$value


Yeah, i can reproduce.  Try moving the '$' character outside the 
expression, i.e.

@Path(${count : \\d+})

or

@Path({before}${after})

That seemed to work for me.

Bill

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

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] PreProcessInterceptor - HttpResponse / HttpServletResponse object

2012-10-15 Thread Bill Burke
Does @Context HttpServletResposne not work?

On 10/15/2012 8:21 AM, Zebeljan, Nebojsa wrote:
 Hi,
 I'm doing some authorizationin a PreProcessInterceptor. The auth
 framework needs the HttpServletResponse object passed by.
 At the moment I'm seeing no possibilities to get the HttpServletResponse
 object – is there a way to retrieve it in the PreProcessInterceptor?

 Thanks in advance!

 Regards,
 Nebo


 --
 Don't let slow site performance ruin your business. Deploy New Relic APM
 Deploy New Relic app performance management and know exactly
 what is happening inside your Ruby, Python, PHP, Java, and .NET app
 Try New Relic at no cost today and get our sweet Data Nerd shirt too!
 http://p.sf.net/sfu/newrelic-dev2dev



 ___
 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

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Intercept Object after being unmarshalled but before handed over to method

2012-10-15 Thread Bill Burke
MessageBodyReaderInterceptor (or ReaderInterceptor in JAX-RS 2.0). Do 
things after proceed() and you can access the Java object after its been 
unmarshalled.

On 10/15/2012 5:12 AM, Felipe Sere wrote:
 Hi,

 I have been looking for a way to execute code after RESTeasy
 unmarshalled my XML/JSON to a POJO but before it is handed over to the
 selected method.
 I'd like to do this to add hibernate-validation to my POJOs and avoid
 my methods getting invalid objects.

 What kind of interceptor gets me access to the unmarshalled POJO?
 If there is no way to solve this in RESTeasy I'll have to add some AOP magic…

 Cheers,
 Felipe

 --
 Don't let slow site performance ruin your business. Deploy New Relic APM
 Deploy New Relic app performance management and know exactly
 what is happening inside your Ruby, Python, PHP, Java, and .NET app
 Try New Relic at no cost today and get our sweet Data Nerd shirt too!
 http://p.sf.net/sfu/newrelic-dev2dev
 ___
 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

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] jackson jettison

2012-09-14 Thread Bill Burke
(BaseClientResponse.java:433)
 ... 7 more

 from forums/documentation this seems like a conflict between
 jackson/jettison

 any help?


 --
 Got visibility?
 Most devs has no idea what their production app looks like.
 Find out how fast your code is with AppDynamics Lite.
 http://ad.doubleclick.net/clk;262219671;13503038;y?
 http://info.appdynamics.com/FreeJavaPerformanceDownload.html



 ___
 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

--
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] using annotation to turn a 200 into a 201 with Location header

2012-09-13 Thread Bill Burke
Nothing built in, thats the way to do it.  You could also have the class 
implement AcceptedByMethod too.  Then the interceptor would only be 
bound to resource methods with your annotation.

On 9/13/2012 4:22 AM, Dieter Cailliau wrote:
 When creating a resource (POST /items) i was a bit annoyed by the fact
 that my implementation has a dependency on jax-rs classes: it uses
 response builder to build a 201 response. This also pollutes my
 service interface, since the return value has to be a Response.

 To fix this, i introduced an annotation which gets handled by the
 interceptor code below:
   
 @RespondWithStatus(status=HttpServletResponse.SC_CREATED,name=Location,value=/items/{return})
 I'm using this interceptor-construction to hack the response and turn
 it into a 201 with a Location header (leaving the entity like it is).

 Now my service implementation class or interface has no dependencies
 on jax-rs (it just returns a String, which will be used to replace the
 {return} placeholder.
 I'ld like to get some feedback on this trick. Is there anything
 built-in that i could have used?

 @Provider
 @ServerInterceptor
 public class RespondWithStatusAndHeaderInterceptor implements
 PostProcessInterceptor {

   @Context HttpServletRequest req;
   
   public void postProcess(ServerResponse arg0) {
   for (Annotation a : arg0.getAnnotations()) {
   if (a.annotationType().equals(RespondWithStatus.class)){
   RespondWithStatus x = (RespondWithStatus) a;
   String template = x.value();
   String rv =  arg0.getEntity().toString();
   int u = template.indexOf({return});
   int y = template.indexOf('?');
   rv = (u  y || y == -1) ?
 org.jboss.resteasy.util.Encode.encodePath(rv) :
 org.jboss.resteasy.util.Encode.encodeQueryParam(rv);
   String p = 
 req.getScheme()+://+req.getServerName()+:+req.getServerPort()+req.getContextPath()+req.getServletPath();
   String rep = template.replace({return},rv);
   if (!.equals(x.name())) {
   arg0.getMetadata().add(x.name(), p+rep);
   }
   arg0.setStatus(x.status());
   }
   }
   }
   
   @Retention(RetentionPolicy.RUNTIME)
   public static @interface RespondWithStatus {
   int status();
   String name() default ;
   String value() default ;
   }
   
 }

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 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

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Not deploying in JBoss 7.1.1.Final

2012-09-07 Thread Bill Burke
:]
 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:722) [rt.jar:1.7.0_06-icedtea]

 I'm... a little lost as to why it's not even deploying.

 --
 Joseph B. Ottinger
 http://enigmastation.com
 Ça en vaut la peine.



 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/



 ___
 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

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Problem using RESTEasy mock framework withexception mapper

2012-09-04 Thread Bill Burke
 URISyntaxException {
 Dispatcher dispatcher = MockDispatcherFactory.createDispatcher();
 dispatcher.getRegistry().addResourceFactory(new
 POJOResourceFactory(FooService.class));
 dispatcher.getProviderFactory().addExceptionMapper(FooExceptionMapper.class);
 MockHttpRequest request = MockHttpRequest.get(/rest/v1/foo);
 MockHttpResponse response = new MockHttpResponse();
 dispatcher.invoke(request, response);
  }
  }
 Error:
 Aug 26, 2012 10:44:26 PM org.jboss.resteasy.core.SynchronousDispatcher
 SEVERE: Failed executing GET /rest/v1/foo
 org.jboss.resteasy.spi.LoggableFailure: Unable to find contextual data
 of type: javax.servlet.http.HttpServletRequest
  at
 org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:56)
  at $Proxy18.getHeader(Unknown Source)
  at com.foo.FooExceptionMapper.toResponse(FooExceptionMapper.java:51)
  at com.foo.FooExceptionMapper.toResponse(FooExceptionMapper.java:1)
  at
 org.jboss.resteasy.core.SynchronousDispatcher.executeExceptionMapper(SynchronousDispatcher.java:330)
  at
 org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:359)
  at
 org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:348)
  at
 org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:220)
  at
 org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:196)
  at
 org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:551)
  at
 org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:513)
  at
 org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125)
  at com.foo.TestFooExceptionMapper.main(TestFooExceptionMapper.java:20)
 http://stackoverflow.com/questions/12136780/resteasy-mock-vs-exception-mapper-vs-context

 
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

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


 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/



 ___
 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

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Customizing Jackson mapper

2012-08-31 Thread Bill Burke


On 8/31/2012 11:13 AM, John Reiter wrote:
 I'm using JBoss AS 7.1.1.Final, the included RESTEasy distribution
 (2.3.2.Final), and Jackson 1.9.9 to handle serialization/deserialization
 to/from JSON.  I can serialize/deserialize JSON using
 @Produces/@Consumes along with Jackson annotations in my REST resources
 and this all works fine.  The problem I'm having is I'd like to start
 customizing some Jackson behavior and register custom
 serializers/deserializers and can't quite get this working.  This should
 involve getting access to the RESTEasy Jackson ObjectMapper and running
 my customization code on that mapper.

 After seeing something similar in a forum post, I tried this:

 @Provider
 @Consumes({ MediaType.APPLICATION_JSON, text/json })
 @Produces({ MediaType.APPLICATION_JSON, text/json })
 public class JacksonCustomizations extends ResteasyJacksonProvider {

  private static final Logger log = Logger.getLogger(
 JacksonCustomizations.class );

  public JacksonCustomizations()
  {
  super();

 log.info http://log.info( Beginning Jackson configuration... );

  final ObjectMapper mapper = _mapperConfig.getConfiguredMapper();

  final Version version = new Version( 0, 0, 1, null );
  final SimpleModule module = new SimpleModule( Test Module,
 version );

  //Add custom serializers
  module.addSerializer( LocalDate.class, new
 JacksonLocalDate.Serializer() );

  //Add custom deserializers
  module.addDeserializer( LocalDate.class, new
 JacksonLocalDate.Deserializer() );

  mapper.registerModule( module );

 log.info http://log.info( OK: Finished configuring Jackson );
  }
 }

 But this code doesn't seem to ever run.  I receive JSON back from my
 application as normal, but I don't see any log entries and my custom
 serializers/deserializers don't seem to be registered (@JsonSerialize(
 using = JacksonLocalDate.Serializer.class seems to have no effect).

 Is this a valid approach to solving this problem or should I be going
 about it in an entirely different way?  If this is valid, does anyone
 have any suggestions about what might be wrong with my implementation?
 If not, has anyone had success with a different approach?


Hmm, your provider should take precedence.  How are you registering your 
provider?  All ResteasyJacksonProvider does really is extend the Jackson 
one and adds produces and consumes support for application/*+json

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

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Manually Unmarshalling Form Data

2012-08-29 Thread Bill Burke


On 7/5/2012 6:50 PM, Cody Lerum wrote:
 I'm currently using the @Form functionality to handle the
 unmarshalling of form data sent via a cross-domain ajax post

   @Path(/add)
   @POST
   @Produces(application/json)
   @Consumes(application/x-www-form-urlencoded)
   public Response add(@Form MyForm form) { ... }

 This works great except for when coming from Internet Explorer which
 has to be a XDomainRequest and that only supports sending with
 content-type text/plain.

 I can obviously create another method to handle this request which is
 receiving valid form data just with the wrong content-type

 @Path(/add)
 @POST
 @Produces(application/json)
 @Consumes(text/plain)
 public Response add(String data) { ... }

 However at this point I have to manually parse the data and set it
 field by field into my object.

 1. Is there anyway to force the first method to process the the
 request data regardless of the received content-type?

 2. If that isn't possible, is there a way I can manually call an
 internal RESTeasy function to map the String data from my second
 method to a specified class with @FormParam variables.



You can't really re-use public Response add(@Form MyForm form) method. 
There's a couple things you could do.  You could inject a Providers 
reference and change the media type:

@POST
@Consumes(text/plain)
public Response add(@Context Providers providers, InputStream content) {

MessageBodyReader reader = 
providers.getMessageBodyReader(MultivaluedMap.class, null, null, new 
MediaType(application/x-www-form-urlencoded);

MultivaluedMapString, String formParams = reader.readFrom(...);
...
}

You could also write a specific MessageBodyReader for your MyForm class 
for text/plain formats.

Bill

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

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Problem using RESTEasy mock framework withexception mapper

2012-08-28 Thread Bill Burke
Also, FYI, we'll probably be deprecating and then removing the mock 
framework in favor of an in-memory client executor.  So, you'll be 
building requests with JAX-RS 2.0 client api that execute directly on 
server side without going over the wire.

On 8/28/2012 4:20 PM, Jim Showalter wrote:
 Does anyone on this list have a pointer to a working example of RESTEasy
 mock + exception mapper? Is it known to work?


 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/



 ___
 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

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Get the produced JSON on the server side

2012-07-24 Thread Bill Burke
javax.ws.rsProviders has a method to get a MessageBodyWriter from 
which you can manually create your json.  That answer your question?

On 7/24/12 11:40 AM, mickael.p...@gmail.com wrote:
 Hi everyone,

 I use RESTEasy 2.3.4 to produce a JSON content from my POJOs (correctly
 annotated with @XmlRootElement, etc.). The simple case where I use @GET
 and @Produces(application/json) to return a list of objects is working
 fine.

 Now, server-side, I need to implement a simple caching mechanism.
 Instead of querying all my POJOs I want to check if a file (containing
 the JSON response) exists on my file system. If not, I would like to put
 the JSON produced content in this file.

 My question: how do I, server-side, get the JSON produced by RESTEasy,
 so I can have a simple String that I could write on my file system?

 So far, I'm trying with the Client framework
 (http://docs.jboss.org/resteasy/docs/2.3.4.Final/userguide/html/RESTEasy_Client_Framework.html)
 but I think there is a better way to do so.

 Thanks,
 Mickael.

 --
 *Mickaël Pham* | Solutions Consultant Intern @ Zuora http://www.zuora.com/
 Mobile: +1 (408) 646-0219 | Website: www.mickael-pham.fr
 http://www.mickael-pham.fr
 http://www.mickael-pham.fr/



 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/



 ___
 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


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


  1   2   >