• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

The import java.ejb.*; cannot be resolved

 
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!
 
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.
 
Bartender
Posts: 4108
72
Hibernate Fedora Chrome
  • 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:

https://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!
 
Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic