...
- In the EJB Project. Under META-INF, Edit openejb-jar.xml and add the following
Code 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>
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
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>
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. |
- Export the projects to your local disk as StatelessSessionEJB.jar and ApplicationClient.war.
- Start the server and launch the Administrative console using http://localhost:8080/console/. Enter default username and password.
- In the welcome page, under Applications. Select Deploy New.
- Browse and Select StatelessSessionEJB.jar. Once done Select Install. This will deploy the EJB application on to server.
- Browse and Select ApplicationClient.war. Once done select Install. This will deploy the Web application on to server.
- Under Applications, Select Web App WARs and Run ApplicationClient project as show in the figure.
- Once done a welcome page will be launched.
- If you are New User. Select New User as shown in the figure
- This will display a new registration form. If you leave the mandatory username or password filed empty. You will get the following error message.
- Fill the fields as shown in the figure and Select Submit.
- Once done a page will be displayed from where you will be automatically redirected to login page to relogin.
- Enter the username and password as chosen by you during registration and select Login.
- The next page is the Apache Geronimo Resource Center.
- In case you give wrong username and password combination you will be redirected to login page.