Ear approach
You can simply paste it into the Tomcat Webapps / directory and it will be raised.
Ear example (valid):
myapplication.ear
lib/
lib/libraryOne.jar
lib/libraryTwo.jar
redEjbs.jar
blueEjbs.jar
General error (invalid):
myapplication.ear
libraryOne.jar (err. not a javaee module)
libraryTwo.jar (err. not a javaee module)
redEjbs.jar
blueEjbs.jar
Only Java EE modules are allowed in the root directory. These are EJB banks, .war files, Connector.rar files, and Application Client banners. Prior to Java EE 5, libraries must be explicitly specified in the application.xml file. Java EE 5 and forward, they can be added to the lib / directory, and they can be understood as simple banks, and not for the Java EE module.
Collapsed EAR Approach
OpenEJB/Tomcat . Java EE 6.
mywebapp.war
WEB-INF/lib/libraryOne.jar
WEB-INF/lib/libraryTwo.jar
WEB-INF/lib/redEjbs.jar
WEB-INF/lib/blueEjbs.jar
, :
mywebapp.war
WEB-INF/lib/javax.ejb.jar (err. clashes with the related system library)
WEB-INF/lib/libraryOne.jar
WEB-INF/lib/libraryTwo.jar
WEB-INF/lib/redEjbs.jar
WEB-INF/lib/blueEjbs.jar
, , .
, :
tomcat/lib/libraryTwo.jar
mywebapp.war
WEB-INF/lib/libraryOne.jar
WEB-INF/lib/redEjbs.jar
WEB-INF/lib/blueEjbs.jar
, . libraryTwo.jar libraryOne.jar, , Tomcat "lib" "webapp", Two.jar . , vm , , , . bean .