Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I reference my EJB layer objects from my web service layer?  RSS feed

Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a 2-tier application in a EAR file, consist of EJB3/persistence layer (.jar) and a CXF2/webservice layer (.war). The webservice layer need to use the EJB3 beans from the EJB layer to provide web services to the front-end clients.

The EJB layer compiled ok. I also configured the webservice layer to use the ejb layer using a "provided" reference in the pom.xml file.

However I encountered an error when I compile the web service layer. I don't understand why the webservice layer try to resolve class reference to the Persistence apis.

Here is the error:

here is the place where I use EJB objects:

In my pom.xml file, I have the following reference to the ejb layer:

The EAR is going to be deployed in JBOSS AS7.
Is there anything wrong with my architecture and what is wrong with my project setup?

Any suggestion is very appreciated.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!