Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

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

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.
Thanks
Sam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic