• 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
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

How tu re use EJB with a war project

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

I implement EJBs 3.0 classes and packaging them in a jar file. I don't want to use a EAR project.
So I develop an web project in a war file.
But i want to use the EJB in this new project, so i imported the EJB's project like a library ( with maven )

mvn install:file ....


but when i deploy there is an error because glassfish consider that the EJB's project is already deployed.

Is there a solution to import an EJB's project with maven ?

Do it must packaging all in EAR project ?
But how use EJB in an another project ?

so many questions ...

Do you have a link with explications to packaging with many independant EJB.

Thanks
Olivier / paris ;=)
 
author & internet detective
Posts: 40487
823
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
Olivier,
If you pack them in an ejb jar instead of a regular jar, they are part of the ear and you can reuse them by copying the jar into different ears.
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you need to install EJB into maven, you need to use EJB packaging as Jeanne has mentioned. Too add dependency of that EJB in your maven project, you can do this.


And you need to package them in as an EAR in order to use both EJB and WAR together. EJB 3.1 will fix this issue, though.
 
Thiebaut olivier
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,

 
Poop goes in a willow feeder. Wipe with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic