On 12/6/2012 4:39 AM, Heiko W.Rupp wrote: > Hey Bill, > > Am 05.12.2012 um 22:37 schrieb Bill Burke: > >> Java EE 6 doesn't support EJB + JAX-RS components that are not deployed >> under the WEB-INF/lib or WEB-INF/classes. SO, you must move >> biz-stuff.jar into rest.war or create a JAX-RS service that delegates to >> the EJBs. > > I don't exactly understand this, as my set up works (except for that one case) > perfectly. I have a rest.war I set some params that are picked up by RE and > then a jar with all my rest endpoint implementation classes (SLSB with @Path > and so on). > The REST stuff inside the jar gets activated by the presence of > @ApplicationPath on > one of my application classes in the jar and then RE scans the EJBs and > provides > endpoints for the ones decorated with @Path. Works nicely.
Where is the JAX-RS resource classes? Where is the Application class? Which jar? And where is this jar in the EAR? If AS7 is allowing you to deploy JAX-RS in a .jar that is *NOT* inside a WAR, then this is a huge huge bug. JAX-RS does not have a way to define security constraints so it is required to be deployed within a specific WEB application (.WAR). Also, @ApplicationPath is not a context-root. It is a servlet-mapping URL for a JAX-RS dispatcher servlet. >> >> But, Resteasy can support it your case with a special config switch. >> >> <context-param> >> <param-name>resteasy.jndi.resources</param-name> >> <param-value>LibraryBean/local</param-value> >> </context-param> > > But here I have to manually list all the @Local classes manually and can't use > the autoscan feature described above. > > > My issue is now that I have several web-apps inside the .ear with > different context roots and I want the REST-endpoint only be present > below /rest and not in other places. > Then, the EJB jar needs to be put in the WEB-INF/lib of the WAR that has a /rest context-root. Or, you can use the technique above. I would suggest deploying your EJBs with a WAR. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com ------------------------------------------------------------------------------ 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 https://lists.sourceforge.net/lists/listinfo/resteasy-users