• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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: 42006
911
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,

 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic