...
- In the EJB Project. Under META-INF, Edit openejb-jar.xml and add the following
Finally the openejb-jar.xml will look like thisCode Block title datasource dependency borderStyle solid <sys:dependencies> <sys:dependency> <sys:groupId>console.dbpool</sys:groupId> <sys:artifactId>jdbc%2Fuserds</sys:artifactId> </sys:dependency> </sys:dependencies>
Code Block Info title Where did the above dependencies come from?? To make the datasource visible to EJB we need to add a dependency to the EJB deployment plan that is title . The above element can be obtained automatically from Geronimo Database Pool wizard. Select usage against the database pool jdbc/userdsopenejb-jar.xml borderStyle solid <?xml version="1.0" encoding="UTF-8"?> <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.2" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> <sys:environment> <sys:moduleId> <sys:groupId>default</sys:groupId> <sys:artifactId>StatelessSessionEJB</sys:artifactId> <sys:version>1.0</sys:version> <sys:type>car</sys:type> </sys:moduleId> <sys:dependencies> <sys:dependency> <sys:groupId>console.dbpool</sys:groupId> <sys:artifactId>jdbc%2Fuserds</sys:artifactId> </sys:dependency> </sys:dependencies> </sys:environment> <enterprise-beans/> </openejb-jar>
Info title Where did the above dependencies come from?? To make the datasource visible to EJB we need to add a dependency to the EJB deployment plan that is openejb-jar.xml. The above element can be obtained automatically from Geronimo Database Pool wizard. Select usage against the database pool jdbc/userds
- In the WEB Project. Under WEB-INF, Edit geronimo-web.xml and add the following
Finally the geronimo-web.xml will look like thisCode Block title EJB dependency borderStyle solid <sys:dependencies> <sys:dependency> <sys:groupId>default</sys:groupId> <sys:artifactId>StatelessSessionEJB</sys:artifactId> <sys:version>1.0</sys:version> <sys:type>car</sys:type> </sys:dependency> </sys:dependencies>
In the WEB Project. Under WEB-INF, Edit geronimo-web.xml and add the followingCode Block title geronimo-web.xml borderStyle solid <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"> <sys:environment> <sys:moduleId> <sys:groupId>default</sys:groupId> <sys:artifactId>ApplicationClient</sys:artifactId> <sys:version>1.0</sys:version> <sys:type>car</sys:type> </sys:moduleId>
Code Block title EJB dependency borderStyle solid <sys:dependencies> <sys:dependency> <sys:groupId>default</sys:groupId> <sys:artifactId>StatelessSessionEJB</sys:artifactId> <sys:version>1.0</sys:version> <sys:type>car</sys:type> </sys:dependency> </sys:dependencies> </sys:environment> <context-root>/ApplicationClient</context-root> </web-app>
- Right click the ApplicationClient Project and select properties. Select Java Build Path->Projects. Click add and add Stateless Session EJB. This is required for the compilation of the Clien Client code.
Deploy and Run
Warning | ||
---|---|---|
| ||
Due to limitation with Geronimo Eclipse Plugin, you will have to export the Stateless Session EJB project and Web Application project as a jar and war respectively. |
...