Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The import java.ejb.*; cannot be resolved

 
Nicolas Kal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Tom Kowalski
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have probably create J2SE project, and you should have J2EE. Then you can import ejb libraries without problem.
 
Nicolas Kal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 3918
10
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).

 
Nicolas Kal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic