|
From: da k. <reg...@ya...> - 2008-06-18 12:45:51
|
Hello, I'm trying to get RESTeasy to work with Seam hot-deployed components, but I can't figure it out. Because this is a mailing list, I will copy my posting from seamframework.org . If someone can give me some hints, I will post them to the seam forum as well. My project is using seam components, no EJBs. So all my action classes go to WEB-INF/dev and therefore are not visible for classes deployed outside, because of the custom seam class loader, right? So when I want to use a Seam and JAX-RS annotated action class (@NAME, @PATH at Class, and @GET at method) with RESTeasy, it fails to find it, because it scans in WEB-INF/classes by default. Even when I configure RESTeasy with context param resteasy.resources including the fully qualified class name, I get a ClassNotFoundException. Ok, then I tried to put the action class in model directory, changed package name and corresponding resteasy.resources param. Now RESTeasy finds the class and tries to process the @GET marked action method, but it fails with an NPE when using the injected EntityManager. I guess there is no DI happening? But I want to load the RESTeasy/JAXB annotated entity... So, the questions are: Is there a way for RESTeasy to load seam components in WEB-INF/dev? If not, can I use the @In Annotation for the EntityManager to get access to seam managed persistence context in RESTeasy? All the examples I found are using EJB/Seam components, not regular seam beans. Anyone got this to work? Thanks for any pointers... Regen PS: I'm using RESTeasy Beta 5, Seam 2.0.2.SP1, JBoss 4.2.2.GA __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com |
|
From: Ryan M. <rmc...@sa...> - 2008-06-18 16:52:43
|
Regan, Seam support is something that I'd like to get in at some point, and I did have it working in some of the very early versions of RESTEasy. I doubt we'd be able to get Seam support in 1.0, but it's on my radar for a future release. To answer your question about the use of a Seam-managed EntityManager in a Resource: you've have to be able to have the Resource double as a Seam component otherwise you will get an NPE. Once I get the MultipartData support wrapped up, I'll have a look at the class loader stuff and proper Seam integration. Ryan- Ryan J. McDonough Platform, Specialist Java EE | Sapient 25 First Street Cambridge, MA 02141 desk: +1 617 761 1611 mobile: +1 508 735 4503 fax: +1 617 621 1300 The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. ________________________________ From: res...@li... [mailto:res...@li...] On Behalf Of da kna Sent: Wednesday, June 18, 2008 8:46 AM To: res...@li... Subject: [Resteasy-developers] RESTeasy and Hot Deployed Seam Components Hello, I'm trying to get RESTeasy to work with Seam hot-deployed components, but I can't figure it out. Because this is a mailing list, I will copy my posting from seamframework.org <http://seamframework.org/Community/HotDeploymentEntityManagerAndRESTeas yProblem> . If someone can give me some hints, I will post them to the seam forum as well. My project is using seam components, no EJBs. So all my action classes go to WEB-INF/dev and therefore are not visible for classes deployed outside, because of the custom seam class loader, right? So when I want to use a Seam and JAX-RS annotated action class (@NAME, @PATH at Class, and @GET at method) with RESTeasy, it fails to find it, because it scans in WEB-INF/classes by default. Even when I configure RESTeasy with context param resteasy.resources including the fully qualified class name, I get a ClassNotFoundException. Ok, then I tried to put the action class in model directory, changed package name and corresponding resteasy.resources param. Now RESTeasy finds the class and tries to process the @GET marked action method, but it fails with an NPE when using the injected EntityManager. I guess there is no DI happening? But I want to load the RESTeasy/JAXB annotated entity... So, the questions are: Is there a way for RESTeasy to load seam components in WEB-INF/dev? If not, can I use the @In Annotation for the EntityManager to get access to seam managed persistence context in RESTeasy? All the examples I found are using EJB/Seam components, not regular seam beans. Anyone got this to work? Thanks for any pointers... Regen PS: I'm using RESTeasy Beta 5, Seam 2.0.2.SP1, JBoss 4.2.2.GA ________________________________ Gesendet von Yahoo! Mail <http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http:/us.rd.yahoo.c om/evt=52427/*http:/de.overview.mail.yahoo.com> . Dem pfiffigeren Posteingang. |
|
From: Bill B. <bb...@re...> - 2008-06-19 01:28:28
|
No, I don't have Seam integration. I'm also not sure it fits. Seam maintains a conversation between the client and the server which is kind of against the REST principal of statelessness. If you're just looking to be able to use the @PersistenceContext annotation to inject JPA references, you could use an EJB to do this. Just use the JAX-RS annotations on the EJB's business interface and use the resteasy.jndi.resources http://wiki.jboss.org/wiki/RESTeasyEJBIntegration for more information. da kna wrote: > Hello, > > I'm trying to get RESTeasy to work with Seam hot-deployed components, > but I can't figure it out. Because this is a mailing list, I will copy > my posting from seamframework.org > <http://seamframework.org/Community/HotDeploymentEntityManagerAndRESTeasyProblem>. > If someone can give me some hints, I will post them to the seam forum > as well. > > My project is using seam components, no EJBs. So all my action classes > go to WEB-INF/dev and therefore are not visible for classes deployed > outside, because of the custom seam class loader, right? > > > So when I want to use a Seam and JAX-RS annotated action class (@NAME, > @PATH at Class, and @GET at method) with RESTeasy, it fails to find it, > because it scans in WEB-INF/classes by default. Even when I configure > RESTeasy with context param resteasy.resources including the fully > qualified class name, I get a ClassNotFoundException. > > > Ok, then I tried to put the action class in model directory, changed > package name and corresponding resteasy.resources param. Now RESTeasy > finds the class and tries to process the @GET marked action method, but > it fails with an NPE when using the injected EntityManager. I guess > there is no DI happening? But I want to load the RESTeasy/JAXB annotated > entity... > > > So, the questions are: > > > Is there a way for RESTeasy to load seam components in WEB-INF/dev? > > > If not, can I use the @In Annotation for the EntityManager to get access > to seam managed persistence context in RESTeasy? > > > All the examples I found are using EJB/Seam components, not regular seam > beans. Anyone got this to work? Thanks for any pointers... > > > Regen > > > PS: I'm using RESTeasy Beta 5, Seam 2.0.2.SP1, JBoss 4.2.2.GA > > > ------------------------------------------------------------------------ > Gesendet von Yahoo! Mail > <http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52427/*http://de.overview.mail.yahoo.com>. > > Dem pfiffigeren Posteingang. > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > > > ------------------------------------------------------------------------ > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Jay B. <te...@gm...> - 2008-06-19 14:07:09
|
It sounds like this is similar to what I was thinking about with seam at the NEJUG talk . It is not really integration, more compatibility. Take this example : I have a Seam component (EJB or POJO does not matter - but most likely stateless) and I also want to have if accessible through a restful call, I should be able to put the correct annotations on it with resteasy and have it work. This would mean either a combined WAR with seam app, and resteasy servlet, or separate wars in an EAR, or something like that. I see seam and resteasy working together really two primary ways. Either the way described above - as different ways to access/manipulate the underlying component. The other would be Seam using restful calls internally as a result of a user action, or to pull data for the UI. These internal restful calls would not really be integration either, but more like a data source, or remote EJB call via rest. The question is - do the co-exist well, not do work together and know about each other. My $.02, -Jay On Wed, Jun 18, 2008 at 9:30 PM, Bill Burke <bb...@re...> wrote: > No, I don't have Seam integration. I'm also not sure it fits. Seam > maintains a conversation between the client and the server which is kind > of against the REST principal of statelessness. If you're just looking > to be able to use the @PersistenceContext annotation to inject JPA > references, you could use an EJB to do this. Just use the JAX-RS > annotations on the EJB's business interface and use the > > resteasy.jndi.resources > > > http://wiki.jboss.org/wiki/RESTeasyEJBIntegration > > for more information. > > da kna wrote: > > Hello, > > > > I'm trying to get RESTeasy to work with Seam hot-deployed components, > > but I can't figure it out. Because this is a mailing list, I will copy > > my posting from seamframework.org > > < > http://seamframework.org/Community/HotDeploymentEntityManagerAndRESTeasyProblem > >. > > If someone can give me some hints, I will post them to the seam forum > > as well. > > > > My project is using seam components, no EJBs. So all my action classes > > go to WEB-INF/dev and therefore are not visible for classes deployed > > outside, because of the custom seam class loader, right? > > > > > > So when I want to use a Seam and JAX-RS annotated action class (@NAME, > > @PATH at Class, and @GET at method) with RESTeasy, it fails to find it, > > because it scans in WEB-INF/classes by default. Even when I configure > > RESTeasy with context param resteasy.resources including the fully > > qualified class name, I get a ClassNotFoundException. > > > > > > Ok, then I tried to put the action class in model directory, changed > > package name and corresponding resteasy.resources param. Now RESTeasy > > finds the class and tries to process the @GET marked action method, but > > it fails with an NPE when using the injected EntityManager. I guess > > there is no DI happening? But I want to load the RESTeasy/JAXB annotated > > entity... > > > > > > So, the questions are: > > > > > > Is there a way for RESTeasy to load seam components in WEB-INF/dev? > > > > > > If not, can I use the @In Annotation for the EntityManager to get access > > to seam managed persistence context in RESTeasy? > > > > > > All the examples I found are using EJB/Seam components, not regular seam > > beans. Anyone got this to work? Thanks for any pointers... > > > > > > Regen > > > > > > PS: I'm using RESTeasy Beta 5, Seam 2.0.2.SP1, JBoss 4.2.2.GA > > > > > > ------------------------------------------------------------------------ > > Gesendet von Yahoo! Mail > > < > http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52427/*http://de.overview.mail.yahoo.com > >. > > > > Dem pfiffigeren Posteingang. > > > > > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://sourceforge.net/services/buy/index.php > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Resteasy-developers mailing list > > Res...@li... > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > -- blog: http://in.relation.to/Bloggers/Jay |