Re: [Resteasy-users] Status 404 - Could not find resource

2015-11-04 Thread John D. Ament
HI Dave,

You have a context param which is disabling scanning



resteasy.resources



zedi.pacbridge.web.services.OutgoingRequests,

zedi.pacbridge.web.services.Connections






Please add your class here, or stop using the context param.

On Wed, Nov 4, 2015 at 5:54 PM Dave Rathnow  wrote:

> I’m having a strange problem and hope someone can tell me what I’m doing
> wrong.
>
>
>
> I have a Resteasy servlet configured and reachable at
> http://myhost.com/srv  and a couple of classes that look like this:
>
>
>
> @Path("/connections")
>
> public class Connections {
>
> @Inject
>
> private NetworkService networkService;
>
>
>
> @GET
>
> @Path("/")
>
> @Produces({MediaType.APPLICATION_JSON})
>
> public Collection allConnections() {
>
> . . .
>
> return listOfConnectionsDtos;
>
> }
>
> }
>
>
>
> @Path("/outgoingrequests")
>
> public class OutgoingRequests {
>
> @Inject
>
> private OutgoingRequestCache cache;
>
>
>
> @GET
>
> @Path("/")
>
> @Produces({MediaType.APPLICATION_JSON})
>
> public Collection allRequests() {
>
> . . .
>
> return listOfOutgoingReuqestsDtos;
>
> }
>
> }
>
>
>
> These work fine and have been working for some time now. I access them
> with http://myhost.com/srv/connections and
> http://myhost.com/srv/outgoingrequests respectively.
>
>
>
> I recently tried to add a new service to my app that looks like this
>
>
>
> @Path("/devices")
>
> public class Devices {
>
> @Inject
>
> private DeviceCache cache;
>
>
>
> @GET
>
> @Path("/")
>
> @Produces({MediaType.APPLICATION_JSON})
>
> public Collection allDevices() {
>
> . . .
>
> return listOfDeviceDTO;
>
> }
>
> }
>
>
>
> However this one doesn’t work.  When I try to access it with the url
> http://myhost.com/srv/devices I get “HTTP Status: 404” returned. I've
> tried creating a couple of other dummy service using this same pattern and
> they are all coming back with a 404 error. I’ve turned on debug logging for
> Resteasy categories and I’m seeing the following exception in my JBoss log
> file:
>
>
>
> 15:33:10,001 DEBUG [org.jboss.resteasy.core.SynchronousDispatcher] ()
> PathInfo: /devices
>
> 15:33:10,002 DEBUG [org.jboss.resteasy.core.SynchronousDispatcher] ()
> Failed executing GET /devices: org.jboss.resteasy.spi.NotFoundException:
> Could not find resource for relative : /devices of full path:
> http://myhost.com/myapp/srv/devices
>
> at
> org.jboss.resteasy.core.registry.RootSegment.matchChildren(RootSegment.java:360)
> [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]
>
> at
> org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:374)
> [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]
>
> at
> org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:367)
> [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]
>
> at
> org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:350)
> [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]
>
> at
> org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:192)
> [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]
>
> at
> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125)
> [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]
>
> at
> org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
> [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]
>
> at
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
> [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]
>
> at
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
> [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]
>
>   < -- SNIP -- >
>
>
>
> My web.xml file looks like this:
>
>
>
> 
>
> resteasy.resources
>
> 
>
> zedi.pacbridge.web.services.OutgoingRequests,
>
> zedi.pacbridge.web.services.Connections
>
> 
>
> 
>
>
>
>
>
>   Resteasy
>
>
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
>
>
>
>
>
>
>
>   resteasy.servlet.mapping.prefix
>
>   /srv
>
>
>
>
>
>
>
>   Resteasy
>
>   /srv/*
>
>
>
>
>
> Can anyone tell me what might be happening here?  What am I doing wrong???
>
>
>
> Thanks,
>
> Dave.
>
> --
> ___
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

[Resteasy-users] YAML Provider

2015-08-20 Thread John D. Ament
Hi all,

I was playing with the YAML provider today and saw an issue.  In the local
unit tests, everything runs fine.  However when you deploy the equivalent
example to the app server it was failing.  I believe its a class loader
issue, since they seem to use some basic class loading support to do POJO
binding.

I've raised a PR to fix the classloader issue, as well as filed a JIRA
ticket.  I'm not sure if this is newer functionality but I had upgraded
SnakeYAML to match the version deployed to Wildfly.  The docs should
probably be updated to reflect the new version (1.15) as well as the new
behavior when an invalid YAML document is passed in (it returns 400 instead
of 500).

https://github.com/resteasy/Resteasy/pull/673
https://issues.jboss.org/browse/RESTEASY-1223

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


Re: [Resteasy-users] RESTEasy Runtime client propagation.

2015-02-27 Thread John D. Ament
Hi Jakub!

I think you're looking for ContainerResponseFilter.

John

On Fri, Feb 27, 2015 at 8:03 AM Jakub Narloch jmnarl...@gmail.com wrote:

 So,

 After a quick research I am trying to find the counterpart
 of ClientErrorInterceptor for RESTEasy 3.x, any sugestions?

 Regards,
 Jakub Narloch

 2015-02-27 11:37 GMT+01:00 Jakub Narloch jmnarl...@gmail.com:

 Hi,

 I think I have a quite interesting use case in our project, I had
 existing service layer that now is being translated into JAX-RS endpoints
 by exposing the existing service interfaces without changes and consuming
 them through RESTEasy client proxies. Everything seems ok except for one
 thing, we are struggling with RuntimeExceptions. Basically we had defined
 some application level exceptions that we wish to propagate to the client.
 Since they were runtime we didn't had defined the throws clauses for them.
 We would like to have those exceptions propagated to the client, but at the
 moment only what we got was some InternalServerErrrorException being thrown
 on client side.

 The question is only how we should approach to this problem, is there a
 way to register a ExceptionMapper and then register a ClientResponseFilter
 to process that, or there is maybe other way?

 Regards,
 Jakub Narloch


 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Resteasy-users mailing list
 Resteasy-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/resteasy-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] SE Clients and providers

2015-01-26 Thread John D. Ament
Hmmm ok weird one.

I had a missing classpath dependency.  However, even with that fixed no
luck.

I took a copy of ResteasyJackson2Provider and changed the produces/consumes
to be application/json instead of application/*+json and it worked fine.

John

On Mon Jan 26 2015 at 12:37:22 PM John D. Ament john.d.am...@gmail.com
wrote:

 Hi,

 I'm using a simple SE client w/ RestEasy to talk to multiple systems.

 One system exposes its APIs using Jackson1 annotations and the other uses
 Jackson2 annotations.

 I create two distinct clients for each of them, one registering the
 jackson provider and the other registering the jackson2 provider.

 When clients on the second one run, they are getting the jackson provider
 instead of the jackson2 provider.

 I've confirmed through log output that

 client.register(provider);

 Is only called with the appropriate providers.  Yet the call stacks are
 showing the Jackson 1 provider when I'm expecting to use the Jackson2
 provider.  Is there any way I can force Resteasy to use the Jackson2
 provider other than client.register?

 Thanks,

 John

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] SE Clients and providers

2015-01-26 Thread John D. Ament
Hi,

I'm using a simple SE client w/ RestEasy to talk to multiple systems.

One system exposes its APIs using Jackson1 annotations and the other uses
Jackson2 annotations.

I create two distinct clients for each of them, one registering the jackson
provider and the other registering the jackson2 provider.

When clients on the second one run, they are getting the jackson provider
instead of the jackson2 provider.

I've confirmed through log output that

client.register(provider);

Is only called with the appropriate providers.  Yet the call stacks are
showing the Jackson 1 provider when I'm expecting to use the Jackson2
provider.  Is there any way I can force Resteasy to use the Jackson2
provider other than client.register?

Thanks,

John
--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] Wrong build order?

2014-04-07 Thread John D. Ament
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


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

2014-02-21 Thread John D. Ament
Friso,

TO an extent, yes this would compete with DropWizard, but leverage
some EE technology in the mix (CDI).

John

On Fri, Feb 21, 2014 at 9:14 AM, Friso Vrolijken
friso.vrolij...@caci.nl wrote:
 Hi,

 -Oorspronkelijk bericht-
 Great stuff, but still don't understand why you guys want to roll your own 
 app server.
 Let me take a look.  You submitting a PR?

 Sounds to me like you're recreating http://dropwizard.codahale.com/ ?

 Groeten,

 Friso

 --
 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

--
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] Proper way to handle uploading files via RestEasy/Netty

2014-02-18 Thread John D. Ament
Hmmm.  So if I want to get an inputstream (because the object is
actually something like a word doc), can I just plugin inputstream for
MyClass?

On Tue, Feb 18, 2014 at 9:49 AM, Bill Burke bbu...@redhat.com wrote:
 Upload via a browser?

 Server side:

  @POST
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  public Response uploadRealm(MultipartFormDataInput input) throws
 IOException  {
  MapString, ListInputPart uploadForm = input.getFormDataMap();
  ListInputPart inputParts = uploadForm.get(file);

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


 On 2/16/2014 1:17 PM, John D. Ament wrote:
 Hi all,

 Just wondering if there are any pointers to how to best handle a file
 upload via RestEasy's NettyJaxrsServer?  When I was doing it via an
 app server, it was easy because there was an HTTP request.  Would
 injecting @Context HttpServletRequest still work here?  I'm inclined
 to think not but would be curious of other opinions.

 John

 --
 Android apps run on BlackBerry 10
 Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
 Now with support for Jelly Bean, Bluetooth, Mapview and more.
 Get your Android app in front of a whole new audience.  Start now.
 http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/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

--
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


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

2014-02-16 Thread John D. Ament
Hi all,

Just wondering if there are any pointers to how to best handle a file
upload via RestEasy's NettyJaxrsServer?  When I was doing it via an
app server, it was easy because there was an HTTP request.  Would
injecting @Context HttpServletRequest still work here?  I'm inclined
to think not but would be curious of other opinions.

John

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


[Resteasy-users] Using Netty, RestEasy and Weld

2014-01-19 Thread John D. Ament
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


Re: [Resteasy-users] too much validation.xml loading?

2013-12-21 Thread John D. Ament
John,

Hibernate Validator should only be creating a validator factory once
for the deployment.  Hence, it should only be reading validation.xml
at deployment time.  The fact that you are seeing it multiple times is
why I'm thinking its a validator issue (I don't reproduce this on
mine, I'm on AS 7.1.1 w/ Validator 4.3.1).  Hence why I'm curious what
version you're on.  Hibernate Validator is responsible for the
instantiation of the validator factory.

Also, I assumed (possibly foolishly) that your rest endpoint is
annotated with a CDI or EJB qualifying annotation.  Is that the case?

Just as a heads up as well, the InjectingConstraintValidator was
recently ported from Seam3 to DeltaSpike.  The code is almost
verbatim.

On Sat, Dec 21, 2013 at 11:02 AM, John Franey jjfra...@gmail.com wrote:
 John,

 I'm excellentthanks.  You?

 Yes, this seems more like a question for weld/hibernate, than resteasy...but
 I thought to start at the top :)

 Maybe I misunderstand injection, within the jax-rs environment, or in
 general.  I'm not sure which component drives the initialization of the
 validator, I guess its weld.  On the other hand, if I have a faulty
 understanding of jax-rs integration with cdi, I could be inadvertently
 causing multiple initializations.

 Thanks for the response.  I posted a similar question to weld after you
 implicitly confirmed my code is not at fault.

 John





 On Fri, Dec 20, 2013 at 6:50 PM, John D. Ament john.d.am...@gmail.com
 wrote:

 Hey John,

 How are you?

 It seems like your issue is more Hibernate Validator related.  What
 version are you using?  I don't see that message on the 4.3 branch or
 the 4.1 branch.

 - John

 On Fri, Dec 20, 2013 at 5:53 PM, John Franey jjfra...@gmail.com wrote:
  Hi,
 
  I have a resource that injects the validator, and the rest method
  invokes
  the validator.  On every request, I see these entries in the log.  That
  is
  'Parsing XML based configuration by 4 on every request.  Is that
  reasonable?
  If not, how do I workaround?
 
  17:38:14,022 INFO
  [org.hibernate.validator.internal.xml.ValidationXmlParser]
  (http-localhost/127.0.0.1:8080-1) HV07: META-INF/validation.xml
  found.
  Parsing XML based configurati
  on.
  17:38:14,027 INFO
  [org.hibernate.validator.internal.xml.ValidationXmlParser]
  (http-localhost/127.0.0.1:8080-1) HV03: Using
  org.jboss.seam.validation.InjectingConstraintValidator
  Factory as constraint factory.
  17:38:14,046 INFO
  [org.hibernate.validator.internal.xml.ValidationXmlParser]
  (http-localhost/127.0.0.1:8080-1) HV07: META-INF/validation.xml
  found.
  Parsing XML based configurati
  on.
  17:38:14,051 INFO
  [org.hibernate.validator.internal.xml.ValidationXmlParser]
  (http-localhost/127.0.0.1:8080-1) HV03: Using
  org.jboss.seam.validation.InjectingConstraintValidator
  Factory as constraint factory.
  17:38:14,068 INFO
  [org.hibernate.validator.internal.xml.ValidationXmlParser]
  (http-localhost/127.0.0.1:8080-1) HV07: META-INF/validation.xml
  found.
  Parsing XML based configurati
  on.
  17:38:14,073 INFO
  [org.hibernate.validator.internal.xml.ValidationXmlParser]
  (http-localhost/127.0.0.1:8080-1) HV03: Using
  org.jboss.seam.validation.InjectingConstraintValidator
  Factory as constraint factory.
  17:38:14,093 INFO
  [org.hibernate.validator.internal.xml.ValidationXmlParser]
  (http-localhost/127.0.0.1:8080-1) HV07: META-INF/validation.xml
  found.
  Parsing XML based configuration.
  17:38:14,099 INFO
  [org.hibernate.validator.internal.xml.ValidationXmlParser]
  (http-localhost/127.0.0.1:8080-1) HV03: Using
  org.jboss.seam.validation.InjectingConstraintValidatorFactory as
  constraint
  factory.
 
 
 
  This is a simplification of my code:
 
  @Path()
  public class MyResource {
 
@Inject
private Validator validator;
 
@PUT
public create(MyObject myObject) {
 validator.validate(myObject);
}
  }
 
 
 
 
 
 
  --
  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
 



--
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

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

2013-12-10 Thread John D. Ament
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


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

2013-11-26 Thread John D. Ament
I assumed this would happen, based on Bill's email.  you'll probably
need to extend the CdiInjectorFactory to use your own BeanManager.

On Tue, Nov 26, 2013 at 1:58 PM, Christian Helmbold
christian.helmb...@yahoo.de wrote:
 Thank you. After adding one more dependency (javax.servlet-api), I get the 
 following error, when I try to start my RESTEasy/Weld configuration:

 Exception in thread main java.lang.RuntimeException: Unable to instantiate 
 InjectorFactory implementation.
 at 
 org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:156)
 at 
 org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer.start(NettyJaxrsServer.java:130)
 at com.example.jaxrscdi.App.run(App.java:25)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at 
 org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
 at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
 at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
 at 
 org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
 at 
 org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
 at 
 org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
 at 
 org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
 at 
 org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
 at org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
 at org.jboss.weld.environment.se.Weld.initialize(Weld.java:153)
 at org.jboss.weld.environment.se.StartMain.go(StartMain.java:41)
 at org.jboss.weld.environment.se.StartMain.main(StartMain.java:52)
 Caused by: java.lang.NullPointerException
 at 
 org.jboss.resteasy.cdi.CdiInjectorFactory.lookupBeanManager(CdiInjectorFactory.java:155)
 at 
 org.jboss.resteasy.cdi.CdiInjectorFactory.init(CdiInjectorFactory.java:45)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
 at 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
 at java.lang.Class.newInstance(Class.java:374)
 at 
 org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:148)
 ... 18 more


 Any idea?

 Regards,
 Christian


 --
 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

--
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 John D. Ament
Bill,

Actually from looking at the current impl, I have a fairly small
trivial change.  It would only work in CDI 1.1 though.  I could
probably implement it using reflection to avoid the compilation
change, if you're interested in taking the contribution.  This would
use standard CDI look up in an SE environment.

John

On Tue, Nov 26, 2013 at 6:06 PM, Bill Burke bbu...@redhat.com wrote:


 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] Announcing Arquillian REST extension.

2013-10-28 Thread John D. Ament
Bill,

From the looks of it, the framework is actually leveraging your client
framework..

https://github.com/arquillian/arquillian-extension-rest/blob/master/rest-client/impl/impl-3x/src/main/java/org/jboss/arquillian/extension/rest/client/RestEnricher.java#L94

Anyways, the use cases are many.  Basically, a test can now have a handle
injected to it that points to the REST API, no need to figure out the URL.


On Mon, Oct 28, 2013 at 6:10 PM, Bill Burke bbu...@redhat.com wrote:

 Have you seen our proxy extension? (This exists in 2.3.x too)


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

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



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

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


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

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/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 John D. Ament
Yeah, I've run into this too (my situation is worse, I have RESTeasy
w/ Jackson, Apache CXF w/ Jettison and a third system using Spring MVC
w/ Jackson).

Jettison's JSON structure is more like XML with its use of root
elements in a parent wrapper tag.  This is acceptable by JSON
standards, but not normal by JSON standards.



On Wed, Sep 4, 2013 at 4:57 PM, Bill Burke bbu...@redhat.com wrote:
 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