• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB 3.0 in Action examples in Eclipse

 
Ismael Upright
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,

I have a problem with opening the source code of the examples from the book "EJB 3.0 in Action" in Eclipse.

I've installed Java EE. I've also installed JBoss and Ant as it is described in the pdf document delivered with the examples. I had no problem with building and installing the first example - it was a matter of setting some environment variables and simply typing "ant" in the directory with example. It seems that it works.

Now I would like to go to my Eclipse and open the source code. And here the problem begins.... I tried to create some new project but there's nothing like "EJB 3.0 Project" to choose...

I think that also the big problem is that there are quite a lot of files, even in first examples, and I don't really understand why all of them are needed and what for. There is also some action that has to be done before deploying any example - setting some kind of resources... Okay I did that but I don't know what I really did and why it was necessary... In the book it was written that creating EJBs in version 3.0 is very simple and that there are only plain java classes. I don't see that simplicity in the examples... I feel very confused.....
 
Sergio Tridente
Ranch Hand
Posts: 329
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is, do you really need to setup and use eclipse?

So far, I have done all my testing with a text editor (with syntax highlighting), ant and the console. And I have to say that for me that seems easier (and less exam diverting) than using an IDE (which you have to setup).

If your goal is to study for the exam, then think about this.
 
Ismael Upright
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tip. But in my daily job I will use Eclipse rather than the text editor - that's why I'd like to know what do I have to do to make an EJB project there.

Can anyone provide me with some instructions?
[ September 02, 2008: Message edited by: Ismael Upright ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This tutorial may help.
 
aleem khan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per my experience, using Eclipse adds more value to your cv rather than using text editors or some other editors
 
Sergio Tridente
Ranch Hand
Posts: 329
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not know we were talking CV here. What I tried to express with my answer was that for being able to pass the exam one needs to understand what is happening under the hood and what the "quite a lot of files" are needed for.

For me, using an IDE helps a lot with real life work (I also use IDEs myself for my daily job, so I am not discarding them at all) but that help is achieved by hiding some of the complexity. This is great unless you want or really need to understand about these complexities. I am on the opinion that for the exam it could be a good idea not to use an IDE, at least at the beginning and until you understand the details and the complexity hidden by the IDE.

Another reason why I gave the previous answer was that for compiling and executing "EJB in Action's examples" the only thing one needs is J2EE 5, an Application Server (my experience is that Glassfish would be the best choice) and ant. Evey example comes with its corresponding build.xml file for compiling, deploying and executing. It couldn't be easier.

What I have just written, of course, would not be a good advice if what one is trying to achieve is making his own CV more interesting. In that case an IDE would be great and JBoss would be the Application Server of my choice.

Studying for this exam requires paying attention to a lot of details. Having to set up your favourite IDE for your favourite Application Server is, in the worst of the cases, an unnecessary distraction.

My advice is still the same: if you plan to go for this exam, then focus on the many subjects of the exam.
[ September 02, 2008: Message edited by: Sergio Tridente ]
 
Ismael Upright
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe, thanks a lot for the link to the EJB Eclipse tutorial, I'm on my way to use it.
 
Ismael Upright
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sergio Tridente:
What I tried to express with my answer was that for being able to pass the exam one needs to understand what is happening under the hood and what the "quite a lot of files" are needed for.

For me, using an IDE helps a lot with real life work (I also use IDEs myself for my daily job, so I am not discarding them at all) but that help is achieved by hiding some of the complexity. This is great unless you want or really need to understand about these complexities. I am on the opinion that for the exam it could be a good idea not to use an IDE, at least at the beginning and until you understand the details and the complexity hidden by the IDE.


I think that I got your point now My goal is to understand what's under the hood and also to know how to use Eclipse to make EJBs code. Maybe I'll have to use both approaches.

About the approach with text editor only: it would be very useful to have any tutorial that will start creating some simple example code from absolutely scratch, like empty open text file, and describe totally EVERYTHING, like creating manually the EJB class(es), necessary XML files and also the ant build file. Like nothing that is magically ready since the beginning.

Do you know any tutorial like that?
 
Sergio Tridente
Ranch Hand
Posts: 329
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would advice you to read the book you bought, EJB in Action. Just read the book; don't rush, don't try to know everything from the beginning. After reading each chapter, practice with the book's example. Take a look at the code and try to apply the concepts you have studied so far. You don't even need to know ant to compile, deploy and run those examples. They just work.

With time, you'll get a fine level of understanding and then you will be able to create your EJBs from scratch. I don't know of any tutorial that will help you on this. Maybe Sun's J2EE 5 tutorial (the EJB part).

If you are interested in learning ant, then you could take a look at this tutorial. However, I don't think you need to have any knowledge of the tool to be able to run the boook's examples on your own. It is really straightforward if you respect the directory layout the book's examples propose.

Concentrate your effort on understanding EJBs.
 
Ismael Upright
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your advices and for calming me down a bit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic