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: Ron S. <rs...@re...> - 2015-05-12 01:27:21
|
Meant to reply to list. Anyway, it looks like Resteasy 2.3.10.Final, more or less. -Ron -------- Forwarded Message -------- Subject: Re: [Resteasy-users] Question about Accepts Header Date: Mon, 11 May 2015 21:19:24 -0400 From: Ron Sigal <rs...@re...> To: Ramesh Reddy <ra...@re...> Hi Ramesh, Which version of Resteasy are you using in Teiid? Thanks, Ron On 05/11/2015 05:05 PM, Ramesh Reddy wrote: > Hi, > > In Teiid we have used RestEasy to implement the OData layer. We are seeing an issue with "Accepts" header. It is described here https://issues.jboss.org/browse/TEIID-3471 see 2nd comment. Any pointers to resolve are appreciated. > > Thanks > > Ramesh.. > > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
From: Ron S. <rs...@re...> - 2015-05-12 00:53:15
|
Hi Guy, Maybe there's a problem with the media type produced by your resource method. The attached TestResponseStatus works for me. However, when I comment out the @Produces annotation: > @Path("/") > public static class TestResourceImpl > { > @POST > @Path("post") > // @Produces("text/plain") > public Response.Status post() > { > return Response.Status.OK; > } > } I get > SEVERE: Failed executing POST /post > org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not > find MessageBodyWriter for response object of type: > javax.ws.rs.core.Response$Status of media type: application/octet-stream > at > org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:67) > at > org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:427) > at > org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:376) > at > org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179) > at > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) > at > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) > at > org.jboss.resteasy.plugins.server.tjws.TJWSServletDispatcher.service(TJWSServletDispatcher.java:40) > at > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2331) > at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2285) > at Acme.Serve.Serve$ServeConnection.run(Serve.java:2057) > at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1402) > at java.lang.Thread.run(Thread.java:745) > > status: Internal Server Error Is that what you are seeing? -Ron On 05/04/2015 03:01 PM, Guy Rouillier wrote: > We have a webservice POST method that returns a Response.Status object > as the entity. I've debugged this running method to verify that the > return value is Response.Status.OK. > > We use the RestEasy client proxy to invoke our webservice methods. The > approach works well for us, and our developers find the approach easy to > use. However, in this case, the proxy is deserializing this return > object as Response.Status.INTERNAL_SERVER_ERROR. > > Any idea on why this would happen? > > Thanks. > > -- > Guy Rouillier > > > --- > This email has been checked for viruses by Avast antivirus software. > http://www.avast.com > > > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
From: Ron S. <rs...@re...> - 2015-05-12 00:40:09
|
Hi Mark, I have a partial answer. That is, I can get Resteasy with Undertow to recognize @RolesAllowed, but I don't know much about security in Undertow. In the attached RollsAllowedTest, I have configured Undertow to impose identity constraints: > @BeforeClass > public static void init() throws Exception > { > server = new UndertowJaxrsServer().start(); > ResteasyDeployment deployment = new ResteasyDeployment(); > deployment.setApplicationClass(TestApplication.class.getName()); > deployment.setSecurityEnabled(true); > DeploymentInfo di = server.undertowDeployment(deployment, "/base"); > di.setContextPath("/di"); > di.setDeploymentName("DI"); > di.setClassLoader(TestApplication.class.getClassLoader()); > server.deploy(di); > } so that the test > @Test > public void testDeploymentInfo() throws Exception > { > Client client = ClientBuilder.newClient(); > Invocation.Builder builder = > client.target("http://localhost:8081/di/base/test").request(); > System.out.println("auth: " + getBasicAuthentication("bill", > "pwd")); > builder.header("Authorization", getBasicAuthentication("bill", > "pwd")); > String val = builder.get(String.class); > Assert.assertEquals("hello world", val); > client.close(); > } fails with status 403. In particular, org.jboss.resteasy.plugins.interceptors.RoleBasedSecurityFilter.filter() fails because it gets a null user principal. Can you see if you can set the user principal and let me know? Thanks, Ron On 04/16/2015 11:33 AM, Mark Vinkx wrote: > Hi > > I would like to enable basic authentication and @RolesAllowed for restEasy on UndertowJaxrsServer > Can someone help me out how to enable this > > I found some references to set resteasy.role.based.security but I did not find a way how to set this in my DeploymentInfo > <context-param> > <param-name>resteasy.role.based.security</param-name> > <param-value>true</param-value> > </context-param> > > Some of my code I have been trying is. But it is not working. > > webServer = new UndertowJaxrsServer(); > Undertow.Builder serverBuilder=Undertow.builder(); > serverBuilder = serverBuilder.addHttpListener(Integer.parseInt(properties.getProperty("port")), properties.getProperty("address")); > webServer.start(serverBuilder); > > HashMap users = new HashMap(2); > users.put("userOne", "passwordOne".toCharArray()); > users.put("userTwo", "passwordTwo".toCharArray()); > MapIdentityManager identityManager = new MapIdentityManager(users); > > DeploymentInfo di = webServer.undertowDeployment(MyApp.class) ; > di.setClassLoader(GetRest.class.getClassLoader()) ; > di.setDeploymentName("My Application"); > di.setContextPath("/di"); > LoginConfig loginConfig=new LoginConfig("BASIC","MyRealm"); > di.setLoginConfig(loginConfig); > di.setIdentityManager(identityManager); > webServer.deploy(di); > webServer.deploy(MyApp.class); > > > > class MapIdentityManager implements IdentityManager { > private final Map<String, char[]> users; > > public MapIdentityManager(Map<String, char[]> users) { > this.users = users; > } > > @Override > public Account verify(Account account) { > return account; > } > > @Override > public Account verify(String id, Credential credential) { > Account account = this.getAccount(id); > return account != null && this.verifyCredential(account, credential)?account:null; > } > > @Override > public Account verify(Credential credential) { > return null; > } > > private boolean verifyCredential(Account account, Credential credential) { > if(credential instanceof PasswordCredential) { > char[] password = ((PasswordCredential)credential).getPassword(); > char[] expectedPassword = (char[])this.users.get(account.getPrincipal().getName()); > return Arrays.equals(password, expectedPassword); > } else { > return false; > } > } > > private Account getAccount(final String id) { > return this.users.containsKey(id)?new Account() { > private final Principal principal = new Principal() { > @Override > public String getName() { > return id; > } > }; > @Override > public Principal getPrincipal() { > return this.principal; > } > @Override > public Set<String> getRoles() { > return Collections.emptySet(); > } > }:null; > } > } > > > > ------------------------------------------------------------------------------ > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > Develop your own process in accordance with the BPMN 2 standard > Learn Process modeling best practices with Bonita BPM through live exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
From: Ramesh R. <ra...@re...> - 2015-05-11 21:05:55
|
Hi, In Teiid we have used RestEasy to implement the OData layer. We are seeing an issue with "Accepts" header. It is described here https://issues.jboss.org/browse/TEIID-3471 see 2nd comment. Any pointers to resolve are appreciated. Thanks Ramesh.. |
From: Savvas A. M. <sav...@gm...> - 2015-05-09 15:55:19
|
Hi Peter, Have you considered using some other solution for serving static content (e.g. Apache in front of your app server or a CDN repository)? Regards, Savvas On 8 May 2015 at 04:44, Peter Luttrell <plu...@gm...> wrote: > I just posted a question on StackOverflow that might be better answered > here. > > > http://stackoverflow.com/questions/30111978/hosting-static-content-and-jax-rs-services-under-the-same-root-context > > Thanks, > Peter Luttrell > > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > |
From: Peter L. <plu...@gm...> - 2015-05-08 03:45:00
|
I just posted a question on StackOverflow that might be better answered here. http://stackoverflow.com/questions/30111978/hosting-static-content-and-jax-rs-services-under-the-same-root-context Thanks, Peter Luttrell |
From: Guy R. <guy...@gm...> - 2015-05-04 19:01:27
|
We have a webservice POST method that returns a Response.Status object as the entity. I've debugged this running method to verify that the return value is Response.Status.OK. We use the RestEasy client proxy to invoke our webservice methods. The approach works well for us, and our developers find the approach easy to use. However, in this case, the proxy is deserializing this return object as Response.Status.INTERNAL_SERVER_ERROR. Any idea on why this would happen? Thanks. -- Guy Rouillier --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com |
From: Ron S. <rs...@re...> - 2015-04-27 17:10:36
|
Ok, thanks, Jeff. On 04/27/2015 08:16 AM, Jeff Ramin wrote: > > Thanks Ron, but I worked around the problem (by using Resty instead of > resteasy), and > I don't have time to work on troubleshooting this problem. > > > > On 04/25/2015 07:53 PM, Ron Sigal wrote: >> Hey Jeff, >> >> I'm trying to duplicate your problem. I adapted your code in the >> attached TimeoutTest, but it runs fine. >> >> Could you fiddle with TimeoutTest and get it to throw the NPE? >> >> Thanks, >> Ron >> >> On 03/20/2015 03:40 PM, Jeff Ramin wrote: >>> Hi folks. >>> >>> Using resteasy 3.0.5, and I need to set connection and read timeouts on >>> a request. >>> Here's the code: >>> >>> org.apache.http.impl.client.DefaultHttpClient httpClient = >>> new >>> org.apache.http.impl.client.DefaultHttpClient(); >>> HttpParams params = new >>> org.apache.http.params.BasicHttpParams(); >>> >>> org.apache.http.params.HttpConnectionParams.setConnectionTimeout(params, >>> >>> 4000); >>> org.apache.http.params.HttpConnectionParams.setSoTimeout(params, 2000); >>> httpClient.setParams(params); >>> >>> executor = new >>> org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor(httpClient); >>> >>> >>> ClientRequest clientRequest = new ClientRequest(newPath, >>> executor); >>> clientRequest = clientRequest.accept(getResponseMediaType()) >>> .body(getRequestMediaType(), request) >>> .followRedirects(false); >>> clientRequest = clientRequest.header("headerKey", >>> "headerVal"); >>> T out = clientRequest.post(responseClassType).getEntity(); >>> >>> I'm seeing an NPE when this code is run: >>> >>> [java] java.lang.NullPointerException >>> [java] at >>> org.jboss.resteasy.spi.ResteasyProviderFactory.toHeaderString(ResteasyProviderFactory.java:1263) >>> >>> [java] at >>> org.jboss.resteasy.client.ClientRequest.toHeaderString(ClientRequest.java:204) >>> >>> [java] at >>> org.jboss.resteasy.client.ClientRequest.getHeaders(ClientRequest.java:329) >>> >>> [java] at >>> org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor.execute(AcceptEncodingGZIPInterceptor.java:27) >>> >>> [java] at >>> org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:47) >>> >>> [java] at >>> org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:441) >>> [java] at >>> org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:682) >>> >>> [java] at >>> org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:566) >>> [java] at >>> org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:571) >>> >>> >>> Any ideas on what I'm doing wrong? I get the error whether I include >>> the >>> ClientRequest.header() call or not. >>> >>> Thanks! >>> >>> >> >> >> >> ------------------------------------------------------------------------------ >> One dashboard for servers and applications across Physical-Virtual-Cloud >> Widest out-of-the-box monitoring support with 50+ applications >> Performance metrics, stats and reports that give you Actionable Insights >> Deep dive visibility with transaction tracing using APM Insight. >> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y >> >> >> _______________________________________________ >> Resteasy-users mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-users > > -- > Jeff Ramin > Software Engineer > Singlewire Software > 2601 W Beltline Hwy #510 > Madison, WI 53713 > > Phone Direct - 608.661.1172 > www.singlewire.com |
From: Jeff R. <jef...@si...> - 2015-04-27 12:45:07
|
Thanks Ron, but I worked around the problem (by using Resty instead of resteasy), and I don't have time to work on troubleshooting this problem. On 04/25/2015 07:53 PM, Ron Sigal wrote: > Hey Jeff, > > I'm trying to duplicate your problem. I adapted your code in the > attached TimeoutTest, but it runs fine. > > Could you fiddle with TimeoutTest and get it to throw the NPE? > > Thanks, > Ron > > On 03/20/2015 03:40 PM, Jeff Ramin wrote: >> Hi folks. >> >> Using resteasy 3.0.5, and I need to set connection and read timeouts on >> a request. >> Here's the code: >> >> org.apache.http.impl.client.DefaultHttpClient httpClient = new >> org.apache.http.impl.client.DefaultHttpClient(); >> HttpParams params = new >> org.apache.http.params.BasicHttpParams(); >> >> org.apache.http.params.HttpConnectionParams.setConnectionTimeout(params, >> 4000); >> org.apache.http.params.HttpConnectionParams.setSoTimeout(params, 2000); >> httpClient.setParams(params); >> >> executor = new >> org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor(httpClient); >> >> >> ClientRequest clientRequest = new ClientRequest(newPath, >> executor); >> clientRequest = clientRequest.accept(getResponseMediaType()) >> .body(getRequestMediaType(), request) >> .followRedirects(false); >> clientRequest = clientRequest.header("headerKey", >> "headerVal"); >> T out = clientRequest.post(responseClassType).getEntity(); >> >> I'm seeing an NPE when this code is run: >> >> [java] java.lang.NullPointerException >> [java] at >> org.jboss.resteasy.spi.ResteasyProviderFactory.toHeaderString(ResteasyProviderFactory.java:1263) >> >> [java] at >> org.jboss.resteasy.client.ClientRequest.toHeaderString(ClientRequest.java:204) >> >> [java] at >> org.jboss.resteasy.client.ClientRequest.getHeaders(ClientRequest.java:329) >> >> [java] at >> org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor.execute(AcceptEncodingGZIPInterceptor.java:27) >> >> [java] at >> org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:47) >> >> [java] at >> org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:441) >> [java] at >> org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:682) >> >> [java] at >> org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:566) >> [java] at >> org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:571) >> >> >> Any ideas on what I'm doing wrong? I get the error whether I include the >> ClientRequest.header() call or not. >> >> Thanks! >> >> > > > > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > > > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Jeff Ramin Software Engineer Singlewire Software 2601 W Beltline Hwy #510 Madison, WI 53713 Phone Direct - 608.661.1172 www.singlewire.com |
From: Ron S. <rs...@re...> - 2015-04-26 00:54:01
|
Hey Jeff, I'm trying to duplicate your problem. I adapted your code in the attached TimeoutTest, but it runs fine. Could you fiddle with TimeoutTest and get it to throw the NPE? Thanks, Ron On 03/20/2015 03:40 PM, Jeff Ramin wrote: > Hi folks. > > Using resteasy 3.0.5, and I need to set connection and read timeouts on > a request. > Here's the code: > > org.apache.http.impl.client.DefaultHttpClient httpClient = new > org.apache.http.impl.client.DefaultHttpClient(); > HttpParams params = new org.apache.http.params.BasicHttpParams(); > > org.apache.http.params.HttpConnectionParams.setConnectionTimeout(params, > 4000); > org.apache.http.params.HttpConnectionParams.setSoTimeout(params, 2000); > httpClient.setParams(params); > > executor = new > org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor(httpClient); > > ClientRequest clientRequest = new ClientRequest(newPath, executor); > clientRequest = clientRequest.accept(getResponseMediaType()) > .body(getRequestMediaType(), request) > .followRedirects(false); > clientRequest = clientRequest.header("headerKey", "headerVal"); > T out = clientRequest.post(responseClassType).getEntity(); > > I'm seeing an NPE when this code is run: > > [java] java.lang.NullPointerException > [java] at > org.jboss.resteasy.spi.ResteasyProviderFactory.toHeaderString(ResteasyProviderFactory.java:1263) > [java] at > org.jboss.resteasy.client.ClientRequest.toHeaderString(ClientRequest.java:204) > [java] at > org.jboss.resteasy.client.ClientRequest.getHeaders(ClientRequest.java:329) > [java] at > org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor.execute(AcceptEncodingGZIPInterceptor.java:27) > [java] at > org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:47) > [java] at > org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:441) > [java] at > org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:682) > [java] at > org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:566) > [java] at > org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:571) > > > Any ideas on what I'm doing wrong? I get the error whether I include the > ClientRequest.header() call or not. > > Thanks! > > |
From: Savvas A. M. <sav...@gm...> - 2015-04-19 09:43:04
|
Hi Jim, Have you given this a try to see if it works? :) Yes, that will work as long as the id form param is an string representation of an integer within the legal min-max range. You'll get a 400 "Bad Request" response if it's not. As a general note though, all HTTP attributes (headers, cookies, request and form params etc) will hit the JAX-RS endpoint as strings. The JAX-RS provider will then try to convert those strings into whatever type is defined in the resource class or the handler method, based on some default type conversion rules. HTH, Savvas On 19 April 2015 at 03:02, Jim Showalter <ji...@ji...> wrote: > For example, could I change: > > @FormParam("id")String id > > to: > > @FormParam("id")Integer id > > It's easy to do this for path and query params, but form params have an > input-type in the HTML, and I don't know if RESTEasy is > smart/helpful enough to ignore that an honore the type I declare in Java. > > > > ------------------------------------------------------------------------------ > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > Develop your own process in accordance with the BPMN 2 standard > Learn Process modeling best practices with Bonita BPM through live > exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- > event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > |
From: Jim S. <ji...@ji...> - 2015-04-19 02:14:49
|
For example, could I change: @FormParam("id")String id to: @FormParam("id")Integer id It's easy to do this for path and query params, but form params have an input-type in the HTML, and I don't know if RESTEasy is smart/helpful enough to ignore that an honore the type I declare in Java. |
From: SUMNER A. <And...@cu...> - 2015-04-17 00:25:55
|
I'm trying to implement NTLM authentication for my RestEasy client accessing a third party rest service with no success. As far as I can tell this is all I need to do for preemptive basic authentication, how to I extend this to work with a set of NTCredentials? ResteasyClient client = new ResteasyClientBuilder().build(); BasicAuthentication filter = new BasicAuthentication(config.user, config.password); client = client.register(filter); ResteasyWebTarget target = client.target(config.url); ProxyClient proxy = target.proxy(ProxyClient.class); return proxy.getApplication("1"); I've knocked my head against this for over 3 days now! The information contained in this email message is intended only for the addressee and is not necessarily the official view or communication of the New Zealand Customs Service. This email may contain information that is confidential or legally privileged. If you have received it by mistake, please: (a) reply promptly to that effect, and remove this email and the reply from your system; and (b) do not act on this email in any other way. |
From: Mark V. <mar...@uz...> - 2015-04-16 15:33:51
|
Hi I would like to enable basic authentication and @RolesAllowed for restEasy on UndertowJaxrsServer Can someone help me out how to enable this I found some references to set resteasy.role.based.security but I did not find a way how to set this in my DeploymentInfo <context-param> <param-name>resteasy.role.based.security</param-name> <param-value>true</param-value> </context-param> Some of my code I have been trying is. But it is not working. webServer = new UndertowJaxrsServer(); Undertow.Builder serverBuilder=Undertow.builder(); serverBuilder = serverBuilder.addHttpListener(Integer.parseInt(properties.getProperty("port")), properties.getProperty("address")); webServer.start(serverBuilder); HashMap users = new HashMap(2); users.put("userOne", "passwordOne".toCharArray()); users.put("userTwo", "passwordTwo".toCharArray()); MapIdentityManager identityManager = new MapIdentityManager(users); DeploymentInfo di = webServer.undertowDeployment(MyApp.class) ; di.setClassLoader(GetRest.class.getClassLoader()) ; di.setDeploymentName("My Application"); di.setContextPath("/di"); LoginConfig loginConfig=new LoginConfig("BASIC","MyRealm"); di.setLoginConfig(loginConfig); di.setIdentityManager(identityManager); webServer.deploy(di); webServer.deploy(MyApp.class); class MapIdentityManager implements IdentityManager { private final Map<String, char[]> users; public MapIdentityManager(Map<String, char[]> users) { this.users = users; } @Override public Account verify(Account account) { return account; } @Override public Account verify(String id, Credential credential) { Account account = this.getAccount(id); return account != null && this.verifyCredential(account, credential)?account:null; } @Override public Account verify(Credential credential) { return null; } private boolean verifyCredential(Account account, Credential credential) { if(credential instanceof PasswordCredential) { char[] password = ((PasswordCredential)credential).getPassword(); char[] expectedPassword = (char[])this.users.get(account.getPrincipal().getName()); return Arrays.equals(password, expectedPassword); } else { return false; } } private Account getAccount(final String id) { return this.users.containsKey(id)?new Account() { private final Principal principal = new Principal() { @Override public String getName() { return id; } }; @Override public Principal getPrincipal() { return this.principal; } @Override public Set<String> getRoles() { return Collections.emptySet(); } }:null; } } |
From: Sean D. <sea...@gm...> - 2015-03-22 20:33:39
|
Hello, This made it into ProxyBuilder... https://issues.jboss.org/browse/RESTEASY-610 Which is now deprecated. Is there another way to accomplish this now? Thanks. |
From: Jeff R. <jef...@si...> - 2015-03-20 20:04:54
|
Hi folks. Using resteasy 3.0.5, and I need to set connection and read timeouts on a request. Here's the code: org.apache.http.impl.client.DefaultHttpClient httpClient = new org.apache.http.impl.client.DefaultHttpClient(); HttpParams params = new org.apache.http.params.BasicHttpParams(); org.apache.http.params.HttpConnectionParams.setConnectionTimeout(params, 4000); org.apache.http.params.HttpConnectionParams.setSoTimeout(params, 2000); httpClient.setParams(params); executor = new org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor(httpClient); ClientRequest clientRequest = new ClientRequest(newPath, executor); clientRequest = clientRequest.accept(getResponseMediaType()) .body(getRequestMediaType(), request) .followRedirects(false); clientRequest = clientRequest.header("headerKey", "headerVal"); T out = clientRequest.post(responseClassType).getEntity(); I'm seeing an NPE when this code is run: [java] java.lang.NullPointerException [java] at org.jboss.resteasy.spi.ResteasyProviderFactory.toHeaderString(ResteasyProviderFactory.java:1263) [java] at org.jboss.resteasy.client.ClientRequest.toHeaderString(ClientRequest.java:204) [java] at org.jboss.resteasy.client.ClientRequest.getHeaders(ClientRequest.java:329) [java] at org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor.execute(AcceptEncodingGZIPInterceptor.java:27) [java] at org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:47) [java] at org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:441) [java] at org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:682) [java] at org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:566) [java] at org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:571) Any ideas on what I'm doing wrong? I get the error whether I include the ClientRequest.header() call or not. Thanks! -- Jeff Ramin Software Engineer Singlewire Software 2601 W Beltline Hwy #510 Madison, WI 53713 Phone Direct - 608.661.1172 www.singlewire.com |
From: Meissa M'b. S. <ms...@re...> - 2015-03-18 14:54:05
|
Hi all, I've asked a similar question about about linking solution with RestEasy. As I know, we can do it with RestEasy through Atom links or Http link header. I would like to know if it is planned to support JSON-LD or JSON-HAL. We have some customers that are requesting it and I would like to say yes or not to them. Any answer is greatly appreciated Meissa |
From: Ron S. <rs...@re...> - 2015-03-15 04:36:05
|
Hi Veit, One option is to install a ClientRequestFilter, which can access request headers before a request is sent. For example,, static class TestRequestFilter implements ClientRequestFilter { String value; public void setValue(String value) { this.value = value; } @Override public void filter(ClientRequestContext requestContext) throws IOException { MultivaluedMap<String, Object> mmap = requestContext.getHeaders(); List<Object> list = new ArrayList<Object>(); list.add(value); mmap.put("TestHeader", list); } } which could be used as follows: ResteasyClient client = new ResteasyClientBuilder().build(); TestRequestFilter filter = new TestRequestFilter(); client.register(filter); ResteasyWebTarget target = client.target("http://localhost:8081/post"); TestResource tr = target.proxy(TestResource.class); filter.setValue("abc"); Assert.assertEquals("abc", tr.post("hello 1")); // Resource returns value of header filter.setValue("xyz"); Assert.assertEquals("xyz", tr.post("hello 1")); I've attached an example program, TestProxy.java. -Ron > Hi. > > How can I set http headers when invoking methods on the client side proxy? > I'm aware that I can e.g. set credentials on the underlying HttpClient. > I do that once > before creating the proxy. But when using the proxy, I have to change > some http headers > on every request as well. So, what's the best practive for that? > > Thanks for your help! > Veit |
From: Ron S. <rs...@re...> - 2015-03-14 23:50:37
|
Hi Anthony, I see that com.fasterxml.jackson.jaxrs.base.ProviderBase, from which org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider is indirectly derived, has a method /** * Method called to locate {@link ObjectMapper} to use for serialization * and deserialization. If an instance has been explicitly defined by * {@link #setMapper} (or non-null instance passed in constructor), that * will be used. * If not, will try to locate it using standard JAX-RS * <code>ContextResolver</code> mechanism, if it has been properly configured * to access it (by JAX-RS runtime). * Finally, if no mapper is found, will return a default unconfigured * {@link ObjectMapper} instance (one constructed with default constructor * and not modified in any way) * * @param type Class of object being serialized or deserialized; * not checked at this point, since it is assumed that unprocessable * classes have been already weeded out, * but will be passed to <code>ContextResolver</code> as is. * @param mediaType Declared media type for the instance to process: * not used by this method, * but will be passed to <code>ContextResolver</code> as is. */ public MAPPER locateMapper(Class<?> type, MediaType mediaType); So, for example, you could try ResteasyJackson2Provider provider = new ResteasyJackson2Provider(); ObjectMapper mapper = provider.locateMapper(Object.class, MediaType.APPLICATION_JSON_TYPE); in a resource method. Does that work for you? -Ron |
From: Ron S. <rs...@re...> - 2015-03-14 22:44:32
|
Hi Dave J, You can validate the size of each element of a List by writing your own validation constraint. See the attached TestJunk program. Note that either @Form or @BeanParam would work. @Form is specific to Resteasy. -Ron |
From: Dave J <dev...@gm...> - 2015-03-14 00:03:51
|
All: after further review of the "extend JacksonJsonProvider" solution, I found the answer that suited me, which was extending ResteasyJackson2Provider: http://stackoverflow.com/a/23437874/4597638 On Fri, Mar 13, 2015 at 2:05 PM, Dave J <dev...@gm...> wrote: > Hello, > > After searching all over for info on this, I thought I would ask and see > if anyone has tried this and possibly succeeded with it.... > > I have a POJO I set up to be provided as XML or JSON depending on the > user's request. > Class looks something like this... > > @XmlRootElement(name="aaa") > public class AAA { > .... > } > > As XML it comes back fine, with the outermost tags being <aaa>....</aaa> > > However, when I add the @JsonRootName(value="aaa") at the same spot, I > don't end up with JSON along the lines of {"aaa": .... } or "aaa": {} -- > there is simply no mention of the intended "root element" and I end up with > just { ... } > > I've seen a couple possibilities for dealing with this: > - Jettison may deal with this annotation better than Jackson? > - It is possible to extend JacksonJsonProvider, overriding the > writeTo method, grab the mapper and set the SerializationFeature > WRAP_ROOT_VALUE -- tried this, didn't have any joy > > Maybe I should start with, is there some reason this doesn't work out of > the box like many other annotations do? Or perhaps I'm just using it wrong? > > Thanks so much. > |
From: Dave J <dev...@gm...> - 2015-03-13 18:05:17
|
Hello, After searching all over for info on this, I thought I would ask and see if anyone has tried this and possibly succeeded with it.... I have a POJO I set up to be provided as XML or JSON depending on the user's request. Class looks something like this... @XmlRootElement(name="aaa") public class AAA { .... } As XML it comes back fine, with the outermost tags being <aaa>....</aaa> However, when I add the @JsonRootName(value="aaa") at the same spot, I don't end up with JSON along the lines of {"aaa": .... } or "aaa": {} -- there is simply no mention of the intended "root element" and I end up with just { ... } I've seen a couple possibilities for dealing with this: - Jettison may deal with this annotation better than Jackson? - It is possible to extend JacksonJsonProvider, overriding the writeTo method, grab the mapper and set the SerializationFeature WRAP_ROOT_VALUE -- tried this, didn't have any joy Maybe I should start with, is there some reason this doesn't work out of the box like many other annotations do? Or perhaps I'm just using it wrong? Thanks so much. |
From: Kevin H. <khi...@hu...> - 2015-03-12 15:07:23
|
Hello, The user guides list a support for link headers and Atom. My question is there a similliar support for using JSON-LD and Hydra? Do you know of any examples, best practices showing how to do this using jax-rs/ resteasy? Thx for your help. Kind regards Kevin Hirschmann HUEBINET Informationsmanagement GmbH & Co. KG HUEBINET Informationsmanagement GmbH & Co. KG An der Königsbach 8 56075 Koblenz Sitz und Registergericht: Koblenz HRA 5329 Persönlich haftender Gesellschafter der KG: HUEBINET GmbH; Sitz und Registergericht: Koblenz HRB 6857 Geschäftsführung: Frank Hüttmann; Michael Biemer ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Der Nachrichtenaustausch mit HUEBINET Informationsmanagement GmbH & Co. KG, Koblenz via E-Mail dient lediglich zu Informationszwecken. Rechtsgeschäftliche Erklärungen mit verbindlichem Inhalt können über dieses Medium nicht ausgetauscht werden, da die Manipulation von E-Mails durch Dritte nicht ausgeschlossen werden kann. Email communication with HUEBINET Informationsmanagement GmbH & Co. KG is only intended to provide information of a general kind, and shall not be used for any statement with binding contents in respect to legal relations. It is not totally possible to prevent a third party from manipulating emails and email contents. |
From: Savvas A. M. <sav...@gm...> - 2015-03-03 22:54:19
|
Hi Jacub, Like you suggest, using an ExceptionMapper server-side and registering a ClientResponseFilter client side should do the trick and is probably the least intrusive way of achieving that goal. On the ClientResponseFilter, you can probe the http response status and run your logic accordingly. HTH, Savvas On 27 February 2015 at 13:14, John D. Ament <joh...@gm...> wrote: > Hi Jakub! > > I think you're looking for ContainerResponseFilter. > > John > > On Fri, Feb 27, 2015 at 8:03 AM Jakub Narloch <jmn...@gm...> 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 <jmn...@gm...>: >> >>> 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 >> Res...@li... >> 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 > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > |
From: John D. A. <joh...@gm...> - 2015-02-27 13:14:12
|
Hi Jakub! I think you're looking for ContainerResponseFilter. John On Fri, Feb 27, 2015 at 8:03 AM Jakub Narloch <jmn...@gm...> 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 <jmn...@gm...>: > >> 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 > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > |