I have created a EJB in ejb 2.1 and one web application which uses that ejb.
now is it possible to create a jar file and use it as library in my web application ? like we have struts jar file for struts framework. the same way i have a framework built in that ejb. so can i create a jar file and include it in my web application/WEB-INF/lib folder and use it ? and then create a EAR file for that web application and deploy it on application server(Web Logic) something like that ?
If it is possible what are the things which i need to take care. what contents(like ejb-jar.xml, weblogic-ejb-jar.xml) should go where ?
I am new to EJB
Joined: Dec 12, 2006
According to my findings and understanding...
1) i need to create jar file containing all the classes of EJB excluding the content of META-INF folder.
2) content of META-INF will go into Web Applications/META-INF/ directory.
But one more doubt, will ejb get deployed as this time it will be in WAR file inside EAR. instead of EAR directly.
An EJB client JAR can go in your web applications WAR file. This is the EJB client code only and most likely will depend upon the application server's client libraries as well.
The actual EJB JAR file is not part of the web application. This file is used to deploy the EJB in the application server.
Whether you use a EAR file or not depends upon your design. There are a few different ways to deploy an EJB component and a web component and there are different application server-specific traits that need to be considered as well.