简体   繁体   中英

Getting REST Resource path in EAR file

I have an EJB project which contains a Rest Web Service EJB. I package this EJB.jar project into an EAR file along with a WAR project. What would be the absolute path of my Rest Web Service then?

My problem seems to be due to the fact that the EJB JAR file containing the EJB REST Web Service is packaged in an EAR file alongside a WAR file. I've read that you can use JAX-RS within an EJB JAR file but what I wasn't aware of was that this JAR file has to then be packaged within the WEB-INF/lib folder in a Dynamic Web Project (WAR file). According to this link, it is not supported for JAX-RS EJB's to be included in an EAR file.

Glad that you've already found an answer.
From my perspective, exposing stateless EJB beans as restfull services is fast, but typically isn't the best approach.

Usually, it is better to create restfull endpoint classes in a web module that wraps errors/ exceptions coming from ejb services. This is also a good place to do some translations etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM