Deploying Web Applications to Sun Java System Web Server 7.0 With NetBeans 6.0

   
 
 
By Ajay Acharya, Mukesh Garg, and Marina Sum, January 23, 2007; updated: June 18, 2007 and January 7, 2008  

You can develop, deploy, and debug Web applications that are based on the Java 2 Platform, Enterprise Edition 5 (Java EE 5 platform) with NetBeans 6.0, an integrated development environment (IDE). A plug-in for Sun Java System Web Server 7.0 (henceforth, Web Server 7.0) is available as open source in NetBeans 6.0.

Note: The Web Server 7.0 plug-in for NetBeans 5.0 supports the J2EE 1.4 platform only, not the Java EE 5 platform.

This article describes how to install and use that plug-in in NetBeans 6.0 to develop and deploy Web applications to Web Server 7.0.

Note: The topic of Web application projects in NetBeans is outside the scope of this article. For details, see NetBeans online help.

 

Contents
 
Installing Web Server 7.0 Plug-In
Registering Web Server 7.0
Starting Administration Server
Creating and Deploying Web Applications
Debugging Web Applications
Addendum: Web Server 7.0 Capabilities Supported by NetBeans 6.0
References


 
Installing Web Server 7.0 Plug-In

To install the Web Server 7.0 plug-in, first install the Java 2 Platform Standard Edition Development Kit and then the NetBeans 6.0 IDE.

Tip: To ensure access to the NetBeans IDE, Web Server 7.0 must be owned and installed by the same user who runs the NetBeans IDE.

Afterwards, do the following:

  1. Launch the IDE.
  2. In the main menu, choose Tools > Plugins.

    The Plugins manager is displayed.
  3. Click the Settings tab and the Proxy Settings button.

    The Proxy Configuration Properties dialog box is displayed.
  4. Set the proxy settings as desired and close the dialog box.
  5. Click the Available Plugins tab.
  6. Select the Sun Java System Web Server 7.0 module. Click Install and then Next.
  7. Select the radio button for "I accept the terms in all of the license agreements" and then click Install.

    The Plugins manager downloads the plug-in into the IDE.
  8. Click Next when the download is complete.

    The View Certificates and Install Modules pane is displayed.
  9. Click Finish.

You have now installed the Web Server 7.0 plug-in in the NetBeans IDE.

Registering Web Server 7.0

Note: Though several screen shots in the rest of this article show NetBeans 5.0, they also apply to NetBeans 6.0.

Next, register Web Server 7.0 in NetBeans 6.0. Follow these steps:

  1. In the Runtime tab, select the Servers node and then right-click and choose Add Server from the context menu.

    The Add Server Instance wizard is displayed. See Figure 1.

    Figure 1: Choose Server Pane in Add Server Instance Wizard
    Figure 1: Choose Server Pane in Add Server Instance Wizard
     
  2. Under Server, select Sun Java System Web Server 7.0. Click Next.

    The Server Location and Configuration pane is displayed. See Figure 2.

    Figure 2: Server Location and Configuration Pane in Add Server Instance Wizard
     
  3. Fill in the details on the Web Server 7.0 instance on your local machine or any remote machine.

    Note: For some of the Web Server 7.0 JAR files, even if you are registering only a remote instance, the plug-in needs a local Web Server 7.0 instance on the same machine.

If your Web Server 7.0 instance contains multiple configurations, when you first open its node in NetBeans 6.0, a dialog box with a drop-down list of the configurations that contain at least and at most one virtual server and one associated instance is displayed. See Figure 3. You must select one of those configurations for deployment from the IDE. This is a one-time selection only.

Figure 3: Selection of Configuration for Deployment
 
Starting Administration Server

After registration, the Sun Java System Web Server 7.0 node is displayed under Servers in the Runtime tab of the IDE. To start the Administration Server, right-click the Sun Java System Web Server 7.0 node and choose Start from the context menu. See Figure 4.

Note: You cannot start the Administration Server if the server was registered as a remote server.

Figure 4: Start Menu Item for Administration Server of Web Server 7.0
Figure 4: Start Menu Item for Administration Server of Web Server 7.0
 

You can expand the nodes to view all the Web applications, resources, and so forth in a configuration. Figure 5 is an example.

Figure 5: Components in a Web Server Configuration
 
Creating and Deploying Web Applications

To create a Web application for Web Server 7.0, follow these steps:

  1. Choose File > New Project and then select Web under Categories and Web Application under Projects. Click Next.

    The Name and Location pane in the New Web Application wizard is displayed. See Figure 6.

    Figure 6: Name and Location Pane in New Web Application Wizard
    Figure 6: Name and Location Pane in New Web Application Wizard
     
  2. Under Server, choose Sun Java System Web Server 7.0 from the drop-down list.
  3. Click Next and proceed to create the Web project.

    Once you've created the project, its node is displayed in the Projects tab. Figure 7 shows an example.

    Figure 7: New Web Application Project
    Figure 7: New Web Application Project
     

You can see that all the basic files are in place, including the Web Server 7.0-specific deployment descriptor, the sun-web.xml file. To edit that file, double-click its name to open a GUI editor on the right. Alternatively, right-click its name and choose Edit from the context menu.

The Web application project is now ready: You can edit, compile, and deploy it to Web Server 7.0. You can also run or debug the application from the IDE.

Debugging Web Applications

You can debug Web applications by right-clicking the Web project in the IDE and choosing Debug from the context menu. Web Server will then start in debug mode and the IDE will stop executing the program at the breakpoint you have set in your application.

For details on debugging Web applications in NetBeans 6.0, see the IDE's online help.

Addendum: Web Server 7.0 Capabilities Supported by NetBeans 6.0

Following are the Web Server 7.0 operations you can perform in NetBeans 6.0 with the plug-in installed:

  • Start or stop the Administration Server. 1
  • Launch the Administration Console.
  • View the logs for the Administration Server and the server instance associated with a configuration. 1
  • View the server.xml file of the server instance. 1
  • Set breakpoints and debug the Web applications deployed on Web Server 7.0.
  • List all deployed Web applications.
  • Disable or enable Web applications.
  • Undeploy Web applications.
  • List all server resources: Java Database Connectivity (JDBC) resource, mail resource, custom resource, external Java Naming and Directory Interface (JNDI) resource.
  • Delete server resources.
  • List resource properties from a resource's context menu. You can also update those properties from the IDE.
  • From the Web project, create a new server resource (mail, JDBC, custom, or external JNDI) in the IDE's New File wizard by selecting the Web Server 7.0 resources category. Afterwards, register the new resource with the Web application's target Web Server 7.0 instance.

    For details on creating and registering server resources, see NetBeans IDE online help.
  • List, update, or do both on the Java virtual machine properties. For the update to take effect, you must restart Web Server 7.0.

1 This capability is not available for the remote server.

References
Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
JavaOne Banner Java 8 banner (182)