Re: [Resteasy-users] How to setup RESTEasy with CDI and Netty?
Thank you. After adding one more dependency (javax.servlet-api), I get the following error, when I try to start my RESTEasy/Weld configuration: Exception in thread main java.lang.RuntimeException: Unable to instantiate InjectorFactory implementation. at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:156) at org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer.start(NettyJaxrsServer.java:130) at com.example.jaxrscdi.App.run(App.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253) at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232) at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169) at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165) at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119) at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112) at org.jboss.weld.event.EventImpl.fire(EventImpl.java:83) at org.jboss.weld.environment.se.Weld.initialize(Weld.java:153) at org.jboss.weld.environment.se.StartMain.go(StartMain.java:41) at org.jboss.weld.environment.se.StartMain.main(StartMain.java:52) Caused by: java.lang.NullPointerException at org.jboss.resteasy.cdi.CdiInjectorFactory.lookupBeanManager(CdiInjectorFactory.java:155) at org.jboss.resteasy.cdi.CdiInjectorFactory.init(CdiInjectorFactory.java:45) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:374) at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:148) ... 18 more Any idea? Regards, Christian -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] How to setup RESTEasy with CDI and Netty?
I assumed this would happen, based on Bill's email. you'll probably need to extend the CdiInjectorFactory to use your own BeanManager. On Tue, Nov 26, 2013 at 1:58 PM, Christian Helmbold christian.helmb...@yahoo.de wrote: Thank you. After adding one more dependency (javax.servlet-api), I get the following error, when I try to start my RESTEasy/Weld configuration: Exception in thread main java.lang.RuntimeException: Unable to instantiate InjectorFactory implementation. at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:156) at org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer.start(NettyJaxrsServer.java:130) at com.example.jaxrscdi.App.run(App.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253) at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232) at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169) at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165) at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119) at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112) at org.jboss.weld.event.EventImpl.fire(EventImpl.java:83) at org.jboss.weld.environment.se.Weld.initialize(Weld.java:153) at org.jboss.weld.environment.se.StartMain.go(StartMain.java:41) at org.jboss.weld.environment.se.StartMain.main(StartMain.java:52) Caused by: java.lang.NullPointerException at org.jboss.resteasy.cdi.CdiInjectorFactory.lookupBeanManager(CdiInjectorFactory.java:155) at org.jboss.resteasy.cdi.CdiInjectorFactory.init(CdiInjectorFactory.java:45) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:374) at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:148) ... 18 more Any idea? Regards, Christian -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Replacing ProxyFactory with RestEasyWebTarget does not work
This is a Resteasy Client - JAX-RS 2.0 mismatch migration problem. Replace: response.getEntity() with: response.readEntity(String.class); replace String.class to whatever class you want to marshal to. getEntity() returns null if you haven't unmarshalled anything with readEntity(). On 11/26/2013 2:59 PM, Gabriella Turek wrote: After upgrading from Resteasy 2.4 to 3.0.5, none of my client calls work anymore. The entity which I am expecting (as simple as a String) is always null. In debug mode I can see it being set in the Response object on the server side, but on the client side the entity in the Response is null. Here is an example call: The interface: | /** * @return all expired licenses */ @GET @ClientResponseType(entityType= LicenseList.class) @Path(/expired) @Produces(MediaType.APPLICATION_XML) public Response getExpiredLicenses();| The implementation: | /** * @return all expired licenses */ @Override public Response getExpiredLicenses() { try { LicenseList list= LicensesDBUtil.getExpiredLicenses(); Response resp= Response.ok().entity(list).build(); return resp; } catch (SQLException e) { LOG.error(Error getting expired licenses : + e.getMessage()); return Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); }| The test call : | @Test public void testGetExpiredLicenses() throws Exception { ResteasyClientBuilder rsb= new ResteasyClientBuilder(); ResteasyClient rsc= rsb.build(); ResteasyWebTarget target= rsc.target(BASEURL); return target.proxy(RiskScapeLicenseService.class); Response response= client.getExpiredLicenses(); assertTrue(HttpResponseCodes.SC_OK== response.getStatus()); @SuppressWarnings(unchecked) JAXBElementLicenseList element= (JAXBElementLicenseList) response.getEntity(); LicenseList list= element.getValue(); assertEquals(4, list.getLicenses().size()); for (License lic: list.getLicenses()) { assertTrue((new Date()).after(DateUtils.parseDate(lic.getValidTo(), new String[] { -MM-dd }))); } }| My web.xml file: |?xml version=1.0 encoding=UTF-8? web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns=http://java.sun.com/xml/ns/javaee; xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; version=2.5 display-nameriskscapelic_rest/display-name listener listener-class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap /listener-class /listener servlet servlet-nameResteasy/servlet-name servlet-classorg.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher/servlet-class /servlet servlet-mapping servlet-nameResteasy/servlet-name url-pattern/*/url-pattern /servlet-mapping context-param param-nameresteasy.scan/param-name param-valuetrue/param-value /context-param context-param param-nameresteasy.servlet.mapping.prefix/param-name param-value//param-value /context-param /web-app| The LicenseList class: |@XmlRootElement(name= LicenseList) @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name= licenseList, propOrder= { licenses }) public class LicenseList { @XmlElement(name= Licenses, required= true) protected ListLicense licenses; /** * Gets the value of the licenses property. * * p * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a CODEset/CODE method for the licenses property. * * p * For example, to add a new item, do as follows: * pre *getLicenses().add(newItem); * /pre * * * p * Objects of the following type(s) are allowed in the list * {@link License } * * */ public ListLicense getLicenses() { if (licenses== null) { licenses= new ArrayListLicense(); } return this.licenses; } }| I am using JDK 1.7, Tomcat 7.0.47 -- Dr Gabriella Turek Sr. Software Engineer, Systems Development Team NIWA Auckland, New Zealand Tel: +64 9 3754645 www.niwa.co.nz NIWA - Enhancing the benefit of New Zealand’s natural resources. -- Please consider the environment before printing this email. NIWA is the trading name of the National Institute of Water Atmospheric Research Ltd. -- Rapidly troubleshoot problems
Re: [Resteasy-users] Replacing ProxyFactory with RestEasyWebTarget does not work
No, I've tried that, it does not work. I get the following error: java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast to nz.org.riskscape.license.rest.domain.LicenseList at nz.org.riskscape.license.rest.RiskScapeLicenseServiceTest.testGetExpiredLic enses(RiskScapeLicenseServiceTest.java:102) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:5 7) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp l.java:43) at java.lang.reflect.Method.invoke(Method.java:606) -- Dr Gabriella Turek Sr. Software Engineer, Systems Development Team NIWA Auckland, New Zealand Tel: +64 9 3754645 www.niwa.co.nz NIWA - Enhancing the benefit of New Zealand¹s natural resources. Date: Tue, 26 Nov 2013 15:51:56 -0500 From: Bill Burke bbu...@redhat.com Subject: Re: [Resteasy-users] Replacing ProxyFactory with RestEasyWebTarget does not work To: resteasy-users@lists.sourceforge.net Message-ID: 529509ec.3000...@redhat.com Content-Type: text/plain; charset=windows-1252; format=flowed This is a Resteasy Client - JAX-RS 2.0 mismatch migration problem. Replace: response.getEntity() with: response.readEntity(String.class); replace String.class to whatever class you want to marshal to. getEntity() returns null if you haven't unmarshalled anything with readEntity(). On 11/26/2013 2:59 PM, Gabriella Turek wrote: After upgrading from Resteasy 2.4 to 3.0.5, none of my client calls work anymore. The entity which I am expecting (as simple as a String) is always null. In debug mode I can see it being set in the Response object on the server side, but on the client side the entity in the Response is null. Here is an example call: The interface: | /** * @return all expired licenses */ @GET @ClientResponseType(entityType= LicenseList.class) @Path(/expired) @Produces(MediaType.APPLICATION_XML) public Response getExpiredLicenses();| The implementation: | /** * @return all expired licenses */ @Override public Response getExpiredLicenses() { try { LicenseList list= LicensesDBUtil.getExpiredLicenses(); Response resp= Response.ok().entity(list).build(); return resp; } catch (SQLException e) { LOG.error(Error getting expired licenses : + e.getMessage()); return Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type (MediaType.TEXT_PLAIN).build(); }| The test call : | @Test public void testGetExpiredLicenses() throws Exception { ResteasyClientBuilder rsb= new ResteasyClientBuilder(); ResteasyClient rsc= rsb.build(); ResteasyWebTarget target= rsc.target(BASEURL); return target.proxy(RiskScapeLicenseService.class); Response response= client.getExpiredLicenses(); assertTrue(HttpResponseCodes.SC_OK== response.getStatus()); @SuppressWarnings(unchecked) JAXBElementLicenseList element= (JAXBElementLicenseList) response.getEntity(); LicenseList list= element.getValue(); assertEquals(4, list.getLicenses().size()); for (License lic: list.getLicenses()) { assertTrue((new Date()).after(DateUtils.parseDate(lic.getValidTo(), new String[] { -MM-dd }))); } }| My web.xml file: |?xml version=1.0 encoding=UTF-8? web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns=http://java.sun.com/xml/ns/javaee; xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; version=2.5 display-nameriskscapelic_rest/display-name listener listener-class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap /listener-class /listener servlet servlet-nameResteasy/servlet-name servlet-classorg.jboss.resteasy.plugins.server.servlet.HttpServletDispa tcher/servlet-class /servlet servlet-mapping servlet-nameResteasy/servlet-name url-pattern/*/url-pattern /servlet-mapping context-param param-nameresteasy.scan/param-name param-valuetrue/param-value /context-param context-param param-nameresteasy.servlet.mapping.prefix/param-name param-value//param-value /context-param /web-app| The LicenseList class: |@XmlRootElement(name= LicenseList) @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name= licenseList, propOrder= { licenses }) public class LicenseList { @XmlElement(name= Licenses, required= true) protected ListLicense licenses; /** * Gets the value of the licenses property. * * p * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the *
Re: [Resteasy-users] How to setup RESTEasy with CDI and Netty?
John D. Ament john.d.am...@gmail.com schrieb am 20:23 Dienstag, 26.November 2013: I assumed this would happen, based on Bill's email. You're right. This happend after adding the following line to my startup code: deployment.setInjectorFactoryClass(org.jboss.resteasy.cdi.CdiInjectorFactory.class.getName()); you'll probably need to extend the CdiInjectorFactory to use your own BeanManager. I wonder why http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034 seems to be so simple. Sounds like Weld and RESTEasy are simply not built for what I want to do! The philosophie seems to be: use the whole application server or use something else. My idea was to create a small configuration which could be restarted very fast during development. I've done something similar with Guice and Jersey. But Wildfly should start pretty fast, so this could be better than trying to do the configuration myself. Christian -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] Replacing ProxyFactory with RestEasyWebTarget does not work
So, I've resolved my issue by updating my schema with jaxb:version=2.0 and regenerating the jaxb classes. The tip off was Bill's mention of there being a Resteasy Client - JAX-RS 2.0 mismatch migration problem Cheers! Gaby On 27/11/13 10:00 AM, Gabriella Turek gabriella.tu...@niwa.co.nz wrote: No, I've tried that, it does not work. I get the following error: java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast to nz.org.riskscape.license.rest.domain.LicenseList at nz.org.riskscape.license.rest.RiskScapeLicenseServiceTest.testGetExpiredL i c enses(RiskScapeLicenseServiceTest.java:102) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java : 5 7) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI m p l.java:43) at java.lang.reflect.Method.invoke(Method.java:606) -- Dr Gabriella Turek Sr. Software Engineer, Systems Development Team NIWA Auckland, New Zealand Tel: +64 9 3754645 www.niwa.co.nz NIWA - Enhancing the benefit of New Zealand¹s natural resources. Date: Tue, 26 Nov 2013 15:51:56 -0500 From: Bill Burke bbu...@redhat.com Subject: Re: [Resteasy-users] Replacing ProxyFactory with RestEasyWebTarget does not work To: resteasy-users@lists.sourceforge.net Message-ID: 529509ec.3000...@redhat.com Content-Type: text/plain; charset=windows-1252; format=flowed This is a Resteasy Client - JAX-RS 2.0 mismatch migration problem. Replace: response.getEntity() with: response.readEntity(String.class); replace String.class to whatever class you want to marshal to. getEntity() returns null if you haven't unmarshalled anything with readEntity(). On 11/26/2013 2:59 PM, Gabriella Turek wrote: After upgrading from Resteasy 2.4 to 3.0.5, none of my client calls work anymore. The entity which I am expecting (as simple as a String) is always null. In debug mode I can see it being set in the Response object on the server side, but on the client side the entity in the Response is null. Here is an example call: The interface: | /** * @return all expired licenses */ @GET @ClientResponseType(entityType= LicenseList.class) @Path(/expired) @Produces(MediaType.APPLICATION_XML) public Response getExpiredLicenses();| The implementation: | /** * @return all expired licenses */ @Override public Response getExpiredLicenses() { try { LicenseList list= LicensesDBUtil.getExpiredLicenses(); Response resp= Response.ok().entity(list).build(); return resp; } catch (SQLException e) { LOG.error(Error getting expired licenses : + e.getMessage()); return Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).ty p e (MediaType.TEXT_PLAIN).build(); }| The test call : | @Test public void testGetExpiredLicenses() throws Exception { ResteasyClientBuilder rsb= new ResteasyClientBuilder(); ResteasyClient rsc= rsb.build(); ResteasyWebTarget target= rsc.target(BASEURL); return target.proxy(RiskScapeLicenseService.class); Response response= client.getExpiredLicenses(); assertTrue(HttpResponseCodes.SC_OK== response.getStatus()); @SuppressWarnings(unchecked) JAXBElementLicenseList element= (JAXBElementLicenseList) response.getEntity(); LicenseList list= element.getValue(); assertEquals(4, list.getLicenses().size()); for (License lic: list.getLicenses()) { assertTrue((new Date()).after(DateUtils.parseDate(lic.getValidTo(), new String[] { -MM-dd }))); } }| My web.xml file: |?xml version=1.0 encoding=UTF-8? web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns=http://java.sun.com/xml/ns/javaee; xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; version=2.5 display-nameriskscapelic_rest/display-name listener listener-class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap /listener-class /listener servlet servlet-nameResteasy/servlet-name servlet-classorg.jboss.resteasy.plugins.server.servlet.HttpServletDis p a tcher/servlet-class /servlet servlet-mapping servlet-nameResteasy/servlet-name url-pattern/*/url-pattern /servlet-mapping context-param param-nameresteasy.scan/param-name param-valuetrue/param-value /context-param context-param param-nameresteasy.servlet.mapping.prefix/param-name param-value//param-value /context-param /web-app| The LicenseList class: |@XmlRootElement(name= LicenseList) @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name= licenseList, propOrder= { licenses }) public class LicenseList { @XmlElement(name= Licenses,
Re: [Resteasy-users] How to setup RESTEasy with CDI and Netty?
On 11/26/2013 4:17 PM, Christian Helmbold wrote: John D. Ament john.d.am...@gmail.com schrieb am 20:23 Dienstag, 26.November 2013: I assumed this would happen, based on Bill's email. You're right. This happend after adding the following line to my startup code: deployment.setInjectorFactoryClass(org.jboss.resteasy.cdi.CdiInjectorFactory.class.getName()); you'll probably need to extend the CdiInjectorFactory to use your own BeanManager. I wonder why http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034 seems to be so simple. Sounds like Weld and RESTEasy are simply not built for what I want to do! The philosophie seems to be: use the whole application server or use something else. My idea was to create a small configuration which could be restarted very fast during development. I've done something similar with Guice and Jersey. But Wildfly should start pretty fast, so this could be better than trying to do the configuration myself. I would dive into this, but I don' thave the cycles at this time. Its just a matter of gettin Weld initialized in a SE environment, and then tweaking the CdiInjectorFactory. There is a Resteasy Guice adapter too. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users
Re: [Resteasy-users] How to setup RESTEasy with CDI and Netty?
Bill, Actually from looking at the current impl, I have a fairly small trivial change. It would only work in CDI 1.1 though. I could probably implement it using reflection to avoid the compilation change, if you're interested in taking the contribution. This would use standard CDI look up in an SE environment. John On Tue, Nov 26, 2013 at 6:06 PM, Bill Burke bbu...@redhat.com wrote: On 11/26/2013 4:17 PM, Christian Helmbold wrote: John D. Ament john.d.am...@gmail.com schrieb am 20:23 Dienstag, 26.November 2013: I assumed this would happen, based on Bill's email. You're right. This happend after adding the following line to my startup code: deployment.setInjectorFactoryClass(org.jboss.resteasy.cdi.CdiInjectorFactory.class.getName()); you'll probably need to extend the CdiInjectorFactory to use your own BeanManager. I wonder why http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034 seems to be so simple. Sounds like Weld and RESTEasy are simply not built for what I want to do! The philosophie seems to be: use the whole application server or use something else. My idea was to create a small configuration which could be restarted very fast during development. I've done something similar with Guice and Jersey. But Wildfly should start pretty fast, so this could be better than trying to do the configuration myself. I would dive into this, but I don' thave the cycles at this time. Its just a matter of gettin Weld initialized in a SE environment, and then tweaking the CdiInjectorFactory. There is a Resteasy Guice adapter too. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users