Home > Articles

📄 Contents

  1. Using WebLogic with JBuilder
  2. Using IBM WebSphere with JBuilder
  3. Summary
This chapter is from the book

This chapter is from the book

Using IBM WebSphere with JBuilder

The IBM WebSphere software platform for e-business is a comprehensive set of award-winning, integrated e-business solutions. It's a software platform based on industry standards—making it flexible and pluggable, which can allow you to adapt on-the-fly as markets shift and business goals change. Building on this robust platform, you can integrate diverse IT environments to maximize current investments, deliver core business applications to the Web, grow these applications to meet changing needs and increasing demand, and create a differentiated e-business that sets your business apart from the competition. As we look at the integration between JBuilder, we will look at the following key elements for using the best-of-breed IDE:

  • Installing WebSphere

  • Configuring JBuilder for WebSphere

  • Developing servlets and JSPs

  • Developing EJBs

  • Deploying your application components

  • Debugging

Installing WebSphere

IBMWebSphere is delivered in three different versions: Standard, Advanced, and Enterprise. When developing with JBuilder for the WebSphere platform, working with the Advanced Single Server Edition installed locally on your development workstation is advantageous.

NOTE

For consistency throughout this chapter, we suggest you install IBM WebSphere within c:\WebSphere.

Configuring JBuilder with WebSphere

JBuilder supports a wide variety of different application servers, WebSphere being one of them. To have JBuilder properly communicate with these environments, you must configure JBuilder to recognize them. When an application server environment is selected, JBuilder then configures the features, code generators and wizards, command-line utilities, class paths, and deployment and runtime options for the vendor's specific implementation requirements. We will use this application server for building our application; however, the same principles apply regardless of the application server brand or versions selected. To access JBuilder's configuration of application servers, enter the editor by choosing Tools, Configure Servers from the menu (see Figure 27.8) and enable the application servers you want to use within JBuilder. This is not a one-time setup for each developer's login, but you can change these parameters by reentering the editor anytime.

To enable the desired application server, select it in the list on the left and click the Enable server check box for that application server configuration. You now have full access to the features available within the given application server. For example, if you choose an application server that does not support EJB 2.0 Entity Beans, it will not allow you to build 2.0 Entity Beans within your application.

Figure 27.8Figure 27.8 Application server setup within the JBuilder environment for WebSphere integration.

WebSphere 4.0 is not specifically supported within the JBuilder environment but can easily be configured to work. The following steps set up WebSphere 4.0 within the JBuilder environment:

  1. Click Tools, Configure Servers.

  2. Select WebSphere Application Single Server 4.0.

  3. Click the Enable Server check box.

  4. Enter the following properties for the WebSphere Application Server:

  5. Property

    Value

    Home directory

    c:/WebSphere/AppServer

    Main class

    com.ibm.ws.bootstrap.WSLauncher

    VM parameters

    --Xms17m -Xmx128m -Xminf0.15 -Xmaxf0.25
    -
    Djava.library.path="/WebSphere/AppServer/bin;/WebSphere/
    AppServer/java/bin;/WebSphere/AppServer/java/jre/bin;/

    DB2/bin;/DB2/lib"
    -Dws.output.encoding=console
    -Djavax.rmi.CORBA.UtilClass=com.ibm.CORBA.iiop.Util
    -Dcom.ibm.CORBA.iiop.noLocalCopies=true Dws.ext.dirs="/WebSphere/
    AppServer/java/lib;/WebSphere/
    AppServer/classes;/WebSphere/AppServer/lib;/WebSphere/
    AppServer/lib/ext;/WebSphere/AppServer/web/help"

    Server parameters

    -com.ibm.ejs.sm.server.AdminServer -bootFile /WebSphere/AppServer/bin/admin.config -nodeRestart

    Working directory

    c:/WebSphere/AppServer/bin


Using Servlets and JSPs with WebSphere

When using JBuilder, the IDE isolates the differences between the application server containers within its wizards. For example, the process for creating JSPs and servlets is exactly the same as that of BES, with one exception. This exception is to specify which container will supply the necessary services for implementation. The following steps are necessary to create a BEA JSP and servlet project:

  1. Select File, New, Project tab from the Object Gallery.

  2. Choose Project.

  3. In the Project Wizard—Step 1 of 3, specify the project name and other important properties.

  4. Select Finish.

  5. Choose Project, Project Properties.

  6. Select the Server tab.

  7. NOTE

    JBuilder not only allows for development and deployment to multiple application servers, but also allows for a mixing of service providers across the same project.

  8. Select the WebSphere Application Advanced Single Server 4.0 in the combo box.

  9. Compile and save your project.

All other processes for creating JSPs and servlets are exactly the same.

The following process is used to create a Web application using WebSphere Application Server:

  1. Create a Web application by selecting File, New, Web tab in the Object Gallery.

  2. Select a Web application. Make sure to choose the check box Generate WAR.

  3. Click File, New, Web tab in the Object Gallery.

  4. Select the JavaServer page.

  5. Compile and save the project.

  6. Right-click on the JSP and select Web Run using <name>.jsp.

Developing EJBs with WebSphere

Each Enterprise Bean you create must belong to a JBuilder EJB module. The restriction with developing the EJB module for IBM WebSphere is that you will not be able to use EJB 2.0. An EJB module is a logical grouping of one or more Beans that will be deployed in a single JAR file, using IBM WebSphere only using EJB 1.x Beans.

