• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 924
1
Netbeans IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
gurpeet singh
Ranch Hand
Posts: 924
1
Netbeans IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 924
1
Netbeans IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 924
1
Netbeans IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Jeanne alot. have a nice day
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic