- JBoss Enterprise Application Platform (EAP) 6
We have an application that was developed and deployed on Tomcat 7. Now we are trying to move the application to Jboss EAP 6, and very quickly realised that its not as simple as dropping war file into standalone/deployments folder.What do we need to do to make the war deployable into Jboss, without any issue?
- Convert the Tomcat-specific META-INF/context.xml file into it's JBoss equivalent. At minimum, this will involve setting up datasources, and adding a WEB-INF/jboss-web.xml file to map them into the Enterprise Naming Context.
1.1. See https://access.redhat.com/knowledge/docs/en-US/JBoss_Enterprise_Application_Platform/6/html/Administration_and_Configuration_Guide/chap-Datasource_Management.html for setting up datasource in JBoss
1.2. The jboss-web.xml file is like
<jboss-web> <resource-ref> <res-ref-name>jdbc/MyDatasource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <jndi-name>java:jboss/datasources/MyDatasource</jndi-name> </resource-ref> </jboss-web>
- Remove any J2EE specification jars from WEB-INF/lib
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.