Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How tu re use EJB with a war project

 
Thiebaut olivier
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • 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 ;=)
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33696
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic