Deploying an enterprise application using Hibernate on Virtual Application Pattern
arunsr3 1100007DJ0 Visits (4587)
Virtual application pattern (VAP) does not provide direct access to the IBM WebSphere administration console. Hibernate does requires a change to the classloader policy which can be easily updated using the IBM WebSphere administration console. To get around this, we will have to update the enterprise application settings directly prior to deploying the ear file through the IWD. This change can be done using IBM WebSphere Application Server toolkit (AST) to modify the application.xml.
Steps include the following: (Image #1)
Deploying enterprise application on IBM Workload Deployer
Using the IBM workload deployer, create a new blank virtual application application pattern for this sample application. You accomplish this by click the green "+" icon under the patterns tab with the name being "HiberTest".
After the virtual application pattern is created, you will need to open a blank canvas to create your instance topology. To do this, click on the "open" icon which will allow you to drag the necessary components to create your pattern. Drag the "Enterprise Application" and "Database" application components in the left window to the canvas and connect the two through an arrow. The pattern should look like in Figure 3.
The next step is to install the application ear, click on the enterprise application component , the right panel will refresh as seen in Figure 4. Name the application, select the application ear file to upload from your local hard drive. Leave the rest as default.
Now move on to the settings on the database component, click on the database component and see the pane on the right refresh as seen in figure 5. Enter the name of the database in the database name field. Select the schema file to be imported from your local hard drive into the Schema File field.
Click on the connector line(blue line) and see the panel on the right refresh as seen in figure 6. Enter the datasource name (created in the earlier step, see figure 4) in the JNDI field.
As seen in the Figure 7, click the save button on top left under Diagram tab to save your work into the pattern
Deploy the application on the cloud, go back to the main pattern page, as seen in Figure 2, locate the Deploy button on the top right side , click it and follow the screens to deploy the application. Once you have completed you will see a message in yellow as shown in Figure 8.
Click the click here link to monitor the progress of the deployment.
After the cloud deployment is completed, you should see the following on the screen as noted in Figure 9
Last step is to verify the application runs fine, click on the WAS endpoint URL, as noted in Figure 10
Upon clicking the endpoint url, the application will show the data entry form in the browser, as shown in Figure 11.
Enter the details as shown in Figure 11 and click submit. The application will read the values using the struts framework and then persist in the database using hibernate. A success page as in Figure 12 will be presented to the user. Note the contact id prefilled, this is the record id in the database.
Conclusion is we have successfully deployed a Virtual application pattern on the cloud and tested the application as shown in figure 11 and 12. We have exported the pattern along with the application artifacts,