You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2010 |
Jan
(1) |
Feb
(2) |
Mar
(6) |
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(8) |
Sep
(4) |
Oct
(2) |
Nov
(6) |
Dec
(4) |
| 2011 |
Jan
(4) |
Feb
(18) |
Mar
(9) |
Apr
(7) |
May
(6) |
Jun
(13) |
Jul
(11) |
Aug
(7) |
Sep
(12) |
Oct
(28) |
Nov
(12) |
Dec
(11) |
| 2012 |
Jan
(20) |
Feb
(21) |
Mar
(19) |
Apr
(12) |
May
(44) |
Jun
(23) |
Jul
(14) |
Aug
(26) |
Sep
(23) |
Oct
(7) |
Nov
(42) |
Dec
(15) |
| 2013 |
Jan
(62) |
Feb
(20) |
Mar
(14) |
Apr
(52) |
May
(29) |
Jun
(46) |
Jul
(20) |
Aug
(55) |
Sep
(27) |
Oct
(53) |
Nov
(29) |
Dec
(21) |
| 2014 |
Jan
(35) |
Feb
(44) |
Mar
(12) |
Apr
(37) |
May
(24) |
Jun
(17) |
Jul
(13) |
Aug
(1) |
Sep
(4) |
Oct
(13) |
Nov
(1) |
Dec
(1) |
| 2015 |
Jan
(11) |
Feb
(8) |
Mar
(10) |
Apr
(7) |
May
(17) |
Jun
(11) |
Jul
(13) |
Aug
(14) |
Sep
(6) |
Oct
(3) |
Nov
(7) |
Dec
(3) |
| 2016 |
Jan
(1) |
Feb
(4) |
Mar
(8) |
Apr
(2) |
May
(2) |
Jun
(10) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
|
From: John F. <jjf...@gm...> - 2013-12-21 16:03:01
|
John,
I'm excellent....thanks. 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 <joh...@gm...>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 <jjf...@gm...> 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) HV000007: 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) HV000003: 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) HV000007: 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) HV000003: 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) HV000007: 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) HV000003: 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) HV000007: 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) HV000003: 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=84349831&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Resteasy-users mailing list
> > Res...@li...
> > https://lists.sourceforge.net/lists/listinfo/resteasy-users
> >
>
|
|
From: John D. A. <joh...@gm...> - 2013-12-20 23:50:48
|
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 <jjf...@gm...> 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) HV000007: 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) HV000003: 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) HV000007: 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) HV000003: 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) HV000007: 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) HV000003: 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) HV000007: 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) HV000003: 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=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
|
|
From: John F. <jjf...@gm...> - 2013-12-20 22:53:37
|
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) HV000007: 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) HV000003: 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) HV000007: 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) HV000003: 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) HV000007: 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) HV000003: 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) HV000007: 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) HV000003: 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);
}
}
|
|
From: ignou_mca <bbs...@co...> - 2013-12-19 14:10:13
|
Hi William,
Thanks for your response, Can we use atom feed in this scenario?
If yes if any one can provide some sample that will be great help.
Thanks
Ignou
> Hi Ignou,
> In this case I believe you will have to create the XML manually in the jax-rs
> resource method body and return it as String, or you can manage to do this
> using a MessageBodyWriter/Reader.
> However, I think someone else might have some better alternative to achieve
> this--
> William Antônio Siqueira
> Java Support Analyst
> http://fxapps.blogspot.comhttp://www.williamantonio.wordpress.com
> http://williamprogrammer.com
>
> 2013/12/19 ignou_mca <bbs...@co...>
> Hi william,
> Thanks for your response, Sorry for missing out the application context name
> from the URI but my main question was I don't want to create the Details
> bean
> but want the response of products,accounts and customers in GET
> http://localhost:8080/application_context/details .
>
> Not sure if it is possible without the Bean class,
>
> Thanks
> Ignou
>
>
> > That's weird you have to bind your resources URI to the root URL.
> Usually
> > we also have the application context(sometimes also the rest context) before
> > the resource URI:
> > http://localhost:8080/{APP_CONTEXT}/products
> > http://localhost:8080/{APP_CONTEXT}/accounts
> > http://localhost:8080/{APP_CONTEXT}/customers
> >
> > To achieve what you want with details, you can create a bean
> > that aggregate all information and return it from the JAX-RS resource:
> > public class Details{ public List<Product> products; public
> > List<Customer> customers;
> > public List<Accounts> accounts;
> >
> > // get and sets
> > }
> > Then expose this bean from a JAX-RS resource:
> > @Path("details")public class DetailsResource{
> > public Details getDetails(){ Details details; // retrieve
> > Details return details; }
> > }
> >
> >
> > --
> > William Antônio Siqueira
> > Java Support Analyst
> > http://fxapps.blogspot.comhttp://www.williamantonio.wordpress.com
> > http://williamprogrammer.com
> >
> > 2013/12/19 ignou_mca <bbs...@co...>
> > Hi Team,
> > I am working on a rest application on which I have model for the
> following
> > objects customers ,accounts and products.
> > User can access the details of customers,accounts and products using the
> > following uri.
> >
> > [1] GET http://localhost:8080/customers
> > [2] GET http://localhost:8080/accounts
> > [3] GET http://localhost:8080/products
> >
> > Now my requirement is to combine the responses of the above 3 services in
> one
> > service, i.e. when user will try GET http://localhost:8080/details then he
> can
> > get all the customers , accounts and products info on the response.
> >
> > Is there any thing on RESTEASY which will help me to implement this
> > functionality.I don't want change anything on the model class or want to
> > add
> > any new model like details.
> >
> > Thanks
> > Ignou
> >
> >
> ------------------------------------------------------------------------------
> > Rapidly troubleshoot problems before they affect your business. Most IT
> > organizations don't have a clear picture of how application performance
> > affects their revenue. With AppDynamics, you get 100% visibility into your
> > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
> AppDynamics
> > Pro!
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktr
> > k
> > _______________________________________________
> > Resteasy-users mailing list
> > Res...@li...
> > 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=84349831&iu=/4140/ostg.clktr
> k
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
|
|
From: William A. S. <wil...@gm...> - 2013-12-19 11:06:39
|
Hi Ignou, In this case I believe you will have to create the XML manually in the jax-rs resource method body and return it as String, or you can manage to do this using a MessageBodyWriter/Reader. However, I think someone else might have some better alternative to achieve this -- *William Antônio Siqueira* *Java Support Analyst* *http://fxapps.blogspot.com <http://fxapps.blogspot.com>* *http://www.williamantonio.wordpress.com <http://www.williamantonio.wordpress.com>* *http://williamprogrammer.com <http://williamprogrammer.com>* 2013/12/19 ignou_mca <bbs...@co...> > Hi william, > Thanks for your response, Sorry for missing out the application context > name > from the URI but my main question was I don't want to create the Details > bean > but want the response of products,accounts and customers in GET > http://localhost:8080/application_context/details . > > Not sure if it is possible without the Bean class, > > Thanks > Ignou > > > > That's weird you have to bind your resources URI to the root URL. Usually > > we also have the application context(sometimes also the rest context) > before > > the resource URI: > > http://localhost:8080/{APP_CONTEXT}/products > > http://localhost:8080/{APP_CONTEXT}/accounts > > http://localhost:8080/{APP_CONTEXT}/customers > > > > To achieve what you want with details, you can create a bean > > that aggregate all information and return it from the JAX-RS resource: > > public class Details{ public List<Product> products; public > > List<Customer> customers; > > public List<Accounts> accounts; > > > > // get and sets > > } > > Then expose this bean from a JAX-RS resource: > > @Path("details")public class DetailsResource{ > > public Details getDetails(){ Details details; // > retrieve > > Details return details; } > > } > > > > > > -- > > William Antônio Siqueira > > Java Support Analyst > > http://fxapps.blogspot.comhttp://www.williamantonio.wordpress.com > > http://williamprogrammer.com > > > > 2013/12/19 ignou_mca <bbs...@co...> > > Hi Team, > > I am working on a rest application on which I have model for the > following > > objects customers ,accounts and products. > > User can access the details of customers,accounts and products using the > > following uri. > > > > [1] GET http://localhost:8080/customers > > [2] GET http://localhost:8080/accounts > > [3] GET http://localhost:8080/products > > > > Now my requirement is to combine the responses of the above 3 services > in one > > service, i.e. when user will try GET http://localhost:8080/details then > he can > > get all the customers , accounts and products info on the response. > > > > Is there any thing on RESTEASY which will help me to implement this > > functionality.I don't want change anything on the model class or want to > > add > > any new model like details. > > > > Thanks > > Ignou > > > > > ------------------------------------------------------------------------------ > > Rapidly troubleshoot problems before they affect your business. Most IT > > organizations don't have a clear picture of how application performance > > affects their revenue. With AppDynamics, you get 100% visibility into > your > > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > > Pro! > > > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktr > > k > > _______________________________________________ > > Resteasy-users mailing list > > Res...@li... > > 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=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > |
|
From: ignou_mca <bbs...@co...> - 2013-12-19 11:02:44
|
Hi william,
Thanks for your response, Sorry for missing out the application context name
from the URI but my main question was I don't want to create the Details bean
but want the response of products,accounts and customers in GET
http://localhost:8080/application_context/details .
Not sure if it is possible without the Bean class,
Thanks
Ignou
> That's weird you have to bind your resources URI to the root URL. Usually
> we also have the application context(sometimes also the rest context) before
> the resource URI:
> http://localhost:8080/{APP_CONTEXT}/products
> http://localhost:8080/{APP_CONTEXT}/accounts
> http://localhost:8080/{APP_CONTEXT}/customers
>
> To achieve what you want with details, you can create a bean
> that aggregate all information and return it from the JAX-RS resource:
> public class Details{ public List<Product> products; public
> List<Customer> customers;
> public List<Accounts> accounts;
>
> // get and sets
> }
> Then expose this bean from a JAX-RS resource:
> @Path("details")public class DetailsResource{
> public Details getDetails(){ Details details; // retrieve
> Details return details; }
> }
>
>
> --
> William Antônio Siqueira
> Java Support Analyst
> http://fxapps.blogspot.comhttp://www.williamantonio.wordpress.com
> http://williamprogrammer.com
>
> 2013/12/19 ignou_mca <bbs...@co...>
> Hi Team,
> I am working on a rest application on which I have model for the following
> objects customers ,accounts and products.
> User can access the details of customers,accounts and products using the
> following uri.
>
> [1] GET http://localhost:8080/customers
> [2] GET http://localhost:8080/accounts
> [3] GET http://localhost:8080/products
>
> Now my requirement is to combine the responses of the above 3 services in one
> service, i.e. when user will try GET http://localhost:8080/details then he can
> get all the customers , accounts and products info on the response.
>
> Is there any thing on RESTEASY which will help me to implement this
> functionality.I don't want change anything on the model class or want to
> add
> any new model like details.
>
> Thanks
> Ignou
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktr
> k
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
|
|
From: William A. S. <wil...@gm...> - 2013-12-19 10:33:22
|
That's weird you have to bind your resources URI to the root URL. Usually
we also have the application context(sometimes also the rest context)
before the resource URI:
http://localhost:8080/{APP_CONTEXT}/products
http://localhost:8080/{APP_CONTEXT}/accounts
http://localhost:8080/{APP_CONTEXT}/customers
To achieve what you want with details, you can create a bean
that aggregate all information and return it from the JAX-RS resource:
public class Details{
public List<Product> products;
public List<Customer> customers;
public List<Accounts> accounts;
// get and sets
}
Then expose this bean from a JAX-RS resource:
@Path("details")
public class DetailsResource{
public Details getDetails(){
Details details;
// retrieve Details
return details;
}
}
--
*William Antônio Siqueira*
*Java Support Analyst*
*http://fxapps.blogspot.com <http://fxapps.blogspot.com>*
*http://www.williamantonio.wordpress.com
<http://www.williamantonio.wordpress.com>*
*http://williamprogrammer.com <http://williamprogrammer.com>*
2013/12/19 ignou_mca <bbs...@co...>
> Hi Team,
> I am working on a rest application on which I have model for the
> following
> objects customers ,accounts and products.
> User can access the details of customers,accounts and products using the
> following uri.
>
> [1] GET http://localhost:8080/customers
> [2] GET http://localhost:8080/accounts
> [3] GET http://localhost:8080/products
>
> Now my requirement is to combine the responses of the above 3 services in
> one
> service, i.e. when user will try GET http://localhost:8080/details then
> he can
> get all the customers , accounts and products info on the response.
>
> Is there any thing on RESTEASY which will help me to implement this
> functionality.I don't want change anything on the model class or want to
> add
> any new model like details.
>
> Thanks
> Ignou
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
|
|
From: ignou_mca <bbs...@co...> - 2013-12-19 08:23:55
|
Hi Team, I am working on a rest application on which I have model for the following objects customers ,accounts and products. User can access the details of customers,accounts and products using the following uri. [1] GET http://localhost:8080/customers [2] GET http://localhost:8080/accounts [3] GET http://localhost:8080/products Now my requirement is to combine the responses of the above 3 services in one service, i.e. when user will try GET http://localhost:8080/details then he can get all the customers , accounts and products info on the response. Is there any thing on RESTEASY which will help me to implement this functionality.I don't want change anything on the model class or want to add any new model like details. Thanks Ignou |
|
From: ignou_mca <bbs...@co...> - 2013-12-19 08:23:55
|
Hi Team, I am working on a rest application on which I have model for the following objects customers ,accounts and products. User can access the details of customers,accounts and products using the following uri. [1] GET http://localhost:8080/customers [2] GET http://localhost:8080/accounts [3] GET http://localhost:8080/products Now my requirement is to combine the responses of the above 3 services in one service, i.e. when user will try GET http://localhost:8080/details then he can get all the customers , accounts and products info on the response. Is there any thing on RESTEASY which will help me to implement this functionality.I don't want change anything on the model class or want to add any new model like details. Thanks Ignou |
|
From: Marco B. <ma...@ma...> - 2013-12-16 11:26:35
|
Hi guys, when using the RestEasy proxy framework. is there a way to "swallow" all infrastructure exceptions (e.g. timeout, connection error, broken pipe) and return some other object instead? Example: "public MyApplicationResponse<?> doSomeCall() " should not throw an exception when a http timeout occurs, but rather return an MyApplicationErrorResponse object. >From the documentation I'm note quite sure if filters/interceptors are applicable here. Thanks Marco |
|
From: Bill B. <bb...@re...> - 2013-12-12 00:45:54
|
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 |
|
From: Bill B. <bb...@re...> - 2013-12-11 14:36:46
|
Not sure you understand what @Encoded does. It just means you want the
RAW parameter. For example "/Hello World" must be encoded as
"/Hello%20World"
So, if you had "/{text}"
@PathParam("text") String decoded,
@Encoded @PathParam("text") String encoded
decoded = "Hello World"
encoded = "Hello%20World"
If you are worried about XSS, then you should probably:
a) Not have REST services that output application/javascript
b) Implement CORS in your app.
On 12/10/2013 6:48 AM, John D. Ament wrote:
> Hi all,
>
> Wanted to get your opinions. What is the right time to use @Encoded?
> Purely from a security scan standpoint, a number of places in my
> coded were picked up for XSS, and I'm wondering if annotating these
> endpoints with @Encoded would help.
>
> John
>
> ------------------------------------------------------------------------------
> Sponsored by Intel(R) XDK
> Develop, test and display web and hybrid apps with a single code base.
> Download it for free now!
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|
|
From: John D. A. <joh...@gm...> - 2013-12-10 11:48:44
|
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 |
|
From: Gunnar M. <gu...@hi...> - 2013-12-04 19:50:50
|
Hi,
I'm using the Resteasy Proxy Framework [1] and want to invoke a service
with an URL, which contains a specific query parameter with a fixed value.
So I tried to do the following:
public interface MyClient {
@GET
@Path("http://server/foo?myParam=true")
int myMethod();
}
But this URL-encodes the question mark, resulting in a 404 error. Passing
the parameter via a method parameter annotated with @QueryParam works as
expected but I would prefer to avoid that since the parameter value never
changes and thus makes the client API less elegant. Is this possible?
Thanks,
--Gunnar
[1]
http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html/RESTEasy_Client_Framework.html#d4e2106
|
|
From: Gabriella T. <Gab...@ni...> - 2013-12-03 04:18:23
|
The interface:
@POST
@ClientResponseType(entityType = JAXBModule.class)
@Path("/upload")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_XML)
public Response upload(@MultipartForm FileUploadForm form);
The FileUploadForm class
public class FileUploadForm {
@FormParam("file")
@PartType(MediaType.APPLICATION_OCTET_STREAM)
private InputStream data;
@FormParam("user")
@PartType(MediaType.TEXT_PLAIN)
private String user;
@FormParam("password")
@PartType(MediaType.TEXT_PLAIN)
private String password;
@FormParam("filename")
@PartType(MediaType.TEXT_PLAIN)
private String filename;
public FileUploadForm() {
}
public InputStream getData() {
return data;
}
public void setData(InputStream data) {
this.data = data;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
The client:
ModuleArchiveService client = getArchiveService();
FileUploadForm upload = new FileUploadForm();
upload.setUser("gaby");
upload.setPassword("pwd");
upload.setFilename("hb-tsunami.rksh");
String fileToUpload = "testdata/hb-tsunami.rksh";
upload.setData(new FileInputStream(fileToUpload));
Response response = client.upload(upload);
The error message:
javax.ws.rs.ProcessingException: Unable to invoke request
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:249)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:407)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:102)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:62)
at com.sun.proxy.$Proxy26.upload(Unknown Source)
at nz.org.riskscape.archive.rest.LiveModuleArchiveServiceTest.testUploadFile(LiveModuleArchiveServiceTest.java:68)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: javax.ws.rs.ProcessingException: could not find writer for content-type multipart/form-data type: nz.org.riskscape.archive.rest.domain.FileUploadForm
at org.jboss.resteasy.core.interception.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40)
at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:138)
at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:117)
at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.aroundWriteTo(GZIPEncodingInterceptor.java:100)
at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:122)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation.java:341)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:520)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:486)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.loadHttpMethod(ApacheHttpClient4Engine.java:385)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:243)
... 30 more
This was working fine before the migration. I am obviously missing something :-(
Gaby
--
Dr Gabriella Turek
Sr. Software Engineer, Systems Development Team
NIWA Auckland, New Zealand
Tel: +64 9 3754645
www.niwa.co.nz
NIWA - Enhancing the benefit of New Zealand’s natural resources.
--
Please consider the environment before printing this email.
NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.
|
|
From: Bill B. <bb...@re...> - 2013-12-03 03:37:46
|
There's really not anything you can do about this at the Resteasy/JAX-RS
level. Buffering responses can also be VERY BAD for performance so
Resteasy (and really JAX-RS) writes directly to the network output
stream when marshalling via Jackson.
Depending on what servlet container you are using, you may be able to
configure it to buffer responses so that if an exception is thrown in
serialization the response can be reset.
On 11/30/2013 12:52 PM, Przemyslaw Wesolek wrote:
> Hello,
>
> I'm exposing my application via RESTEasy 3.0.5Final with Jackson JSON
> provider. The serialization is still being written, so sometimes bugs
> creep out. Most often it is some exception being thrown by the Jackson
> serializer.
>
> However, at the moment it happens, the response is already commited,
> status code set to 200 and partial response is being written to the
> output. This is Very Bad Thing, as from the client perspective the 200
> status code means everything went OK, but the JSON is broken.
>
> For example, if the Jackson can't serialize field "abc", the resulting
> JSON looks like:
>
>> {
>> // some fields serialized correctly by Jackson, like:
>> "ok_field": 1,
>> // ...
>> // and then the erronous one, the name without a value:
>> "abc"}
>
>
> This is because of the setStatus() call being in ServerResponseWriter in
> line 70:
>
>> response.setStatus(jaxrsResponse.getStatus());
>
> while the serialization (and an exception throw) being in line 99:
>
>> writerContext.proceed();
>
> Is there any way I can defer committing anything in the response until
> the whole response body is prepared?
>
> Regards,
> Przemek
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|
|
From: Przemyslaw W. <prz...@go...> - 2013-11-30 17:52:44
|
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
|
|
From: John D. A. <joh...@gm...> - 2013-11-30 13:08:25
|
Bill, I sent a pull request last evening. A couple of issues I noticed: - your source says 3.0.5.Final, I was expecting 3.0.6-SNAPSHOT or something like that. Makes me a little bit scared to build it. Not sure if your poms didn't get updated in your release. - You have some failing tests. I'm going to see if I can fix those as well. On Tue, Nov 26, 2013 at 7:16 PM, Bill Burke <bb...@re...> wrote: > Submit a pull request, i'll take a look > > > On 11/26/2013 7:05 PM, John D. Ament wrote: >> >> Bill, >> >> Actually from looking at the current impl, I have a fairly small >> trivial change. It would only work in CDI 1.1 though. I could >> probably implement it using reflection to avoid the compilation >> change, if you're interested in taking the contribution. This would >> use standard CDI look up in an SE environment. >> >> John >> >> On Tue, Nov 26, 2013 at 6:06 PM, Bill Burke <bb...@re...> wrote: >>> >>> >>> >>> On 11/26/2013 4:17 PM, Christian Helmbold wrote: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>> John D. Ament <joh...@gm...> schrieb am 20:23 Dienstag, >>>>> 26.November 2013: >>>>>> >>>>>> >>>>>> I assumed this would happen, based on Bill's email. >>>> >>>> >>>> >>>> You're right. This happend after adding the following line to my startup >>>> code: >>>> >>>> >>>> >>>> deployment.setInjectorFactoryClass(org.jboss.resteasy.cdi.CdiInjectorFactory.class.getName()); >>>> >>>>> you'll probably >>>>> need to extend the CdiInjectorFactory to use your own BeanManager. >>>> >>>> >>>> >>>> I wonder why >>>> >>>> http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034 >>>> seems to be so simple. >>>> >>>> Sounds like Weld and RESTEasy are simply not built for what I want to >>>> do! >>>> The philosophie seems to be: use the whole application server or use >>>> something else. My idea was to create a small configuration which could >>>> be >>>> restarted very fast during development. I've done something similar with >>>> Guice and Jersey. But Wildfly should start pretty fast, so this could be >>>> better than trying to do the configuration myself. >>>> >>> >>> I would dive into this, but I don' thave the cycles at this time. Its >>> just >>> a matter of gettin Weld initialized in a SE environment, and then >>> tweaking >>> the CdiInjectorFactory. >>> >>> >>> There is a Resteasy Guice adapter too. >>> >>> >>> >>> -- >>> Bill Burke >>> JBoss, a division of Red Hat >>> http://bill.burkecentral.com > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2013-11-27 17:38:43
|
Are you sure this is a problem with Resteasy? Your link references Jersey. On 11/27/2013 11:04 AM, Charif Mauricio Nadir wrote: > Hi people I want to send @FormParams using a PUT method. But the mapped > attributes are never filled. I read here [1] that FormsParams only work > with POST method, can you confirm that? > Thanks in advance. > > Mauricio Ch. > > [1] > http://stackoverflow.com/questions/5964122/jax-rs-with-jersey-passing-form-parameters-to-put-method-for-updating-a-resourc > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Charif M. N. <mry...@gm...> - 2013-11-27 16:05:07
|
Hi people I want to send @FormParams using a PUT method. But the mapped attributes are never filled. I read here [1] that FormsParams only work with POST method, can you confirm that? Thanks in advance. Mauricio Ch. [1] http://stackoverflow.com/questions/5964122/jax-rs-with-jersey-passing-form-parameters-to-put-method-for-updating-a-resourc |
|
From: Gabriella T. <Gab...@ni...> - 2013-11-27 02:38:12
|
So I've managed to expend my client code to support proxy and SSL.
Now I need to make them work with a redirect.
My queries are all failing with a status 301 (both POST and GET)
What do I need to do to make sure the redirect is followed?
Here's an example of my call
ResteasyClientBuilder rsb = new ResteasyClientBuilder();
rsb.defaultProxy("myproxy",80,"http");
SSLContext ctx = getSSLContext();
rsb.sslContext(ctx);
ResteasyClient rsc = rsb.build();
ResteasyWebTarget target = rsc.target(BASEURL);
RiskScapeLicenseService client = target.proxy(RiskScapeLicenseService.class);
Response response = client.licenseRequest(……);
Thanx
Gaby
--
Please consider the environment before printing this email.
NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.
|
|
From: Bill B. <bb...@re...> - 2013-11-27 00:17:06
|
Submit a pull request, i'll take a look On 11/26/2013 7:05 PM, John D. Ament wrote: > Bill, > > Actually from looking at the current impl, I have a fairly small > trivial change. It would only work in CDI 1.1 though. I could > probably implement it using reflection to avoid the compilation > change, if you're interested in taking the contribution. This would > use standard CDI look up in an SE environment. > > John > > On Tue, Nov 26, 2013 at 6:06 PM, Bill Burke <bb...@re...> wrote: >> >> >> On 11/26/2013 4:17 PM, Christian Helmbold wrote: >>> >>> >>> >>> >>> >>> >>>> John D. Ament <joh...@gm...> schrieb am 20:23 Dienstag, >>>> 26.November 2013: >>>>> >>>>> I assumed this would happen, based on Bill's email. >>> >>> >>> You're right. This happend after adding the following line to my startup >>> code: >>> >>> >>> deployment.setInjectorFactoryClass(org.jboss.resteasy.cdi.CdiInjectorFactory.class.getName()); >>> >>>> you'll probably >>>> need to extend the CdiInjectorFactory to use your own BeanManager. >>> >>> >>> I wonder why >>> http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034 >>> seems to be so simple. >>> >>> Sounds like Weld and RESTEasy are simply not built for what I want to do! >>> The philosophie seems to be: use the whole application server or use >>> something else. My idea was to create a small configuration which could be >>> restarted very fast during development. I've done something similar with >>> Guice and Jersey. But Wildfly should start pretty fast, so this could be >>> better than trying to do the configuration myself. >>> >> >> I would dive into this, but I don' thave the cycles at this time. Its just >> a matter of gettin Weld initialized in a SE environment, and then tweaking >> the CdiInjectorFactory. >> >> >> There is a Resteasy Guice adapter too. >> >> >> >> -- >> Bill Burke >> JBoss, a division of Red Hat >> http://bill.burkecentral.com -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: John D. A. <joh...@gm...> - 2013-11-27 00:05:35
|
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 <bb...@re...> wrote: > > > On 11/26/2013 4:17 PM, Christian Helmbold wrote: >> >> >> >> >> >> >>> John D. Ament <joh...@gm...> 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 |
|
From: Bill B. <bb...@re...> - 2013-11-26 23:06:51
|
On 11/26/2013 4:17 PM, Christian Helmbold wrote: > > > > > >> John D. Ament <joh...@gm...> 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 |
|
From: Gabriella T. <Gab...@ni...> - 2013-11-26 23:03:38
|
So, I've resolved my issue by updating my schema with jaxb:version="2.0" and regenerating the jaxb classes. The tip off was Bill's mention of there being a Resteasy Client -> JAX-RS 2.0 mismatch migration problem Cheers! Gaby >On 27/11/13 10:00 AM, "Gabriella Turek" <Gab...@ni...> >wrote: > >>No, I've tried that, it does not work. I get the following error: >> >>java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast >>to >>nz.org.riskscape.license.rest.domain.LicenseList >> at >>nz.org.riskscape.license.rest.RiskScapeLicenseServiceTest.testGetExpiredL >>i >>c >>enses(RiskScapeLicenseServiceTest.java:102) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java >>: >>5 >>7) >> at >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI >>m >>p >>l.java:43) >> at java.lang.reflect.Method.invoke(Method.java:606) >> >> >>-- >>Dr Gabriella Turek >>Sr. Software Engineer, Systems Development Team >>NIWA Auckland, New Zealand >>Tel: +64 9 3754645 >>www.niwa.co.nz >>NIWA - Enhancing the benefit of New Zealand¹s natural resources. >> >> >>>Date: Tue, 26 Nov 2013 15:51:56 -0500 >>>From: Bill Burke <bb...@re...> >>>Subject: Re: [Resteasy-users] Replacing ProxyFactory with >>> RestEasyWebTarget does not work >>>To: res...@li... >>>Message-ID: <529...@re...> >>>Content-Type: text/plain; charset=windows-1252; format=flowed >>> >>>This is a Resteasy Client -> JAX-RS 2.0 mismatch migration problem. >>> >>>Replace: >>> >>>response.getEntity() >>> >>>with: >>> >>>response.readEntity(String.class); >>> >>>replace String.class to whatever class you want to marshal to. >>>getEntity() returns null if you haven't unmarshalled anything with >>>readEntity(). >>> >>> >>> >>>On 11/26/2013 2:59 PM, Gabriella Turek wrote: >>>> After upgrading from Resteasy 2.4 to 3.0.5, none of my client calls >>>>work >>>> anymore. The entity which I am expecting (as simple as a String) is >>>> always null. In debug mode I can see it being set in the Response >>>>object >>>> on the server side, but on the client side the entity in the Response >>>>is >>>> null. >>>> Here is an example call: >>>> >>>> The interface: >>>> >>>> | /** >>>> * @return all expired licenses >>>> */ >>>> @GET >>>> @ClientResponseType(entityType= LicenseList.class) >>>> @Path("/expired") >>>> @Produces(MediaType.APPLICATION_XML) >>>> public Response getExpiredLicenses();| >>>> >>>> The implementation: >>>> >>>> | /** >>>> * @return all expired licenses >>>> */ >>>> @Override >>>> public Response getExpiredLicenses() { >>>> try { >>>> LicenseList list= LicensesDBUtil.getExpiredLicenses(); >>>> Response resp= Response.ok().entity(list).build(); >>>> return resp; >>>> } catch (SQLException e) { >>>> LOG.error("Error getting expired licenses :" + >>>>e.getMessage()); >>>> return >>>>Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).ty >>>>p >>>>e >>>>(MediaType.TEXT_PLAIN).build(); >>>> }| >>>> >>>> The test call : >>>> >>>> | @Test >>>> public void testGetExpiredLicenses() throws Exception { >>>> ResteasyClientBuilder rsb= new ResteasyClientBuilder(); >>>> ResteasyClient rsc= rsb.build(); >>>> ResteasyWebTarget target= rsc.target(BASEURL); >>>> return target.proxy(RiskScapeLicenseService.class); >>>> Response response= client.getExpiredLicenses(); >>>> assertTrue(HttpResponseCodes.SC_OK== response.getStatus()); >>>> @SuppressWarnings("unchecked") >>>> JAXBElement<LicenseList> element= (JAXBElement<LicenseList>) >>>>response.getEntity(); >>>> LicenseList list= element.getValue(); >>>> assertEquals(4, list.getLicenses().size()); >>>> for (License lic: list.getLicenses()) { >>>> assertTrue((new >>>>Date()).after(DateUtils.parseDate(lic.getValidTo(), new String[] { >>>>"yyyy-MM-dd" }))); >>>> } >>>> }| >>>> >>>> My web.xml file: >>>> >>>> |<?xml version="1.0" encoding="UTF-8"?> >>>> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>>xmlns="http://java.sun.com/xml/ns/javaee" >>>>xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >>>>xsi:schemaLocation="http://java.sun.com/xml/ns/javaee >>>>http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> >>>> <display-name>riskscapelic_rest</display-name> >>>> <listener> >>>> <listener-class> >>>> >>>>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap >>>> </listener-class> >>>> </listener> >>>> <servlet> >>>> <servlet-name>Resteasy</servlet-name> >>>> >>>><servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDis >>>>p >>>>a >>>>tcher</servlet-class> >>>> </servlet> >>>> <servlet-mapping> >>>> <servlet-name>Resteasy</servlet-name> >>>> <url-pattern>/*</url-pattern> >>>> </servlet-mapping> >>>> <context-param> >>>> <param-name>resteasy.scan</param-name> >>>> <param-value>true</param-value> >>>> </context-param> >>>> <context-param> >>>> <param-name>resteasy.servlet.mapping.prefix</param-name> >>>> <param-value>/</param-value> >>>> </context-param> >>>> </web-app>| >>>> >>>> The LicenseList class: >>>> >>>> |@XmlRootElement(name= "LicenseList") >>>> @XmlAccessorType(XmlAccessType.FIELD) >>>> @XmlType(name= "licenseList", propOrder= { >>>> "licenses" >>>> }) >>>> public class LicenseList { >>>> >>>> @XmlElement(name= "Licenses", required= true) >>>> protected List<License> licenses; >>>> >>>> /** >>>> * Gets the value of the licenses property. >>>> * >>>> * <p> >>>> * This accessor method returns a reference to the live list, >>>> * not a snapshot. Therefore any modification you make to the >>>> * returned list will be present inside the JAXB object. >>>> * This is why there is not a <CODE>set</CODE> method for the >>>>licenses property. >>>> * >>>> * <p> >>>> * For example, to add a new item, do as follows: >>>> * <pre> >>>> * getLicenses().add(newItem); >>>> * </pre> >>>> * >>>> * >>>> * <p> >>>> * Objects of the following type(s) are allowed in the list >>>> * {@link License } >>>> * >>>> * >>>> */ >>>> public List<License> getLicenses() { >>>> if (licenses== null) { >>>> licenses= new ArrayList<License>(); >>>> } >>>> return this.licenses; >>>> } >>>> >>>> }| >>>> >>>> I am using JDK 1.7, Tomcat 7.0.47 >>>> -- >>>> Dr Gabriella Turek >>>> Sr. Software Engineer, Systems Development Team >>>> NIWA Auckland, New Zealand >>>> Tel: +64 9 3754645 >>>> www.niwa.co.nz >>>> NIWA - Enhancing the benefit of New Zealand?s natural resources. >>>> -- >>>> Please consider the environment before printing this email. >>>> NIWA is the trading name of the National Institute of Water & >>>> Atmospheric Research Ltd. >>>> >>>> >>>> >>>>----------------------------------------------------------------------- >>>>- >>>>- >>>>----- >>>> Rapidly troubleshoot problems before they affect your business. Most >>>>IT >>>> organizations don't have a clear picture of how application >>>>performance >>>> affects their revenue. With AppDynamics, you get 100% visibility into >>>>your >>>> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of >>>>AppDynamics Pro! >>>> >>>>http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.cl >>>>k >>>>t >>>>rk >>>> >>>> >>>> >>>> _______________________________________________ >>>> Resteasy-users mailing list >>>> Res...@li... >>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users >>>> >>> >>>-- >>>Bill Burke >>>JBoss, a division of Red Hat >>>http://bill.burkecentral.com -- Please consider the environment before printing this email. NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd. |