Developing Session Beans

To create an EJB 1.x module and build some Session Beans within the module, follow these steps:

  1. Create an EJB module within a project. The restriction placed on your project by IBM WebSphere requires the EJB module to be version 1.x (see Figure 27.9).

  2. Figure 27.9Figure 27.9 Building an EJB module with JBuilder for IBM WebSphere.

  3. To create a Session Bean, select File, New. Select the Enterprise tab and choose Enterprise JavaBean 1.x (see Figure 27.10).

  4. Click Next, which assigns the existing EJB module (see Figure 27.11).

  5. Figure 27.10Figure 27.10 Select the Enterprise JavaBean 1.x from the Object Gallery.

    Figure 27.11Figure 27.11 Building a Session Bean with Enterprise JavaBean 1.x; Select EJB Module (Step 1 of 3).

  6. Assign the properties shown in Figure 27.12 to your Session Bean and click Next.

  7. View the package names and JNDI settings for your Session Bean and click Finish (see Figure 27.13).

  8. Figure 27.12Figure 27.12 Building a Session Bean with Enterprise JavaBean 1.x; Create a New EJB Component (Step 2 of 3).

    Figure 27.13Figure 27.13 Building a Session Bean with Enterprise JavaBean 1.x; assign JNDI names and other properties (Step 3 of 3).

  9. Add your business logic using the source created by the wizard.

Developing Entity Beans with WebSphere

Using BEA WebLogic or Borland Enterprise Server, you used the EJB 2.0 Designer for implementing Entity Beans. As noted earlier, IBM WebSphere supports only EJB 1.x, thus we must use the 1.x Entity Bean Modeler. The following process builds Entity Beans using IBM WebSphere:

  1. Select File, New and select the Enterprise tab within the Object Gallery.

  2. Select the EJB 1.x Entity Bean Modeler.

  3. Leave the default EJB module. The name should be WebSphere_Bean (see Figure 27.14). Click Next.

  4. Figure 27.14Figure 27.14 EJB 1.x Entity Bean Modeler (Step 1 of 7); Select EJB Module.

  5. Supply the connection information to the data source (see Figure 27.15). The following parameters use the JDataStore employee database:

  6. Property

    Value

    Drive

    com.borland.datastore.jdbc.DataStoreDriver

    URL

    -jdbc:borland:dslocal:C:\Development\JBuilder7\samples\ JDataStore\datastores\employee.jds

    Username

    Sample

    JNDI name

    EmployeeDataSource


    Figure 27.15Figure 27.15 EJB 1.x Entity Bean Modeler (Step 2 of 7); supply JDBC connection properties.

  7. This step allows you to select the tables from the database. The left panel shows the list of available tables for the database you selected in the previous window; the right panel shows the selected tables. The only table we will provide as an Entity Bean is Employee (see Figure 27.16).

  8. Figure 27.16Figure 27.16 EJB 1.x Entity Bean Modeler (Step 3 of 7); select tables to make an Entity Bean.

  9. Assign the columns to make available within the Entity Bean (see Figure 27.17). Make all the columns available to the Entity Bean.

  10. Figure 27.17Figure 27.17 EJB 1.x Entity Bean Modeler (Step 4 of 7); assign available columns to the Entity Bean.

  11. Specify the names and types of each property within the Entity Beans (see Figure 27.18). Leave the settings with the default values.

  12. Figure 27.18Figure 27.18 EJB 1.x Entity Bean Modeler (Step 5 of 7); supply the column types and names.

  13. Change the default package name to com.sams.websphere (see Figure 27.19). Although we are going to leave the remaining properties as the defaults, you can also change the names of any of the interfaces or change the JNDI names.

  14. Figure 27.19Figure 27.19 EJB 1.x Entity Bean Modeler (Step 6 of 7); supply the interface and package names.

  15. Assign the properties for the Entity Bean. These properties control the Bean's behavior when deployed. Leave all the properties with the defaults, except check Generate findAll() method in the home interface (see Figure 27.20).

  16. Figure 27.20Figure 27.20 EJB 1.x Entity Bean Modeler (Step 7 of 7); change the generation options for the deployed Bean.

Deploying Your Application

To run the Session Bean, open a project and then create an EAR file, deploy the EAR file, and restart WebSphere. To accomplish this task, JBuilder provides a number of tasks important in the process. At the time of project make, JBuilder runs the WebSphere compiler to generate the deployment descriptors and container-generated files. For the deployment of your JAR or EAR, right-click on your archive and select Deploy.

Debugging a WebSphere Application

WebLogic can be started remotely by providing the options –debugEnable-jdwpPort <Port #> to the startServer command. The following process enables you to debug your application:

  1. Start an MS-DOS window.

  2. Type C:\WebSphere\AppServer\bin\startServer –debugEnable –jdwpPort 5555. This starts your server in debug mode.

  3. Click Run, Configurations and select the Run tab.

  4. Click New and select the Debug tab.

  5. Enter the configuration name as Remote Debug WebSphere. Check Enable Remote Debugging.

  6. Click Attach in the Remote Settings panel. Enter the address of the debug port—for example, port 5555.

  7. NOTE

    The address specified here must be the same as the port number specified in the server as debug options. JBuilder opens a socket connection to the WebSphere server and attaches using the port number 5555.

  8. Set your breakpoints and debug your application.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020