aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes My First EJB with Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "My First EJB with Eclipse" Watch "My First EJB with Eclipse" New topic
Author

My First EJB with Eclipse

Dave Elwood
Ranch Hand

Joined: Dec 27, 2002
Posts: 84
With Eclipse I've got all components, interfaces and classes, written to make an EJB for my Tomcat.

However some classes and interfaces, such as EJBObject are not in the typical JDK 1.4.2 that I have so ...

from JBoss I found jboss-j2ee.jar, extracted the whole tree and imported it into my project.

Eclipse doesn't see that EJBObject is located right there under javax.ejb.* in the project directory. Only when I tow the one class into the same directory as my project's interfaces etc. is the EJBObject.class file visible.

I must be doing something really dumb. :roll:
John Ament
Greenhorn

Joined: Jul 07, 2007
Posts: 22
You can create a UserLibrary (right click on project, build path -> configure build path, libraries -> add library, user library, next, click the button "User Libraries..." new) with this jar file in it.

BTW, tomcat out of the box doesn't support EJBs. Are you maybe meaning JBoss as the app server?
Dave Elwood
Ranch Hand

Joined: Dec 27, 2002
Posts: 84
Thank you John.
I haven't gotten far enough to say if Tomcat will do EJBs. I do have JBoss here lying about and as soon as I get the EJBs to at least compile then I'll try that.
[ July 10, 2007: Message edited by: Dave Elwood ]
Dave Elwood
Ranch Hand

Joined: Dec 27, 2002
Posts: 84
Creating a user library solved it John.
I see that the jboss-j2ee.jar is not physically duplicated in my project directory, as it was when I used import.
I wonder why it didn't see the classes when I used 'import'?
Was it because they didn't have any source code? And only the compiled *.class files?
[ July 10, 2007: Message edited by: Dave Elwood ]
John Ament
Greenhorn

Joined: Jul 07, 2007
Posts: 22
Exactly. Your project should contain source code, your user libraries should contain dependencies (or you can use dependencies between projects).
[ July 10, 2007: Message edited by: John Ament ]
 
jQuery in Action, 2nd edition
 
subject: My First EJB with Eclipse