![]() |
Developers familiar with WebSphere Application Enterprise Server (WAS), version 4.0 and can deploy their applications using WAS in Pramati Studio. Studio provides tight integration with WebSphere 4.0.
Studio creates the required deployment descriptors while the application is being developed and keeps the application in a ready-to-deploy state. To deploy applications on local server, Studio provides support for:
This chapter discusses how to develop EJB 1.1 applications in Studio and deploy them on WebSphere.
To develop applications in Studio and test-deploy them on WebSphere 4.0, configure WebSphere deployer in Studio. Select Tools > Configure from the main menu and select WebSphere Deployer.
Multiple instances of WebSphere server can be created in Studio and each configured Server instance has a tab in the output panel.
To create an instance for WebSphere server, select Tools > Server Configuration from the main menu and click New. In the Add New Server dialog, enter the following information:
Press OK to create a server instance. Configure the following properties in the Server Configuration panel:
Click OK to add the instance of the WebSphere Server. To delete a server instance, select the required server from the field, Server Name and use the Delete button.
Select WebSphere server instance from the server box in the status bar to make it the current server. All server specific operations for the active desk is performed on the current server.
Use Tools > Start Server to start the Server. To stop server, use Tools > Stop Server from the main menu. The server can also be started and stopped using the signal box.
The Deploy option, available on a right click on the desk root is disabled when WebSphere server is selected. The options to deploy a desk in WebSphere are:
To update the modules on the server, right click on the module root and select Deploy.
An attempt to deploy a module without deploying the desk as an EAR, displays a message, prompting the user to deploy the desk as an EAR.
For the server to pick a new module as a part of the archive, the desk should be deployed again as an EAR.
Applications are deployed using SEAppInstall utility of WebSphere. For more information, read WebSphere documentation.
A desk can be deployed as an EAR, using the Deploy as EAR option, available on a right click. WebSphere specific XMI files are generated by Studio, automatically. These files contain information such as binding, finder descriptors. These details are placed in appropriate places at all levels in the EAR, and the desk is deployed as Desk_DeskName.ear where DeskName is name of the current desk.
If the EJB module in the desk contains CMP beans, WebSphere generates required mapping files, such as map.mapxmi and schema.dbxmi. These files contain the CMP mapping information, created by top down mapping method used by WebSphere. The table name and database column names present in these files are based on the CMP names and their respective field names.
To map the CMPs to existing tables, modify the files by entering the correct table and data base column names. This method is known as middle-in-between mapping and is performed by Studio, automatically. Post mapping, EJB deploy utility is used to generate deployment code.
A module can be deployed as a separate application as ModuleName. Right click on the module, select Deploy or Export module as an Archive and Deploy.
To deploy a web module:
Ensure that SOAP connector is set as JMX connector type.
For remote deployment, go to <WebSphere install-dir>\wasUploadEAR. Deploy pramatiFileUpload.ear in remote WebSphere server using WebSphere administration console.
In Studio, export the module as archive and deploy.
For local WebSphere server, all log messages are displayed in the output panel. Log messages for remote server cannot be viewed in Studio but it is available on remote WebSphere administration console.
The resources created using Resource Tool, are not added to the WebSphere server by Studio. Resources with identical details should be bound to the server using WebSphere administration console. For CMP 1.x, add Datasource Type as Datasource V4.
For details on adding a datasource, read WebSphere documentation.
CMP 1.1 beans require finder queries to define the finder methods. These queries can be created while creating the bean using Query Wizard, or in the Bean Properties panel before deployment. Studio interprets this query and writes WAS specific query in the deployment descriptor.
The query should not use any table other than the bean table for which the query is being written.
Developing applications in Studio creates archives and modules with Pramati XML files. Deploying a desk, creates an archive and makes a copy of this archive in the directory, <install_dir>\wasEar\ejbdeploy. The XMI files are stored in this archive and the archive is deployed. The archive is then in a ready-to-deploy state on WebSphere server from outside Studio.
CheckingHome home = (CheckingHome)ic.lookup("java:comp/env/ejb/Checking");
Object ob = home.findById(<id>);
Checking account = (Checking)PortableRemoteObject.narrow(ob, Checking.class);
If Studio is unable to connect to server, check:
| Pramati Technologies © Copyright |
|