Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

J2EE and EJB3 2

Status
Not open for further replies.

russland

Programmer
Jan 9, 2003
315
CH
Hi there,

I'm a C# developer and diving into J2EE 6.0 and starting with the latest Eclipse Galileo J2EE distribution and Tomcat 6.0.

1) I create a EJB Project (no error).
2) I created a EJB 3.0 Session Bean. Error with import of javax.ejb.Stateless saying: "the import of javax.ejb cannot be resolved". 2nd error with annotation @Stateless: "stateless cannot be resolved to a type"

here's the code.

Code:
package com.test.secs;
import javax.ejb.Stateless;
@Stateless
public class Directory implements DirectoryLocal {
    public Directory() {
        // TODO Auto-generated constructor stub
    }
    public void deleteUser(){
    	//TODO Delete user in LDAP.
    }
}

It totally puzzles me, that this libraries do not come with the Eclipse J2EE compilation - or - am I mistakin? Anything that I miss or need to learn?

Any hint is warmly welcome. I spent hours on this issue.
 
I think you need to make sure the j2ee.jar (not sure the exact name) is in your build path.

-----------------------------------------
I cannot be bought. Find leasing information at
 
hm. yes. good guess. i might have referenced the wrong jre, right? doesn't that J2EE-JRE come with the Eclipse J2EE bundle?

sorry, for playing so stupid. It's just no obvious nor plausible to me.
 
Where do I need to point the "JRE HOME"?

Btw, Tomcat is not a J2EE server suporting EJB? right? Well, if that's the case, I don't need to try any further because then I wouldn't find any libraries for EJB syntax.

answer and advice?
 
Okay I've learned I need OpenESB from Apache for the Tomcat server in order to run EJB.
 
Solution:
1) When OpenEJB Plugin for Eclipse is downloaded and installed from the Apache OpenEJB, do a restart.
2) Create a new EJB Project
2.1) Name it.
2.2) Create a new target runtime. Select OpenEJB 3.x.x from the Apache folder. Target the location %catalina_home%/webapps/openejb/.
2.3) Select EJB module version to 3.0
2.4) Select the Default OpenEJB 3.x.x
2.5) Finish.
3) Create a new Session bean
3.1) Name it.
3.2) Finish.
Your session bean is ready - and libraries are correctly maped. Read to use EJB 3.0. Have fun.
 
Another Hint: deploy (install) AXIS2 war before OpenEJB war on your tomcat server 6.x. Otherwise the tomcat server will not start.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top