...
This will build a jar and a war file and put them in the <cmp_home>/target folder. The jar created by the Maven build contains a JBoss specific deployment descriptor, the jboss.xml file in located the META-INF directory of the JAR is shown in the following example:
Code Block | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
<?xml version="1.0"?> <jboss> <enterprise-beans> <entity> <ejb-name>CustomerEJB</ejb-name> <jndi-name>CustomerHomeRemote</jndi-name> </entity> </enterprise-beans> </jboss> |
...
Running maven
will also build the a war file and put it in the <cmp_home>/target folder. The war created by the maven build contains a JBoss specific Web application deployment descriptor, the jboss-web.xml file in the WEB-INF directory of the WAR is shown in the following example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <jboss-web> <ejb-ref> <ejb-ref-name>ejb/CustomerHome</ejb-ref-name> <jndi-name>CustomerHomeRemote</jndi-name> </ejb-ref> </jboss-web> |
...
The following example shows the customer-ejb.xml deployment plan used for deploying the EJB application, this deployment plan in located in the <cmp_home>/dd directory.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar" xmlns:naming="http://geronimo.apache.org/xml/ns/naming" xmlns:security="http://geronimo.apache.org/xml/ns/security" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment" configId="CustomerEJB" parentId="geronimo/system-database/1.0/car"> <enterprise-beans> <entity> <ejb-name>CustomerEJB</ejb-name> <jndi-name>CustomerHomeRemote</jndi-name> <local-jndi-name>CustomerRemote</local-jndi-name> <resource-ref> <ref-name>jdbc/ibm-demo</ref-name> <resource-link>SystemDatasource</resource-link> </resource-ref> </entity> </enterprise-beans> </openejb-jar> |
...
The geronimo-web.xml deployment plan should look like the following example.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<web-app xmlns="http://geronimo.apache.org/xml/ns/web" xmlns:naming="http://geronimo.apache.org/xml/ns/naming" configId="EntityDemoWebApp" parentId="CustomerEJB"> <context-root>entity-ejb</context-root> <ejb-ref> <ref-name>ejb/CustomerHome</ref-name> <target-name>geronimo.server:EJBModule=CustomerEJB,J2EEApplication=null,J2EEServer=geronimo,j2eeType=EntityBean,name=CustomerEJB</target-name> </ejb-ref> </web-app> |
...