Re: [Resteasy-users] Setting cookies per request in Resteasy Client
Hi Craig, We depreated this mailing list, please start to use the new ones: https://lists.jboss.org/mailman/listinfo/resteasy-dev https://lists.jboss.org/mailman/listinfo/resteasy https://lists.jboss.org/mailman/listinfo/resteasy-commits -- Weinan Li / JBoss > On Apr 11, 2016, at 10:54 PM, Craig Ching <craigch...@gmail.com> wrote: > > Hi, > > I’m having problems managing cookies in the Resteasy Client. It seems like > when a “Set-Cookie” is returned from a server, that there is no way to clear > that cookie on a new request. Essentially, it appears that the cookies are > set on the client and not on the individual invocation (maybe via an Apache > HttpContext?). I want to take responsibility for managing cookies > *completely* and do it per request. > > I’ve tried playing with ClientRequestFilter, but the cookies don’t show up in > the headers or the cookies there. I’m looking at what I can override in the > ApacheHttpClient4Engine, but it looks like there is no way to specify a > context per request. > > Does anyone have any ideas of other things I could try? I’m at the point of > having to drop down to Apache HttpClient directly for my calls, but I don’t > want to as it’s nice using the JAX-RS Response. > > Thanks for any help! > > Cheers, > Craig > -- > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ > gampad/clk?id=1444514301=/ca-pub-7940484522588532 > ___ > Resteasy-users mailing list > Resteasy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Max headers reached
Hi Ricardo, Could you please help to create a JIRA issue for this? -- Weinan Li / JBoss > On Dec 23, 2015, at 12:14 AM, Ricardo Veloso <ricardo.vel...@flowinn.biz> > wrote: > > When invoking entities with a variant with an encoding, and an > IllegalStateException is thrown after a while because request headers reaches > to is maximum. > > This is because setEntity on ClientInvocation adds the header to a map: > headers.header("Content-Encoding", v.getEncoding()); > > This should use a putSingle or a method headers.setEncoding should be created > like setLanguage or setMediaType. > Cumprimentos / Best regards, > Ricardo Veloso > > > -- > ___ > Resteasy-users mailing list > Resteasy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/resteasy-users -- ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Anyone merging PRs?
Sorry for the delay John. Ron and I are working on Wildfly/EAP bug requests these days. Let us see whether we can find more time to review PRs asap. -- Weinan Li / JBoss > On Nov 7, 2015, at 8:39 PM, John D. Ament <john.d.am...@gmail.com> wrote: > > All, > > I've noticed that no PRs have been merged in a while. Any plans to accept > outside contributions? > > John > -- > ___ > Resteasy-users mailing list > Resteasy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/resteasy-users -- ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Version 3.0.12.Final in a Maven Repository?
Hi Ron, Could you please help to upload 3.0.12.Final to our jboss.org maven repository? (Or can you please tell me how to do it so I can upload it). -- Weinan Li / JBoss On Aug 18, 2015, at 1:09 PM, Anthony Whitford anth...@whitford.com wrote: I see that Version 3.0.12.Final was released last week, but I don’t see it available on a Maven repository. Am I missing something? -- ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Resteasy 3.0.9.Final not deleting temporary files. What to do?
Hi Paulo, Or you can directly use the upstream master plus this PR: https://patch-diff.githubusercontent.com/raw/resteasy/Resteasy/pull/671.diff Which we have fixed many build problems and easier to use :-) -- Weinan Li / JBoss On Aug 17, 2015, at 7:55 PM, Paulo Augusto de Figueiredo Vivacqua paulo.vivac...@globalweb.com.br wrote: Hi Weinan, Thank you very much, we will upgrade the Resteasy Jboss module to 3.0.12.Final, hopefully it will work. best regards, decdiage.png Paulo Vivacqua Desenvolvedor Fábrica GID paulo.vivac...@globalweb.com.br t +55 61 3305-4249 | c +55 61 9964-4792 globalwebcorp.com.br giefehbi.png afijjdji.pngcdbdejch.pngeaihgdib.pngcidcfjaf.pngdegfcajf.pngcibgdhea.png Em 16/08/2015 00:13, Weinan Li escreveu: Maybe it’s affected by this: https://issues.jboss.org/browse/RESTEASY-1182 https://github.com/resteasy/Resteasy/pull/654/files It’s fixed in 3.0.12.Final: https://github.com/resteasy/Resteasy/releases/tag/3.0.12.Final -- Weinan Li / JBoss On Aug 15, 2015, at 2:17 AM, Paulo Augusto de Figueiredo Vivacqua paulo.vivac...@globalweb.com.br wrote: Hello Resteasy users, We recently came across a problem on our production environment where Resteasy was saving temporary files on '/tmp' without deleting. We upgraded the JBoss AS 7.1.1 Resteasy modules to 3.0.9.Final and httpcomponents module to the latest libraries httpcore-4.4.1.jar, httpmime-4.5.jar and httpclient-4.5.jar. Unfortunantly we are still having the same problems Any help is appreciated. Thank you. ajgcaadc.png Paulo Vivacqua Desenvolvedor Fábrica GID paulo.vivac...@globalweb.com.br t +55 61 3305-4249 | c +55 61 9964-4792 globalwebcorp.com.br deibeiif.png ceghhcdb.pngeabjceig.pngfjdececd.pngdbdciacd.pngghcccghc.pngcdhfihbg.png -- ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Resteasy 3.0.9.Final not deleting temporary files. What to do?
Hi Paulo, Could you please provide us some codes about your use case so we can reproduce the bug to investigate on it? -- Weinan Li / JBoss On Aug 18, 2015, at 3:46 AM, Paulo Augusto de Figueiredo Vivacqua paulo.vivac...@globalweb.com.br wrote: Weinan, We were able to run the application using the Jboss module 3.0.12.Final, unfortunately resteasy is still not deleting the 'm4j' tmp files. thank you very much! best regards, Paulo Vivacqua -- ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Resteasy 3.0.9.Final not deleting temporary files. What to do?
Maybe it’s affected by this: https://issues.jboss.org/browse/RESTEASY-1182 https://github.com/resteasy/Resteasy/pull/654/files It’s fixed in 3.0.12.Final: https://github.com/resteasy/Resteasy/releases/tag/3.0.12.Final -- Weinan Li / JBoss On Aug 15, 2015, at 2:17 AM, Paulo Augusto de Figueiredo Vivacqua paulo.vivac...@globalweb.com.br wrote: Hello Resteasy users, We recently came across a problem on our production environment where Resteasy was saving temporary files on '/tmp' without deleting. We upgraded the JBoss AS 7.1.1 Resteasy modules to 3.0.9.Final and httpcomponents module to the latest libraries httpcore-4.4.1.jar, httpmime-4.5.jar and httpclient-4.5.jar. Unfortunantly we are still having the same problems Any help is appreciated. Thank you. ajgcaadc.png Paulo Vivacqua Desenvolvedor Fábrica GID paulo.vivac...@globalweb.com.br t +55 61 3305-4249 | c +55 61 9964-4792 globalwebcorp.com.br deibeiif.png ceghhcdb.pngeabjceig.pngfjdececd.pngdbdciacd.pngghcccghc.pngcdhfihbg.png -- ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] How to remove headers from resteasy Response
Maybe you can use ResponseBuilder to build a custom response? In addition: While @Cache builds a complex Cache-Control header, @NoCache is a simplified notation to say that you don't want anything cached i.e. Cache-Control: nocache.” On Jun 24, 2014, at 10:34 PM, ignou_mca bbsr_...@cooltoad.com wrote: Hi Team, On one of my application I don't want the headers Pragma and Cache- Control but these headers are always coming in Response as below Pragma: No-cache Cache-Control: no-cache How I can remove those? Thanks BBSR -- Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Ignoring a sub-url (when deployed in wfly8) ?
Hi Heiko, If you bind @ApplicationPath to ‘/‘, then you will mask all the other paths of JPS pages. Please bind RESTEasy to some specific path, ‘/rest/‘ for example. Here is an example for your reference: https://github.com/wildfly/quickstart/tree/master/kitchensink-jsp -- Weinan Li On Thursday, May 15, 2014 at 12:16 AM, Heiko W.Rupp wrote: Hey, suppose I have my rest-y app running on / in a Wildfly 8 container with jboss-web context-root//context-root and @ApplicationPath(/) and basically an empty web.xml (http://web.xml) Can I somehow say /* , but not /foo/* should be handled by RestEasy, while /foo/* should be served as normal content (.html, .js, .css etc.).? Thanks Heiko -- Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free. http://p.sf.net/sfu/SauceLabs ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free. http://p.sf.net/sfu/SauceLabs ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] call methods after javax.ws.rs.core.Application initialization
Why not trying to use embed server, which you can have better control on lifecycle: http://docs.jboss.org/resteasy/docs/3.0-beta-3/userguide/html_single/#RESTEasy_Embedded_Container Sent with Unibox On Mar 6, 2014, at 10:43 PM, Alexandros Antoniadis antoniadis.alexandros...@gmail.com wrote: I use RestEasy to develop a web application. I have a class that extends javax.ws.rs.core.Application and registers the REST services. After the creation and (full) initialization of all the services I want to execute some methods of these services. These methods may call other methods of the service using the REST API. The problem is that until the moment that my subclass of javax.ws.rs.core.Application is initialized (end of constructor) the REST API is not available (calls using REST API block) so it is not possible to call the methods after the service initialization. I also, tried using org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap without success. Also, ServletContextListener.contextInitialized seems to be executed earlier than the javax.ws.rs.core.Application.init so there are no references to the service objects. In general, I am looking for a clean way to execute code right after the services are available/deployed. Is there any way to be notified for such an event? Thank you, Alex -- Subversion Kills Productivity. Get off Subversion Make the Move to Perforce. With Perforce, you get hassle-free workflows. Merge that actually works. Faster operations. Version large binaries. Built-in WAN optimization and the freedom to use Git, Perforce or both. Make the move to Perforce. http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Ho to call a method of another REST interface from a given interface within same container?
Hi Leena, You can use standard RESTEasy client API to call your RestB within RestA. I wonder the reason why you don’t want to expose URI in your call. Do you want to bypass all the network overhead? If so you can consider to refactor your RestB and put the common logics into separate APIs that not exposed as a web service. -- Weinan Li On Friday, February 7, 2014 at 3:50 AM, Cassa L wrote: Hi, I have two REST interfaces in my web application. say RestA and RestB. RestB needs to invoke a method from RestA within same container from one of its method. How do I call this? If I try to create ProxyFactory, I need to give URI. Is there a way to just call this resource without using URI and invoke directly. All resources are registered with the container when I initialize application, but cant figure out way to get it. Regards, Leena -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Scan vs Spring
Hi Anthony, Are you using Spring with WildFly? If so, I have two examples on it: https://github.com/liweinan/resteasy-spring-eap-integration If you are using RESTEasy Spring as standalone, then RESTEasy has provided an example: https://github.com/resteasy/Resteasy/tree/master/jaxrs/examples/resteasy-springMVC -- Weinan Li On Friday, February 7, 2014 at 3:41 AM, Anthony Whitford wrote: I have a project that is using RestEasy -- there were 23 resources. The project was using resteasy.scan.resources=true in the web.xml (http://web.xml). Now, I added another resource. This time, we need Spring. So, I add the resteasy-spring dependency and update the web.xml (http://web.xml), according to the docs: http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html/RESTEasy_Spring_Integration.html Now, the boot fails because the scan can't coexist with Spring. No problem, I can remove the scan But then my original 23 resources are not available. According to the documentation... RESTEasy will automatically scan for @Provider and JAX-RS resource annotations on your bean class and register them as JAS-RS resources. It would seem that I need to make the 23 resources Spring beans (Add a @Named annotation, for example), or else manually list them in my web.xml (http://web.xml) (resteasy.resources), or create an Application instance to register them... Ugh... Why can't the RestEasy-Spring bootstrap automatically register the resources annotated with @Path? Or... Why can't the SCAN coexist with Spring again? -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Oauth2 with RestEasy behind an AWS Load Balancer
Hi James, Glad the header problem is solved :-) For Beaer token, sorry I’m not familiar about it, but if it uses cookies to store authentication information, you can try to check your browser to see if the ‘Expires’ field of the cookie is set correctly or not. For example, if you are using Firefox, you can follow this instruction[1] to check the cookies. If the expiration is controlled in server side, then you can try to find the data that controls the expiration behaviour to see whether it set correctly or not. Hope the information useful to you :-) [1] http://support.mozilla.org/en-US/questions/689713 -- Weinan Li On Monday, January 27, 2014 at 4:24 AM, james truty wrote: Hi Weinan, The AWS load balancer sends an X-Forwarded-Proto header to the Jboss server in the backed, which Jboss is able to use if I add this valve and option to my jboss-web.xml (http://web.xml): valve class-nameorg.apache.catalina.valves.RemoteIpValve/class-name param param-nameprotocolHeader/param-name param-valuex-forwarded-proto/param-value /param /valve This allows Jboss to handle the original https request, and Resteasy to proceed with proper authorization. Thanks for the help! The only issue I see now is that the Bearer token that I get back by using client credentials and BASIC auth does not expire when I set it to - even if I set it to 1 minute in the RestEasy settings. It is still allowed after it should have timed out. Is there another way that I should be setting or enforcing the token timeout? Thanks, James On Sat, Jan 25, 2014 at 6:07 AM, Weinan Li l.wei...@gmail.com (mailto:l.wei...@gmail.com) wrote: Hi James, Sorry I’m not familiar with AWS load balancer. I know that mod_jk supports to pass client SSL information to backend JBoss server and the application in JBoss server could use the information to do their work. And mod_jk is using standard AJPv13 protocol to forward the client SSL information to backend JBoss servers. If AWS load balancer supports AJPv13 protocol, it should also be able to pass the SSL information to JBoss. -- Weinan Li On Saturday, January 25, 2014 at 6:55 AM, james truty wrote: I am trying to use RestEasy in Jboss as a central auth server to authenticate REST calls behind an AWS load balancer. Ideally, this load balancer would communicate to the Jboss server over HTTP (not https) as the SSL part is handled at the load balancer level before hitting the auth server in the backend. In this case, the Jboss server has no knowledge of the SSL Cert or the HTTPS request. Is it possible to use RestEasy for auth in this scenario? Without the SSL connector configured through JBoss, I don't have access to the necessary OAUTH urls. Thanks, James -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Oauth2 with RestEasy behind an AWS Load Balancer
Hi James, Sorry I’m not familiar with AWS load balancer. I know that mod_jk supports to pass client SSL information to backend JBoss server and the application in JBoss server could use the information to do their work. And mod_jk is using standard AJPv13 protocol to forward the client SSL information to backend JBoss servers. If AWS load balancer supports AJPv13 protocol, it should also be able to pass the SSL information to JBoss. -- Weinan Li On Saturday, January 25, 2014 at 6:55 AM, james truty wrote: I am trying to use RestEasy in Jboss as a central auth server to authenticate REST calls behind an AWS load balancer. Ideally, this load balancer would communicate to the Jboss server over HTTP (not https) as the SSL part is handled at the load balancer level before hitting the auth server in the backend. In this case, the Jboss server has no knowledge of the SSL Cert or the HTTPS request. Is it possible to use RestEasy for auth in this scenario? Without the SSL connector configured through JBoss, I don't have access to the necessary OAUTH urls. Thanks, James -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Using Netty, RestEasy and Weld
Hi John, Nice article! I’ve forked your project to learn from it :-) -- Weinan Li On Sunday, January 19, 2014 at 10:58 PM, John D. Ament wrote: Hi all, In case anyone's interested, I just put out a blog post on how you can use RestEasy and the Netty Embedded Server with Weld. http://john-ament.blogspot.com/2014/01/bridging-netty-resteasy-and-weld.html and if you'd like to see the code: https://github.com/johnament/resteasy-netty-cdi Please do let me know your thoughts. - John -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Running JAX-RS 2.0 O'Reilly book samples on Tomcat..
I’ve tested ex03_1 after set it up properly and deployed it on Tomcat8. And it works without any problem: $ curl -X POST -H Content-Type: application/xml -d customerfirst-nameBill/first-namelast-nameBurke/last-namestreet256 Clarendon Street/streetcityBoston/citystateMA/statezip02115/zipcountryUSA/country/customer http://127.0.0.1:8080/ex03_1/customers From catalina.out: Created customer 1 $ curl http://127.0.0.1:8080/ex03_1/customers/1 customer id=1 first-nameBill/first-name last-nameBurke/last-name street256 Clarendon Street/street cityBoston/city stateMA/state zip02115/zip countryUSA/country /customer -- Weinan Li On Thursday, January 16, 2014 at 1:50 PM, Weinan Li wrote: Hi Kapil, Are you using oreilly-jaxrs-2.0-workbook/ex03_1” or oreilly-workbook/ex03_1”? The former one can only be deployed in a JavaEE application server that supports JAX-RS 2.0 spec like WildFly, because it doesn’t have standalone settings in web.xml (http://web.xml). Please add following settings you web.xml (http://web.xml) if you want to deploy it in tomcat: servlet servlet-nameResteasy/servlet-name servlet-class org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher /servlet-class init-param param-namejavax.ws.rs.Application/param-name param-value com.restfully.shop.services.ShoppingApplication /param-value /init-param /servlet servlet-mapping servlet-nameResteasy/servlet-name url-pattern/*/url-pattern /servlet-mapping In addition, if ex03_1.war is deployed into tomcat correctly you should see the following log in catalina.out: resteasy.spi.ResteasyDeployment. Deploying javax.ws.rs.core.Application: class com.restfully.shop.services.ShoppingApplication 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource com.restfully.shop.services.CustomerResource from Application class com.restfully.shop.services.ShoppingApplication And then you can access it by http://127.0.0.1:8080/ex03_1/customers -- Weinan Li On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote: am trying to run the samples from the O'Reilly book (by Bill Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine but when i try to POST a customer resource to /services/customers it gives me 404. I built the war from the Maven for Chapter 3 example (ex03_1) and deployed that war on Tomcat and the deployment (Tomcat startup console) shows messages of ShoppingApplication being deployed. What am i missing, dont see any error message or any clue around what could be going wrong. Thanks in anticipation, Kapil. -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Running JAX-RS 2.0 O'Reilly book samples on Tomcat..
Hi Kapil, Are you using oreilly-jaxrs-2.0-workbook/ex03_1” or oreilly-workbook/ex03_1”? The former one can only be deployed in a JavaEE application server that supports JAX-RS 2.0 spec like WildFly, because it doesn’t have standalone settings in web.xml. Please add following settings you web.xml if you want to deploy it in tomcat: servlet servlet-nameResteasy/servlet-name servlet-class org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher /servlet-class init-param param-namejavax.ws.rs.Application/param-name param-value com.restfully.shop.services.ShoppingApplication /param-value /init-param /servlet servlet-mapping servlet-nameResteasy/servlet-name url-pattern/*/url-pattern /servlet-mapping In addition, if ex03_1.war is deployed into tomcat correctly you should see the following log in catalina.out: resteasy.spi.ResteasyDeployment. Deploying javax.ws.rs.core.Application: class com.restfully.shop.services.ShoppingApplication 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource com.restfully.shop.services.CustomerResource from Application class com.restfully.shop.services.ShoppingApplication And then you can access it by http://127.0.0.1:8080/ex03_1/customers -- Weinan Li On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote: am trying to run the samples from the O'Reilly book (by Bill Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine but when i try to POST a customer resource to /services/customers it gives me 404. I built the war from the Maven for Chapter 3 example (ex03_1) and deployed that war on Tomcat and the deployment (Tomcat startup console) shows messages of ShoppingApplication being deployed. What am i missing, dont see any error message or any clue around what could be going wrong. Thanks in anticipation, Kapil. -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Fwd: Regarding Ssl handshake during certificate authentication on jboss
-- Weinan Li On Wednesday, September 4, 2013 at 3:16 AM, Mukul Panwar wrote: Hi Wenian I also tried now the similar approach by using a Http apache client library whic is handling some internally and reusing the handshake. But I want to user resteasy client library only and some how i want to reuse that Ssl handshake. Plz suggest something about resteasy api to handle it . Hi Mukul, I haven't looked into details of the JAX-RS 2.0 Client API . I'll do some research and give you my findings soon. Thanks Mukul On Sep 3, 2013, at 6:44 PM, Weinan Li l.wei...@gmail.com (mailto:l.wei...@gmail.com) wrote: -- Weinan Li On Tuesday, September 3, 2013 at 2:42 PM, Mukul Panwar wrote: Hi Sorry for late reply, I am using JBoss AS provided SSL connector and my configuration as: connector name=https protocol=HTTP/1.1 scheme=https socket-binding=https secure=true ssl name=ssl key-alias=jbosskey password=changeit certificate-key-file=D:/Software/server/jboss-as-7.1.1.Final/standalone/configuration/server.keystore verify-client=want ca-certificate-file=D:/Software/server/jboss-as-7.1.1.Final/standalone/configuration/server.keystore/ Server side config looks fine. /connector and when I am calling from client code look like as: void initializedCredential(){ System.setProperty(javax.net.ssl.trustStore, D:/temp/client.jks); System.setProperty(javax.net.ssl.trustStorePassword, changeit); // keystore has the certificates presented to the server when a server // requests one to authenticate this application to the server System.setProperty(javax.net.ssl.keyStore, D:/temp/client.jks); System.setProperty(javax.net.ssl.keyStorePassword, changeit); } I believe the problem is that you haven't stored the SSLContext in client so that it creates a new one(with SSL handshake) each time. Here are some codes that I have used before that holding the context in client side: private Socket clientWithCert() throws Exception { SSLContext context = SSLContext.getInstance(TLS); KeyStore ks = KeyStore.getInstance(jceks); ks.load(new FileInputStream(CLIENT_KEY_STORE), null); KeyManagerFactory kf = KeyManagerFactory.getInstance(SunX509); kf.init(ks, CLIENT_KEY_STORE_PASSWORD.toCharArray()); context.init(kf.getKeyManagers(), null, null); SocketFactory factory = context.getSocketFactory(); Socket s = factory.createSocket(localhost, 8443); return s; } With above method you have to use Socket intend of RESTEasy client api. If you reuse the context then you don't have to do a new SSL handshake with Server each time. I haven't looked into JAX-RS 2.0 Client API throughly so I'm not sure how it could be setup to use SSL. I'll do more research on it and give you feedback soon. public T Object post (String url, Map obj, ClassT class1) {initializedCredential(); url = webServiceUrlUtil.getSearchClaimantURL() + url; clientRequest = new ClientRequest(url); ClientResponseT res = null; try { res = clientRequest.post(class1); if (res == null) { return null; } if (res != null res.getStatus() != 200) { logger.debug(GET Response not getting correct , Status Code: + res.getStatus()); throw new RuntimeException(Failed : HTTP Webservice error : + res.serverError()); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return res.getEntity(); } Thanks Mukul -Original Message- From: Weinan Li [mailto:l.wei...@gmail.com] Sent: Friday, August 30, 2013 8:12 AM To: Mukul Panwar Cc: Bill Burke; resteasy-users@lists.sourceforge.net (mailto:resteasy-users@lists.sourceforge.net) Subject: Re: [Resteasy-users] Fwd: Regarding Ssl handshake during certificate authentication on jboss -- Weinan Li On Friday, August 30, 2013 at 12:20 AM, Mukul Panwar wrote: Hi Bill I also tried successfully to implement certificate authentication but SsL handshake doing every time of request. Which should reuse the first handshake session. Please suggest about it. Hi Mukul, are you using the RESTEasy provided security solution (like skeleton and resteasy-crypto) or JBoss AS provided SSL connector? If you are using the SSL connection provided by JBoss AS, it could be a configuration problem. Could you please provide the configs you've used so that I could check it for you? Thanks Mukul On Aug 29, 2013, at 7:11 PM, Bill Burke bbu...@redhat.com (mailto:bbu...@redhat.com) wrote: I have used certs successfully before. On 8/29/2013 9:31 AM, Mukul Panwar wrote: Sent from my iPhone Begin forwarded message: *From:* muku...@hcl.com mailto:muku
Re: [Resteasy-users] RESTeasy equivalent for Jersey InjectableProvider
-- Weinan Li On Wednesday, September 4, 2013 at 4:58 AM, Jakub Narloch wrote: Hi, I was actually curiouse if there is a similar functionality in RESTeasy to the Jersey InjectableProvider? If I didn't make any mistake, seems RESTEasy doesn't have similar functions. RESTEasy's @Context let you inject: javax.ws.rs.core.HttpHeaders, javax.ws.rs.core.UriInfo, javax.ws.rs.core.Request, javax.servlet.HttpServletRequest, javax.servlet.HttpServletResponse, javax.servlet.ServletConfig, javax.servlet.ServletContext, and javax.ws.rs.core.SecurityContext objects. If you want to use something like: public String uppercase(@Context Locale locale) { return this is lowercase.toUppercase(locale); } and: @Provider public class LocaleProvider extends AbstractHttpContextInjectableLocale implements InjectableProviderContext, Type { @Override public InjectableE getInjectable(ComponentContext ic, Context a, Type c) { if (c.equals(Locale.class)) { return this; } return null; } @Override public ComponentScope getScope() { return ComponentScope.PerRequest; } @Override public Locale getValue(HttpContext c) { final Locales locales = c.getRequest().getAcceptableLanguages(); if (locales.isEmpty()) { return Locale.US; } return locales.get(0); } } in Jersey. I don't know how to do this in RESTEasy(I wonder if there is a way). Please blame me if there *is* a way to do this in RESTEasy and I don't know how because of my lack of knowledge :-) The interface basically allows to define provider for custom object injection. Thanks in advance, Jakub Narloch -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Fwd: Regarding Ssl handshake during certificate authentication on jboss
-- Weinan Li On Friday, August 30, 2013 at 12:20 AM, Mukul Panwar wrote: Hi Bill I also tried successfully to implement certificate authentication but SsL handshake doing every time of request. Which should reuse the first handshake session. Please suggest about it. Hi Mukul, are you using the RESTEasy provided security solution (like skeleton and resteasy-crypto) or JBoss AS provided SSL connector? If you are using the SSL connection provided by JBoss AS, it could be a configuration problem. Could you please provide the configs you've used so that I could check it for you? Thanks Mukul On Aug 29, 2013, at 7:11 PM, Bill Burke bbu...@redhat.com (mailto:bbu...@redhat.com) wrote: I have used certs successfully before. On 8/29/2013 9:31 AM, Mukul Panwar wrote: Sent from my iPhone Begin forwarded message: *From:* muku...@hcl.com mailto:muku...@hcl.com *Date:* August 29, 2013, 7:00:06 AM GMT+05:30 *To:* Bill Burke bbu...@redhat.com mailto:bbu...@redhat.com *Cc:* resteasy-users@lists.sourceforge.net (mailto:resteasy-users@lists.sourceforge.net) mailto:resteasy-users@lists.sourceforge.net *Subject:* *Regarding Ssl handshake during certificate authentication on jboss* Hi Bill I have a resteasy client and doing post request . I also set the keystore as trusted and cert key entries before sending the request. The server also having import the client key in their keystore certificate. Means we are doing Two way mutual certificate authentication . The client and server doing handshake successfully . But for each request there is a new handshake where as they should use the session of first Ssl handshake. Please suggest about or give any reference for this. Thanks Mukul ::DISCLAIMER:: The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects. -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft
Re: [Resteasy-users] Resteasy 3.0-beta-4 ejb-integrtation-test fails on AS 7.1.1.Final
On Apr 11, 2013, at 9:28 PM, Bill Burke bbu...@redhat.com wrote: Ugh! I thought this problem was fixed! Yeah it's fixed in EAP6.1.0 :-) For JBoss AS 7.1.1, it's an already released community version, I believe the version conflicts exists. And JBoss AS trunk has fixed this problem. On 4/11/2013 9:21 AM, Weinan Li wrote: On Apr 11, 2013, at 7:10 AM, Tom Coleman tcole...@autowares.com wrote: Can someone please help with trying to get a Resteasy ear/ejb/war project running on AS7? Below is the output from the deployment of the ejb-integration test in the jboss-integration-testing directory of the current Resteasy.master. It looks like the test is run against jboss-4.2.3.GA, so my guess is that I am probably running into some AS7 deployment issue. 19:33:48,286 INFO [org.jboss.as.server.deployment] (MSC service thread 1-13) JBAS015876: Starting deployment of ejb-integration-test.ear 19:33:48,296 INFO [org.jboss.as.server.deployment] (MSC service thread 1-15) JBAS015876: Starting deployment of ejb-test-war-3.0-beta-4.war 19:33:48,296 INFO [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015876: Starting deployment of ejb-test-3.0-beta-4.jar 19:33:48,321 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-15) JNDI bindings for session bean named LocatingResourceBean in deployment unit subdeployment ejb-test-3.0-beta-4.jar of deployment ejb-integration-test.ear are as follows: java:global/ejb-integration-test/ejb-test-3.0-beta-4/LocatingResourceBean!org.resteasy.test.ejb.LocatingResource java:app/ejb-test-3.0-beta-4/LocatingResourceBean!org.resteasy.test.ejb.LocatingResource java:module/LocatingResourceBean!org.resteasy.test.ejb.LocatingResource java:global/ejb-integration-test/ejb-test-3.0-beta-4/LocatingResourceBean java:app/ejb-test-3.0-beta-4/LocatingResourceBean java:module/LocatingResourceBean 19:33:48,326 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-15) JNDI bindings for session bean named FooResourceBean in deployment unit subdeployment ejb-test-3.0-beta-4.jar of deployment ejb-integration-test.ear are as follows: java:global/ejb-integration-test/ejb-test-3.0-beta-4/FooResourceBean!org.resteasy.test.ejb.exception.FooResource java:app/ejb-test-3.0-beta-4/FooResourceBean!org.resteasy.test.ejb.exception.FooResource java:module/FooResourceBean!org.resteasy.test.ejb.exception.FooResource java:global/ejb-integration-test/ejb-test-3.0-beta-4/FooResourceBean java:app/ejb-test-3.0-beta-4/FooResourceBean java:module/FooResourceBean 19:33:48,327 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-15) JNDI bindings for session bean named SimpleResourceBean in deployment unit subdeployment ejb-test-3.0-beta-4.jar of deployment ejb-integration-test.ear are as follows: java:global/ejb-integration-test/ejb-test-3.0-beta-4/SimpleResourceBean!org.resteasy.test.ejb.SimpleResource java:app/ejb-test-3.0-beta-4/SimpleResourceBean!org.resteasy.test.ejb.SimpleResource java:module/SimpleResourceBean!org.resteasy.test.ejb.SimpleResource java:global/ejb-integration-test/ejb-test-3.0-beta-4/SimpleResourceBean java:app/ejb-test-3.0-beta-4/SimpleResourceBean java:module/SimpleResourceBean 19:33:48,329 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-15) MSC1: Failed to start service jboss.deployment.subunit.ejb-integration-test.ear.ejb-test-3.0-beta-4.jar.POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit.ejb-integration-test.ear.ejb-test-3.0-beta-4.jar.POST_MODULE: Failed to process phase POST_MODULE of subdeployment ejb-test-3.0-beta-4.jar of deployment ejb-integration-test.ear at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_26] at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_26] Caused by: java.lang.NoSuchMethodError: org.jboss.resteasy.util.GetRestful.getSubResourceClass(Ljava/lang/Class;)Ljava/lang/Class; at org.jboss.as.jaxrs.deployment.JaxrsComponentDeployer.deploy(JaxrsComponentDeployer.java:73) This is caused by a recent RESTEasy API change. Please use JBoss AS trunk to work with RESTEAsy 3.0-beta-4
Re: [Resteasy-users] [repost]: Long task, short request
-- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, April 5, 2013 at 7:09 PM, Friso Vrolijken wrote: Hi Li, No, I’ve not tried that, as from the documentation I gather that the request will not return (i.e. the client will be kept waiting). With asynch=true, you will get response immediately. And you can check the result later. I have written two documents about this but they are in Chinese: http://weli.iteye.com/blog/1273163 http://weli.iteye.com/blog/1275313 Maybe you can use google translation to read it :-) Anyway, it's very easy to use them, you can also check the examples in RESTEasy source code: examples/async-job-service One of my goals is to free up the client as soon as possible. Please let me know if my assumption (that the client needs to keep waiting) is incorrect. Groeten, Friso Van: Weinan Li [mailto:l.wei...@gmail.com] Verzonden: vrijdag 5 april 2013 13:06 Aan: Friso Vrolijken CC: resteasy-users@lists.sourceforge.net (mailto:resteasy-users@lists.sourceforge.net) Onderwerp: Re: [Resteasy-users] [repost]: Long task, short request Have you tried the new async feature in servlet 3.0? RESTEasy supports it. -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] [repost]: Long task, short request
Have you tried the new async feature in servlet 3.0? RESTEasy supports it. -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, April 4, 2013 at 4:49 PM, Friso Vrolijken wrote: Hi all, I noticed that my previous message wasn't displayed correctly, so I'm trying this again (with adjusting line length). One thing I forgot to mention: I prefer an EJB-less solution. In future my solution may need to run on a web-profile app server. Thanks in advance, Friso -Oorspronkelijk bericht- Hi all, This post is (hopefully) mostly to confirm my thoughts. I've got a process that might take some time. I do not want the client to wait for the entire process however. If the client's input is valid, I just want to send the client a 200 response and handle any subsequent errors internally. My current solution for this is something like this: @Path (test) public class Test { // I'm not really instantiating it like this (but rather in a lazy // method), but do want to check if I should be using // newCachedThreadPool() // Should I be getting some named or configured ThreadPool private static ExecutorService executorService = Executors.newCachedThreadPool(); // ---^ this is the actual question @GET public static String bla (@QueryParam (me) String me) { if (me != null me.trim().length() 0) { //checking input // is this indeed the best way to go about this executorService.execute(new TestMe()); // ---^ this is the actual question // output, not important return Hallo + me; } return null; } private static class TestMe implements Runnable { @Override public void run() { System.out.println(TestMe); try { Thread.sleep(2); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(Done sleeping); } } } Which works, but I'm not sure if I'm handling the whole thread thing right (on JBoss 7AS). Any thoughts? Groeten, Friso -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Unable to find a MessageBodyReader of content-type text/html; charset=utf-8
-- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Saturday, February 23, 2013 at 3:04 AM, Nuwan Bandara wrote: Hi, Thanks for your reply. Here's my code public ListAnalyteResult interpretResultListRemote(ListAnalyteResult analyteResultList) throws AREException { logger.debug(Start of interpretResultListRemote method); ListAnalyteResult interpretResultList; try { String wsURL=ServiceLocator.getInstance().getNichPROProperties().getProperty(REST_WS_ARE_PREFIX) + INTERPRET_RESULT_LIST; clientRequest = new ClientRequest(wsURL); clientRequest.accept(application/json); clientRequest.body(application/json, analyteResultList); Did you use your own MessageBodyWriter for marshalling the List - json format? I remember RESTEasy doesn't provide it by default. interpretResultList = (ListAnalyteResult)clientRequest.post().getEntity(new GenericTypeListAnalyteResult(){}); } catch (Exception e) { logger.error(AssayRuleEngineInvoker.class.getName() + :interpretResultListRemote:, e); throw new AREException(e); } logger.debug(End of interpretResultListRemote method); return interpretResultList; } Am I doing anything wrong here? On Thu, Feb 21, 2013 at 4:29 PM, Weinan Li l.wei...@gmail.com (mailto:l.wei...@gmail.com) wrote: -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, February 22, 2013 at 12:42 AM, Nuwan Bandara wrote: Hi, I am getting this error when I try to call one of the webservice in remote stateless session bean. I use JUnit to call the webservice. org.jboss.resteasy.client.ClientResponseFailure: Unable to find a MessageBodyReader of content-type text/html;charset=utf-8 and type java.util.Listcom.questdiagnostics.nichpro.assayruleengine.model.AnalyteResult btw, could you please provide some codes on how you are using the resteasy client api? What could be the problem? Thanks, Nuwan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Unable to find a MessageBodyReader of content-type text/html; charset=utf-8
-- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Saturday, February 23, 2013 at 11:16 PM, Weinan Li wrote: -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Saturday, February 23, 2013 at 3:04 AM, Nuwan Bandara wrote: Hi, Thanks for your reply. Here's my code public ListAnalyteResult interpretResultListRemote(ListAnalyteResult analyteResultList) throws AREException { logger.debug(Start of interpretResultListRemote method); ListAnalyteResult interpretResultList; try { String wsURL=ServiceLocator.getInstance().getNichPROProperties().getProperty(REST_WS_ARE_PREFIX) + INTERPRET_RESULT_LIST; clientRequest = new ClientRequest(wsURL); clientRequest.accept(application/json); clientRequest.body(application/json, analyteResultList); Did you use your own MessageBodyWriter for marshalling the List - json format? I remember RESTEasy doesn't provide it by default. My mistake, resteasy-jackson-provider can handle List properly and will convert obj - json for you. As Bill said, your response is text/html but the return type expected is text/html. It may be caused by some exceptions thrown from server side. My suggestion is that you could try to read the server response to see what happens. I usually use Wireshark to read http request / response and it's very convenient to use. Hope these useful to you :-) interpretResultList = (ListAnalyteResult)clientRequest.post().getEntity(new GenericTypeListAnalyteResult(){}); } catch (Exception e) { logger.error(AssayRuleEngineInvoker.class.getName() + :interpretResultListRemote:, e); throw new AREException(e); } logger.debug(End of interpretResultListRemote method); return interpretResultList; } Am I doing anything wrong here? On Thu, Feb 21, 2013 at 4:29 PM, Weinan Li l.wei...@gmail.com (mailto:l.wei...@gmail.com) wrote: -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, February 22, 2013 at 12:42 AM, Nuwan Bandara wrote: Hi, I am getting this error when I try to call one of the webservice in remote stateless session bean. I use JUnit to call the webservice. org.jboss.resteasy.client.ClientResponseFailure: Unable to find a MessageBodyReader of content-type text/html;charset=utf-8 and type java.util.Listcom.questdiagnostics.nichpro.assayruleengine.model.AnalyteResult btw, could you please provide some codes on how you are using the resteasy client api? What could be the problem? Thanks, Nuwan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] How do I mock test file upload with @MultipartForm and POJO?
I'll check this one. -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, January 24, 2013 at 11:29 AM, Gabriella Turek wrote: My form POJO: public class FileUploadForm { @FormParam(file) @PartType(MediaType.APPLICATION_OCTET_STREAM) private byte[] 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 byte[] getData() { return data; } public void setData(final byte[] 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; } } My service side method definition: @POST @Path(/upload) @Consumes(multipart/form-data) @Produces(MediaType.TEXT_PLAIN) public Response upload(@MultipartForm FileUploadForm form); I tried this: MockHttpRequest request = MockHttpRequest.post(/upload); request.contentType(MediaType.MULTIPART_FORM_DATA_TYPE); FileUploadForm upload = new FileUploadForm(); upload.setUser(USER); upload.setPassword(PASSWORD); upload.setFilename(file.zip); String fileToUpload = testdata/file.zip; FileInputStream fis = new FileInputStream(fileToUpload); byte[] fileData = IOUtils.toByteArray(fis); upload.setData(fileData); request.content(upload.toString().getBytes()); MockHttpResponse response = new MockHttpResponse(); dispatcher.invoke(request, response); assertEquals(HttpResponseCodes.SC_OK, response.getStatus()); But I get 2013-01-24 16:25:14,903: WARN [org.jboss.resteasy.core.SynchronousDispatcher](?:?) - Failed executing POST /upload org.jboss.resteasy.spi.ReaderException: java.io.IOException: Unable to get boundary for multipart Thanx Gaby -- Please consider the environment before printing this email. NIWA is the trading name of the National Institute of Water Atmospheric Research Ltd. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Mixing query and form parameters
-- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Tuesday, January 22, 2013 at 9:46 PM, Denica Gencheva wrote: Hi, I'm facing the following problem: @Path(/my_path) @Produces(MediaType.TEXT_HTML) public interface MyService { @GET Response readAction(@QueryParam(action) String action); @POST Response postReadAction(@FormParam(action) String action) } $ curl -d action=test http://myserver/my_path; action: test e.g. the action parameter in the body is read and this is the expected answer. $ curl -d action=test1 http://myserver/my_path?action=test; action: test1 This is also OK, the verb is POST and the action value is test1 (as it is in the body). $ curl -d action=test http://myserver/my_path?action=test; Could you please explain why you need to send action parameter both in request param and in form param? action: In this case (action parameter appears as form and query parameter and has a same value) the action parameter value is missing. Can someone help with this one? -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Resource annotation question
-- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, January 18, 2013 at 2:35 PM, Kurt T Stam wrote: Hi guys, Running on AS7 and RESTeasy 2.3.5, I'm trying to inject a mail session in my JAXRS endpoint using /** * The JAX-RS resource that handles notification specific tasks. * */ @Path(/notify) public class NotificationResource { @Resource(mappedName=java:jboss/mail/Default) private Session mailSession; However the mailSession remains null, while the log indicate that 'java:jboss/mail/Default' is bound. Try to mark NotificationResource as a EJB session bean also. In RESTEasy example/ejb-integration there are examples :-) Do I have to set something in the web.xml (http://web.xml) for the Resource annotation to be executed? Thx, --Kurt -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Resource annotation question
Ron has just submitted 10k+ examples on using CDI, EJB with RESTEasy! The code is here: https://github.com/resteasy/Resteasy/pull/236/files Feel free to refer to it! :-) -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, January 18, 2013 at 2:35 PM, Kurt T Stam wrote: Hi guys, Running on AS7 and RESTeasy 2.3.5, I'm trying to inject a mail session in my JAXRS endpoint using /** * The JAX-RS resource that handles notification specific tasks. * */ @Path(/notify) public class NotificationResource { @Resource(mappedName=java:jboss/mail/Default) private Session mailSession; However the mailSession remains null, while the log indicate that 'java:jboss/mail/Default' is bound. Do I have to set something in the web.xml (http://web.xml) for the Resource annotation to be executed? Thx, --Kurt -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Issue regarding non-English characters during REST communication
Hi Csanyi, Which version of RESTEasy you are using? Ron has fixed a bunch of encoding problems since 2.3.5.Final. If it still not work, could you please describe your problem in detail? Thanks! -- Weinan Li On Sunday, January 13, 2013 at 9:03 PM, András Csányi wrote: Dear All, I faced the issue described here [1]. Can somebody give me some advise how can I solve it? Thanks for any help in advance! [1] - http://stackoverflow.com/questions/14297242/issue-regarding-non-english-characters-in-a-swing-rest-application András -- -- Csanyi Andras (Sayusi Ando) -- http://sayusi.hu -- http://facebook.com/andras.csanyi -- Trust in God and keep your gunpowder dry! - Cromwell -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_123012 ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Netty - RestEasy integration, problem with concurrent requests - ClosedChannelException
-- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, January 4, 2013 at 4:08 PM, mete wrote: Hello folks, i am working on a poc, and i want to use netty but i need a simpler way to interact with the http requests so i decided to go with the netty support of resteasy. i have a straightforward code that i found from the wiki : server = new NettyJaxrsServer(); server.setDeployment(deployment); server.setPort(port); server.start(); and a few rest resources that dont really do much, the problem is when i try to execute a simple load test with the command line ab tool: ab -n 100 -c 1 http://127.0.0.1:3000/api/someEndpoint i see exceptions like the following which are unrelated to my own application code: INFO | jvm 1| 2013/01/04 09:14:07 | java.nio.channels.ClosedChannelException Hi mete, Which version of RESTEasy you are using? If you use the one 2.3.5.Final, there is a bug in Netty provider that won't handle server shutdown properly. If you are using 2.3.5.Final and still get this problem, could you please provide your testing code(better on github) so I could check it? Thanks! INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:785) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromUserCode(AbstractNioWorker.java:508) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:129) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:66) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:733) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:71) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:733) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:71) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.execution.ExecutionHandler.handleDownstream(ExecutionHandler.java:185) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:712) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:679) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.resteasy.plugins.server.netty.RequestHandler.messageReceived(RequestHandler.java:73) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:45) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:69) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:315) INFO | jvm 1| 2013/01/04 09:14:07 | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) INFO | jvm 1| 2013/01/04 09:14:07 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) INFO | jvm 1| 2013/01/04 09:14:07 | at java.lang.Thread.run(Thread.java:680) any ideas? thanks in advance -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu
Re: [Resteasy-users] Netty - RestEasy integration, problem with concurrent requests - ClosedChannelException
-- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, January 4, 2013 at 4:52 PM, mete wrote: Hello, I am using resteasy 2.3.5.Final resteasy.version2.3.5.Final/resteasy.version dependency groupIdorg.jboss.resteasy/groupId artifactIdresteasy-jaxrs/artifactId version${resteasy.version}/version /dependency dependency groupIdorg.jboss.resteasy/groupId artifactIdresteasy-netty/artifactId version${resteasy.version}/version /dependency i tried to plug in netty 3.5.9 Final instead of the 3.4.4 but the behaviour is the same. I have provided a sample testcase here: https://gist.github.com/4450991 Thanks! I'll check this and give you my findings soon. but test is just sleeping, i use curl and ab to reproduce the issue. i will try with the latest trunk in the meantime. Thanks for your attention Mete On Fri, Jan 4, 2013 at 10:11 AM, Weinan Li l.wei...@gmail.com (mailto:l.wei...@gmail.com) wrote: -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, January 4, 2013 at 4:08 PM, mete wrote: Hello folks, i am working on a poc, and i want to use netty but i need a simpler way to interact with the http requests so i decided to go with the netty support of resteasy. i have a straightforward code that i found from the wiki : server = new NettyJaxrsServer(); server.setDeployment(deployment); server.setPort(port); server.start(); and a few rest resources that dont really do much, the problem is when i try to execute a simple load test with the command line ab tool: ab -n 100 -c 1 http://127.0.0.1:3000/api/someEndpoint i see exceptions like the following which are unrelated to my own application code: INFO | jvm 1| 2013/01/04 09:14:07 | java.nio.channels.ClosedChannelException Hi mete, Which version of RESTEasy you are using? If you use the one 2.3.5.Final, there is a bug in Netty provider that won't handle server shutdown properly. If you are using 2.3.5.Final and still get this problem, could you please provide your testing code(better on github) so I could check it? Thanks! INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:785) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromUserCode(AbstractNioWorker.java:508) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:129) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:66) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:733) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:71) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:733) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:71) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.execution.ExecutionHandler.handleDownstream(ExecutionHandler.java:185) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:712) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:679) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.resteasy.plugins.server.netty.RequestHandler.messageReceived(RequestHandler.java:73) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:45) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:69) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:315) INFO | jvm 1| 2013/01/04 09:14:07
Re: [Resteasy-users] Netty - RestEasy integration, problem with concurrent requests - ClosedChannelException
-- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, January 4, 2013 at 5:15 PM, mete wrote: Hello, Sorry for the trouble. I think its the issue is with the ab testing tool that i am using. its version 2.3 on macosx. i just executed the similar ab test against elasticsearch, which uses netty directly. I got the same error. I moved to a ubuntu box, ab version 2.3 executes without any issues against my app and elasticsearch. Glad you solved your problem :-) Need to investigate more next time :) Np, please don't hesitate to ask questions in list ;-) Regards Mete On Fri, Jan 4, 2013 at 10:56 AM, Weinan Li l.wei...@gmail.com (mailto:l.wei...@gmail.com) wrote: -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, January 4, 2013 at 4:52 PM, mete wrote: Hello, I am using resteasy 2.3.5.Final resteasy.version2.3.5.Final/resteasy.version dependency groupIdorg.jboss.resteasy/groupId artifactIdresteasy-jaxrs/artifactId version${resteasy.version}/version /dependency dependency groupIdorg.jboss.resteasy/groupId artifactIdresteasy-netty/artifactId version${resteasy.version}/version /dependency i tried to plug in netty 3.5.9 Final instead of the 3.4.4 but the behaviour is the same. I have provided a sample testcase here: https://gist.github.com/4450991 Thanks! I'll check this and give you my findings soon. but test is just sleeping, i use curl and ab to reproduce the issue. i will try with the latest trunk in the meantime. Thanks for your attention Mete On Fri, Jan 4, 2013 at 10:11 AM, Weinan Li l.wei...@gmail.com (mailto:l.wei...@gmail.com) wrote: -- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, January 4, 2013 at 4:08 PM, mete wrote: Hello folks, i am working on a poc, and i want to use netty but i need a simpler way to interact with the http requests so i decided to go with the netty support of resteasy. i have a straightforward code that i found from the wiki : server = new NettyJaxrsServer(); server.setDeployment(deployment); server.setPort(port); server.start(); and a few rest resources that dont really do much, the problem is when i try to execute a simple load test with the command line ab tool: ab -n 100 -c 1 http://127.0.0.1:3000/api/someEndpoint i see exceptions like the following which are unrelated to my own application code: INFO | jvm 1| 2013/01/04 09:14:07 | java.nio.channels.ClosedChannelException Hi mete, Which version of RESTEasy you are using? If you use the one 2.3.5.Final, there is a bug in Netty provider that won't handle server shutdown properly. If you are using 2.3.5.Final and still get this problem, could you please provide your testing code(better on github) so I could check it? Thanks! INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:785) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromUserCode(AbstractNioWorker.java:508) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:129) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:66) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:733) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:71) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write(Channels.java:733) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:71) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.handler.execution.ExecutionHandler.handleDownstream(ExecutionHandler.java:185) INFO | jvm 1| 2013/01/04 09:14:07 | at org.jboss.netty.channel.Channels.write
Re: [Resteasy-users] Newbie question REST
-- Weinan Li On Wednesday, January 2, 2013 at 10:45 PM, Bill Burke wrote: On 12/21/2012 4:12 PM, Skriloff, Nicholas wrote: I have three questions 1) I want to see all the restful urls available when I start up EAP6 in the server.log file. How do I configure standalone.xml logging to show the rest easy services that are exposed and their paths? Resteasy does not have that capability. It only specifies which classes have been deployed at deploy time. 2) Should I upgrade to latest RESTeasy eventhough I am presently running EAP6 unmodified to get the lastest and greatest? Weinan made a good suggestion. Read the release notes and see if its worth upgrading. But, future 2.3.x releases will probably only be done within EAP. We're fully focused on 3.x now. Bill, does that mean I could just submit patches to trunk and no need to patch Branch_2_3 from now on? 3) I develop a registrar system for students to enroll into classes. One of the war files is registrar-student.war. I am trying to expose my first RESTeasy webservice. I am running EAP6, which runs resteasy 2.3.3 . I have an ejb that does code table lookups and I figured that is as good as place as any to start. So, I put this class in the app import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; @ApplicationPath(/registrarWebservices) public class RegistrarWebServicesApplication extends Application { //public class RegistrarWebServicesApplication { } I first tried adding the code below to the interface. I got the below error. I added the same code directly to the ejb. I got the same below error. @Path(/codetables) public class UncheckedCodeTablesBean implements SessionBean, UncheckedCodeTablesMethods { The error is what it says. You can only apply JAX-RS @PATH and method annotations (@GET, etc.) to a local interface or no-interface EJB class. So, move your @Path and @GET, @Produces annotatiosn to your UncheckedCodeTablesMethods interface, or make the bean a no-interface bean class. Also, your EJB is very old school :) Try EJB3.x annotations? @Stateless public class UncheckedCodeTablesBean implements UncheckedCodeTablesMethods {} Or even, just remove the interface entirely and just write a class. And ditch your XML of course :) -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com -- Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] @Form and providers
-- Weinan Li On Wednesday, January 2, 2013 at 10:50 PM, András Csányi wrote: Dear All, I would like to get some clarification and a little help. I'm going to create a software which has REST service on server side and it will have to type of client, a native client built on Swing and a client based on gwt. Question 1: According to the documentation if I use this at server side I can reach the service as a form. In case of web based application a form is needed and the url (@Path) must be called by post method. In case of swing, an object is needed properly annotated and it must be posted by the client to server side. Do I understand correctly this part? RESTEasy has provided a component called 'RESTEasy JS-API', which will generate the client side codes in javascript format, and the generated code clearly show to you how to build up a request correctly to a @Form and @FormParam backed API. You can also refer to the sample codes in 'resteasy-jsapi-testing': https://github.com/resteasy/Resteasy/tree/master/jaxrs/resteasy-jsapi-testing After understanding how to send/recv the data, you could build up the client side by yourself. @POST @Path(/partner/new) public String putNewPartner(@Form PartnerEntityDTOClient newPartnerEntityDTO) {} Question 2: I will use lot of dto classes - they will have mostly string, date and binary stuff - and they will be moved between the client and the server. The protocol will be JSON. According to the documentation I have to create both object the request and the response object for every dto class to handle the JSON protocol. Do I understand correctly? If so, than I would like to ask whether is there any tutorial or blog or book which helps to write these classes? Unfortunately, the documentation detailed deeply enough for my knowledge. You can build client side codes al by yourselves, or you can use RESTEasy client api: http://docs.jboss.org/resteasy/docs/2.3.5.Final/userguide/html/RESTEasy_Client_Framework.html I haven't tested whether it supports JSON marshal/unmarshal yet. Maybe other people in this list could give you more answers on this. I'll verify it later and tell you my findings ;-) Sorry if I misunderstand your question. Please tell me if I've made anything wrong :-) Thanks in advance! András -- -- Csanyi Andras (Sayusi Ando) -- http://sayusi.hu -- http://facebook.com/andras.csanyi -- Trust in God and keep your gunpowder dry! - Cromwell -- Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Will RestEasy work with OLD EJB
-- Weinan Li On Friday, January 4, 2013 at 10:37 AM, Skriloff, Nicholas wrote: Resteasy folks, I am converting a J2EE application that runs on JBOss 4.0.5 to run on JBOSS 7.1.1 OR EAP6. Our EJBS are presently from J2ee version 1.3.1. J2EE 1.3 was released September 24, 2001. So our EJBs are 1.1 or 2.0 . Below is a segment from our properties file. THEY ARE ALL STATELESS SESSION BEANS. j2ee.version=1.3.1 j2ee.dir=${lib.dir}/j2sdkee${j2ee.version} #j2ee.jar=${j2ee.dir}/lib/j2ee.jar I would rather not do the work of converting all the EJBS to 3.1-- even though it is a good idea-- if I do not have to. I have already begun some of the work. However, based on the resteasy examples from http://sourceforge.net/projects/resteasy/files/Resteasy%20JAX-RS/2.3.3.Final/resteasy-jaxrs-2.3.3.Final-all.zip IT LOOKS like all the examples are EJB 3.0 and 3.1. Will RestEasy 2.3.3 or 2.3.5 even work with EJB 1.1 or 2.0? If so, if you were in my shoes would you bite the bullet and convert all the ejbs or would you try to get RestEasy to work with the present EJB 1.1/2.0 environment? If you are planning to deploy your project on JBoss AS7, then it's more a compatible issue of EJB and AS7. I've googled a little bit and see there are some migrating issues of using EJB 2.x on AS7. And I didn't find much useful information on using EJB1.x on AS7. I'm not sure if anyone has verified EJB1.x + 2.x + RESTEasy will work on AS7. My suggestion is that you can try to build up a small project with older version of EJB and RESTEasy and deploy it to AS7 to see if you could manage it to work. Sincerely, Nick Skriloff , ME , MCP, SCJP Information Technology Specialist Darden Information Services Voice 434 243 5025 Fax 434 243 2279 skrilo...@darden.virginia.edu (mailto:skrilo...@darden.virginia.edu) -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Newbie question REST
-- Weinan Li On Saturday, December 22, 2012 at 5:12 AM, Skriloff, Nicholas wrote: I have three questions 1) I want to see all the restful urls available when I start up EAP6 in the server.log file. How do I configure standalone.xml logging to show the rest easy services that are exposed and their paths? JBoss AS = 7.1.1 does not support per deployment logger yet: http://stackoverflow.com/questions/9584787/using-log4j-with-jboss-7-1 https://issues.jboss.org/browse/AS7-514 https://docs.jboss.org/author/display/AS72/Logging+Configuration From 7.1.2.Final it will be supported. Before that, you could config logger in standalone.xml: subsystem xmlns=urn:jboss:domain:logging:1.1 console-handler name=CONSOLE level name=DEBUG/ … /console-handler root-logger level name=DEBUG/ … /root-logger /subsystem Switch the global setting to DEBUG and then you could get the RESTEasy debug output: 01:06:40,358 FINE [org.jboss.resteasy.core.SynchronousDispatcher] (http--127.0.0.1-8080-1) PathInfo: /hello 2) Should I upgrade to latest RESTeasy eventhough I am presently running EAP6 unmodified to get the lastest and greatest? Newer version of 2.3.x has many bug fixes and big rewrite on multipart-provider with better UTF-8 encoding support, and also better RESTEasy JS-API. But unless you do need these features, I don't think there will be a hurry to do upgrade :-) Here is the release note: https://issues.jboss.org/secure/ReleaseNote.jspa?version=12319570styleName=TextprojectId=12310560Create=Createatl_token=AQZJ-FV3A-N91S-UDEU%7C9456607655245d442065b6eec890daa6689d2992%7Clout If you do want to patch AS7 to do upgrade manually, in RESTEasy doc you will learn how to do it: Resteasy is bundled with JBoss AS 7. You will likely have the need to upgrade Resteasy in AS7. The Resteasy distribution comes with a zip file called resteasy-jboss-modules-2.3.4.Final.zip. In the top level directory of JBoss AS 7 (the one with the modules/ directory), unzip this file. You should be patched with the latest and greatest Resteasy after this. 3) I develop a registrar system for students to enroll into classes. One of the war files is registrar-student.war. I am trying to expose my first RESTeasy webservice. I am running EAP6, which runs resteasy 2.3.3 . For this problem, could you please help to create a small demo app that could reproduce your problem? I could help to analyse it if there is a project to work on. I have an ejb that does code table lookups and I figured that is as good as place as any to start. So, I put this class in the app import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; @ApplicationPath(/registrarWebservices) public class RegistrarWebServicesApplication extends Application { //public class RegistrarWebServicesApplication { } I first tried adding the code below to the interface. I got the below error. I added the same code directly to the ejb. I got the same below error. @Path(/codetables) public class UncheckedCodeTablesBean implements SessionBean, UncheckedCodeTablesMethods { ... @GET @Produces(application/xml) public ActionRolesData[] getActionRoles() throws SystemException { Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011234: JAX-RS resource edu.darden.regi strar.session.unchecked.UncheckedCodeTablesBean does not correspond to a view on the EJB UncheckedCodeTables. @Path anno tations can only be placed on classes or interfaces that represent a local, remote or no-interface view of an EJB. at org.jboss.as.jaxrs.deployment.JaxrsComponentDeployer.deploy(JaxrsComponentDeployer.java:81) What am I doing wrong? Sincerely, Nick Skriloff , ME , MCP, SCJP Information Technology Specialist Darden Information Services Voice 434 243 5025 Fax 434 243 2279 skrilo...@darden.virginia.edu (mailto:skrilo...@darden.virginia.edu) -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow
Re: [Resteasy-users] @Form and non-alpha map keys
-- Weinan Li On Saturday, December 1, 2012 at 4:47 AM, John Reiter wrote: Weinan, I just entered a JIRA ticket for this issue: https://issues.jboss.org/browse/RESTEASY-805 Awesome! I've assigned it to me :-) Thanks! John On Fri, Nov 30, 2012 at 2:57 AM, Weinan Li l.wei...@gmail.com (mailto:l.wei...@gmail.com) wrote: -- Weinan Li On Thursday, November 29, 2012 at 11:58 PM, John Reiter wrote: I know it's obvious from the regex, but it looks like map keys with numbers also wouldn't work right now (all I've tested is the case I outlined in my email though). Hi John ,could you please sum up your problem and create a JIRA? I'll work on it, thanks! John On Thu, Nov 29, 2012 at 10:41 AM, Bill Burke bbu...@redhat.com (mailto:bbu...@redhat.com) wrote: I don't see a reason why this couldn't be fixed. On 11/29/2012 8:33 AM, Weinan Li wrote: Hi Bill, Do you think we could support '-' for map key? -- Weinan Li On Tuesday, November 27, 2012 at 12:45 AM, John Reiter wrote: Hello, I'm having an issue with RESTEasy 2.3.4 with using @Form/@FormParam annotations to set values of a Map that uses UUIDs for its keys. My classes basically look like this: @Controller @Path( /test ) public class MyController { @Consumes( MediaType.APPLICATION_FORM_URLENCODED ) @POST public ModelAndView setAssignments( @Form final MyForm myForm ) throws URISyntaxException { ... } } public class MyForm { @Form( prefix = myMap ) private MapString, Foo myMap = Maps.newHashMap(); } public class Foo { @FormParam( bar ) public void setBar( final String bar ) { ... } } The request parameters that get submitted look like this: myMap[75736572-3100-505f-dac0-000745b8].bar myMap[b794c4a0-14b7-0130-c2da-20c9d04983db].bar etc. The Foo.bar properties never end up being set. Stepping through with a debugger, the problem occurs in AbstractCollectionFormInjector.findMatchingPrefixesWithNoneEmptyValues(): that method tries to find keys in the map that match a regex. In this case, the regex is defined in MapFormInjector: public MapFormInjector(Class collectionType, Class keyType, Class valueType, String prefix, ResteasyProviderFactory factory) { super(collectionType, valueType, prefix, Pattern.compile(^ + prefix + \\[([a-zA-Z_]+)\\]), factory); keyInjector = new StringParameterInjector(keyType, keyType, null, Form.class, null, null, new Annotation[0], factory); } And only allows alpha characters and underscores, which is obviously why my map isn't being populated. I'm working around this right now by mapping temporary, alpha-only keys to the real ones and using those in my form then replacing them after the form is submitted. Is there a way to get this regex changed to be something a little more lenient? Really, is there any reason to disallow anything other than maybe brackets? If you want me to enter a JIRA issue for this, let me know. Thanks, John -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) mailto:Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com -- Keep yourself connected to Go Parallel: BUILD Helping you discover the best ways to construct your parallel projects. http://goparallel.sourceforge.net___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] @Form and non-alpha map keys
-- Weinan Li On Thursday, November 29, 2012 at 11:41 PM, Bill Burke wrote: I don't see a reason why this couldn't be fixed. Cool! John, could you please create a JIRA for this and provide me the link so I could assign it to me? Please describe your requirements in detail and I'll work on it. On 11/29/2012 8:33 AM, Weinan Li wrote: Hi Bill, Do you think we could support '-' for map key? -- Weinan Li On Tuesday, November 27, 2012 at 12:45 AM, John Reiter wrote: Hello, I'm having an issue with RESTEasy 2.3.4 with using @Form/@FormParam annotations to set values of a Map that uses UUIDs for its keys. My classes basically look like this: @Controller @Path( /test ) public class MyController { @Consumes( MediaType.APPLICATION_FORM_URLENCODED ) @POST public ModelAndView setAssignments( @Form final MyForm myForm ) throws URISyntaxException { ... } } public class MyForm { @Form( prefix = myMap ) private MapString, Foo myMap = Maps.newHashMap(); } public class Foo { @FormParam( bar ) public void setBar( final String bar ) { ... } } The request parameters that get submitted look like this: myMap[75736572-3100-505f-dac0-000745b8].bar myMap[b794c4a0-14b7-0130-c2da-20c9d04983db].bar etc. The Foo.bar properties never end up being set. Stepping through with a debugger, the problem occurs in AbstractCollectionFormInjector.findMatchingPrefixesWithNoneEmptyValues(): that method tries to find keys in the map that match a regex. In this case, the regex is defined in MapFormInjector: public MapFormInjector(Class collectionType, Class keyType, Class valueType, String prefix, ResteasyProviderFactory factory) { super(collectionType, valueType, prefix, Pattern.compile(^ + prefix + \\[([a-zA-Z_]+)\\]), factory); keyInjector = new StringParameterInjector(keyType, keyType, null, Form.class, null, null, new Annotation[0], factory); } And only allows alpha characters and underscores, which is obviously why my map isn't being populated. I'm working around this right now by mapping temporary, alpha-only keys to the real ones and using those in my form then replacing them after the form is submitted. Is there a way to get this regex changed to be something a little more lenient? Really, is there any reason to disallow anything other than maybe brackets? If you want me to enter a JIRA issue for this, let me know. Thanks, John -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) mailto:Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com -- Keep yourself connected to Go Parallel: VERIFY Test and improve your parallel project with help from experts and peers. http://goparallel.sourceforge.net___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] @Form and non-alpha map keys
-- Weinan Li On Thursday, November 29, 2012 at 11:58 PM, John Reiter wrote: I know it's obvious from the regex, but it looks like map keys with numbers also wouldn't work right now (all I've tested is the case I outlined in my email though). Hi John ,could you please sum up your problem and create a JIRA? I'll work on it, thanks! John On Thu, Nov 29, 2012 at 10:41 AM, Bill Burke bbu...@redhat.com (mailto:bbu...@redhat.com) wrote: I don't see a reason why this couldn't be fixed. On 11/29/2012 8:33 AM, Weinan Li wrote: Hi Bill, Do you think we could support '-' for map key? -- Weinan Li On Tuesday, November 27, 2012 at 12:45 AM, John Reiter wrote: Hello, I'm having an issue with RESTEasy 2.3.4 with using @Form/@FormParam annotations to set values of a Map that uses UUIDs for its keys. My classes basically look like this: @Controller @Path( /test ) public class MyController { @Consumes( MediaType.APPLICATION_FORM_URLENCODED ) @POST public ModelAndView setAssignments( @Form final MyForm myForm ) throws URISyntaxException { ... } } public class MyForm { @Form( prefix = myMap ) private MapString, Foo myMap = Maps.newHashMap(); } public class Foo { @FormParam( bar ) public void setBar( final String bar ) { ... } } The request parameters that get submitted look like this: myMap[75736572-3100-505f-dac0-000745b8].bar myMap[b794c4a0-14b7-0130-c2da-20c9d04983db].bar etc. The Foo.bar properties never end up being set. Stepping through with a debugger, the problem occurs in AbstractCollectionFormInjector.findMatchingPrefixesWithNoneEmptyValues(): that method tries to find keys in the map that match a regex. In this case, the regex is defined in MapFormInjector: public MapFormInjector(Class collectionType, Class keyType, Class valueType, String prefix, ResteasyProviderFactory factory) { super(collectionType, valueType, prefix, Pattern.compile(^ + prefix + \\[([a-zA-Z_]+)\\]), factory); keyInjector = new StringParameterInjector(keyType, keyType, null, Form.class, null, null, new Annotation[0], factory); } And only allows alpha characters and underscores, which is obviously why my map isn't being populated. I'm working around this right now by mapping temporary, alpha-only keys to the real ones and using those in my form then replacing them after the form is submitted. Is there a way to get this regex changed to be something a little more lenient? Really, is there any reason to disallow anything other than maybe brackets? If you want me to enter a JIRA issue for this, let me know. Thanks, John -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) mailto:Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com -- Keep yourself connected to Go Parallel: TUNE You got it built. Now make it sing. Tune shows you how. http://goparallel.sourceforge.net___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Interceptor MessageBodyWriter problems
Cheers, - Weinan On Nov 21, 2012, at 10:56 PM, Henrik Brautaset Aronsen hen...@synth.no wrote: Den 08.11.12 09:39, skrev Henrik Brautaset Aronsen: Den 07.11.12 17:10, skrev Weinan Li: B) I have an ExceptionMapper that works great for @Get requests. When an exception is thrown for a @Post request, though, I get a org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: no.synth.resteasyinterceptordemo.MyExceptionMapper$Error of media type: application/x-www-form-urlencoded This is still a problem, I have no solution here. I've added this as an issue at https://issues.jboss.org/browse/RESTEASY-796 Hi. Did anyone figure out why this is happens? Hi Henrik, Sorry for the late delay as I was sick last whole week. I've reproduced your problem on my machine, and I'm doing some code analysing today. Seems RESTEasy has bypassed the interceptors under your test cases. So I believe it's bug of RESTEasy and I'll let you know my progress after I put more time in this issue :-) Cheers, Henrik -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] undeclaring some methods (of an interface) as being RESTful
-- Weinan Li Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, November 8, 2012 at 1:49 AM, Dominique de Vito wrote: Hi, My use case: I have had a **single** interface where was defined both: - my (annotated) REST methods - my EJB methods, which are exactly the same than my REST methods because my REST interface is implemented through an EJB (3.0). I wanted to declare an EJB method that would not be a REST method. So, I've put this method into my REST interface, but without any REST annotation associated with this method. During my test, Rest-Easy rised an error, because, even if this new method was not associated with any REST annotation, the class has one: a @Path annotation. So, it looks like Rest-Easy is expecting this new method to be a REST method too (like others within the same interface), and then, Rest-Easy is expected REST annotations with this new method. hmm… This shouldn't happen. Dominique, I've created a sample project here: https://github.com/liweinan/javaee And here is the @RequestScopedBean with a voidMethod that doesn't have a JAX-RS annotation: https://github.com/liweinan/javaee/blob/master/src/main/java/net/bluedash/rest/MemberResourceRESTService.java And I've deployed it to jbossas, it works with no problem. Could you please help to check it and try to modify it to show your problem? So, I am looking for the following: tell Rest-Easy this or that method (of an interface) is not to be understood as a REST method. Is there a way to do that ? Thanks. Regards, Dominique -- LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net (mailto:Resteasy-users@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users