aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes The import java.ejb.*; cannot be resolved Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "The import java.ejb.*; cannot be resolved" Watch "The import java.ejb.*; cannot be resolved" New topic
Author

The import java.ejb.*; cannot be resolved

Nicolas Kal
Ranch Hand

Joined: Sep 09, 2009
Posts: 69
Hi ranchers!

I have just started preparing for the SCBCD certification and I am completely new to EJB. I have started reading EJB 3 in action and Head First EJB and i am "deadlocked" in the very first "Hello world" which cannot compile. I know that I have to install EE Jdk. I have downloaded it from http://java.sun.com/javaee/downloads/index.jsp?userOsIndex=6&userOsId=windows&userOsName=Windows, under my project specification, java build path, libraries, i select to add new library and specifically new JRE System library and select it from the folder which i have installed the ee jdk. The import javax.ejb.* still is not recognised, does anybody knows what I'm doing wrong?

The IDE platform I am using is IBM Rational Application Developer, version 7.0.08.

Thanks!


SCJP 6.0 , SBCD (Preparing..),
MSc Enterprise Systems Development, BSc Computer Science
Tom Kowalski
Ranch Hand

Joined: Feb 17, 2009
Posts: 72
You have probably create J2SE project, and you should have J2EE. Then you can import ejb libraries without problem.


SCJP, SCWCD, OCUP
Nicolas Kal
Ranch Hand

Joined: Sep 09, 2009
Posts: 69
The options available under J2EE are the following:
Application Client Project
Connector Project
Enterprise Application Project
Utility project and there is another which is not in the J2EE section called EJB Project.

Clearly I have not used neither of them.

Although both books mention that they are intended also for developers with no J2EE experience none of them at least devote a single page to how you should set your project prior proceed to coding.. I'm searching all over google to see how on earth i will start coding this simple example

Tom Kowalski
Ranch Hand

Joined: Feb 17, 2009
Posts: 72
I have never used this IDE, so it is hard for me to say which of those you should choose. In my opinion, the best solution would be to start your journey with EJB by using NetBeans - there is a lot of tutorials in the Internet, and it will be much simple.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3860

Nicolas Kal wrote: .. under my project specification, java build path, libraries, i select to add new library and specifically new JRE System library and select it from the folder which i have installed the ee jdk. The import javax.ejb.* still is not recognised, does anybody knows what I'm doing wrong?

You should add the .jar file(s) provided for the EJB by the container as a library (this is in general but not specific to the IDE you are using).


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Nicolas Kal
Ranch Hand

Joined: Sep 09, 2009
Posts: 69
I have found a relevant topic:

http://www.coderanch.com/t/462171/EJB-Other-Java-EE-Technologies/java/Starting-Headfirst-EJB-Quick-compile

Finally I have managed to compile it.. Everything seems simpler after a Sunday rest and a good night sleep

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The import java.ejb.*; cannot be resolved