File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes How to refer web project from ejb project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Meteor in Action this week in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to refer web project from ejb project" Watch "How to refer web project from ejb project" New topic

How to refer web project from ejb project

Kulbhushan Azad

Joined: Nov 06, 2008
Posts: 3

I am using websphere 6.0 and i have to add a new stateless session bean in the ejb module which needs to access the existing business logic classes present in WEB project of the same EAR.

I am using RSA as the IDE for the development and added the webproject in the buildpath as a "required projects on the build path" entry. The application compiles fine . However , when i try to access the bean with local or remote client then its giving error as
java.lang.NoClassDefFoundError for the same reference class of web project which was used in the bean.

Please tell me where do i need to add the reference of this particular webproject class in order to correct this problem

Thanks a lot in advance
Ankit Garg

Joined: Aug 03, 2008
Posts: 9339

Well I don't how this would be possible but I would say that this is a very weird situation and I think you should think about redesigning your application a bit...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Raf Szczypiorski
Ranch Hand

Joined: Aug 21, 2008
Posts: 383
When you want to be able to access classes in both modules in an EAR, you put it in a separate jar file in a lib subdirectory. You can change the name of this directory in application.xml using the <library-directory> element. Check if this works for you.
I agree. Here's the link:
subject: How to refer web project from ejb project