aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes how to create ActionBazaar application given in Manning Ejb 3 in action in eclipse juno ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "how to create ActionBazaar application given in Manning Ejb 3 in action in eclipse juno ?" Watch "how to create ActionBazaar application given in Manning Ejb 3 in action in eclipse juno ?" New topic
Author

how to create ActionBazaar application given in Manning Ejb 3 in action in eclipse juno ?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923
    
    1

hi,
I'm learning Ejb 3 from Manning Ejb 3 in action. i have just finished the introductory part and now the author is onto explaining various ejb 3 component types using ACTIONBAZAAR example. i would like to know how to create the example from eclipse. as i digged into eclipse juno, there were option to create EJB PROJECT, dynamic web project. under JavaEE category they have Application Client project, connector project, enterprise application project, utiltiy project.

i got confused and choose enterprise application project , but end result was that i was not able to understand the generated resources which were like this. there was a folder named EarContent, there was deployment desripter and when you expand it , there were bundled libraires and modules. i did not know how to proceed. please help me select correct project type so as to accomplish the ActionBazaar in ejb 3 in action by Manning. Regards


OCPJP 6(100 %) OCEWCD 6(91 %) OCPJBCD(93%)
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29253
    
139

It depends on what chapter you are in. In the early chapters, ActionBazaar is just a web project. In the later chapters, it is an Enterprise application. WHich means you need an enterprise application project first and then an ejb project and web project.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923
    
    1

Jeanne Boyarsky wrote:It depends on what chapter you are in. In the early chapters, ActionBazaar is just a web project. In the later chapters, it is an Enterprise application. WHich means you need an enterprise application project first and then an ejb project and web project.


thanks for the reply Jeanne. do you mean to say that i should create enterprise application project and INSIDE it i create new ejb project and web project ? am i right ?

also the generated resources in enterprise application project were folder named EARCONTENT, and Deployment descriptor----modules and Bundled Libraries

how am i supposed to use them ? Please help


also, was just playing around with eclipse and noticed a option EAR MEMBERSHIP - ADD PROJECTS TO EAR. does it mean that suppose i first create a ejb project like new > ejb project and then add this ejb project to an existing(but empty) EAR project. similarly i create web project and add it to EAR ? ?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29253
    
139

gurpeet singh wrote:thanks for the reply Jeanne. do you mean to say that i should create enterprise application project and INSIDE it i create new ejb project and web project ? am i right ?

No. They are separate projects in your Eclipse workspace. I meant that when you export the ear, the ejb/war files will be zipped up inside of it.

gurpeet singh wrote:ources in enterprise application project were folder named EARCONTENT, and Deployment descriptor----modules and Bundled Libraries

I don't have EARCONTENT in mine. Just start out with what the book gives you.
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923
    
    1

sorry for creating duplicate thread.

what i did is created a new entrprise application project, and then it gave me option to ADD MODULES. i added web module and ejb module. when i clicked on finished, it resulted in one Ear Project which i named ActionBazaar, one Web module ActionBazaarWeb, and ActionBazaarEjb. am i proceeding right ? if yes , then suppose i have to call my session bean( which is in ActionBazaarEjb) from a servlet in ActionBazaarWeb, then will i be able to call it , since they are two separate(but linked projects through EAR) projets in workspace ? guide me if am proceding in right direction ?


also i again created a new Enterprise application project in eclipse juno, and following is the artifact structure in the workbench

ActionBazaar
|
-------------Deployment Descriptor :ActionBazaar
|
|------------EarContent
|
|___meta-inf
|_application.xml


maybe we could rename EarContent, so that you may have different name. but this is the structure am getting when i do New > Enterprise Application Project

also i digged into eclipse help and it says that there is no source code in Enterprise Application Project( which eclipse also calls EAR project) and that it references other jee projects which can be application client projects, ejb modules, web modules.


actually i'm in the early stages of book, but the book didn't mentioned which project to create. it simply gave a session bean source code and a servlet source code. i want to try the example at the earliest in Eclipse. so i would like to know which project to create. my friend told me that i can create a web project and in it add session bean . is it a possible ?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29253
    
139

You are on the right track. There isn't supposed to be source code in the ear itself, so you are correct there as well.

Since the web project has the ejb project in it's classpath, the servlet can in fact call the ejb.

Do not put the session bean in the web project. This is incorrect. EJBs belong in an ejb jar. Which is an ejb project in eclipse.
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923
    
    1

thanks Jeanne alot. have a nice day
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to create ActionBazaar application given in Manning Ejb 3 in action in eclipse juno ?
 
Similar Threads
sample application in EJB 3 in Action
Persistence Unit Scoping
Eclipse and EAR projects
Which book is best EJB in Action or EJB 3 by oreliy??
EntityManager in Servlets Doubt