When a Web Server is All You Need

If you are developing a web application using the Sun Java Studio Creator IDE, and the application does not use Enterprise JavaBeans technology, you might not really need the overhead of a full blown application server. If that is a case, consider using the Sun Java System Web Server 6.1 for your development phase. While it is true that you can war up your web application and deploy it to an application or servlet container, as shown in our deployment tutorials, the IDE also offers a one-step menu item, Deploy to Remote Server, that deploys your project to an instance of the Sun Java System Web Server and runs the web application in your browser. You might find the test-modify-redeploy cycle a bit faster and the memory consumption somewhat lower.

After downloading and installing the web server (don't forget to write down the User Id and Password that you entered), copy the following files to the web server's bin/https/jar folder.

  • If you plan to use web services, copy dom.jar and xercesImpl.jar from ide_install_dir//SunAppServer8/lib.

  • If you plan to use databases, copy ide_install_dir/SunAppServer8/lib/driveradapter.jar and then add the necessary driver files for your database server to the jar folder as well.

    Note: You can copy ide_install_dir/SunAppServer8/derby/lib/derbyclient.jar, but you cannot copy the other JDBC drivers because they are locked, so you need to obtain other drivers from the OEMs.

Start the Admin Server and open the web server's Admin Console typically, http://localhost:8888) in your browser. Select a web server (when you first install, there is just one) and click Manage.

  1. Click the Java tab.

  2. In the sidebar, click JVM Path Settings.

  3. If you will be using web services, enter the following in the Classpath Suffix field, using OS specific path separators and no line breaks:
    webserver_install_dir/bin/https/jar/dom.jar
    webserver_install_dir/bin/https/jar/xercesImpl.jar
    
    For example, on a Windows system, enter:
    C:/Sun/WebServer6.1/bin/https/jar/driveradapter.jar;C:/Sun/WebServer6.1/bin/https/jar/derbyclient.jar
    
  4. If you will be using databases, enter the following in the Classpath Suffix field, using OS specific path separators and no line breaks:
    webserver_install_dir/bin/https/jar/driveradapter.jar
    webserver_install_dir/bin/https/jar/yourdatabasedriver.jar
    
  5. Click OK in the JVM Path Settings tab.

  6. Click the Apply button in the top right corner of the Admin Console, and then click the Apply Changes button.

    When you applied the changes, the console should start the web server. If the web server was not started, click Manage and click Server On.

Now you are ready to set up the web server in the IDE.

  1. In the Servers window in the IDE, right-click Remote Deployment Servers, and choose Add Remote Server.

  2. For Server Type, choose Sun Java System WebServer 6.1.

  3. Set the Admin Host to localhost, set the Admin Port to 8888, and set the Username and Password to the values that you entered when you installed the web server (the ones you use when you start the Admin Console).

  4. Select the radio button for Data Sources Configured Automatically by JSCreator.

  5. Click OK. Hopefully, the node is added with a green badge.

That takes care of the setup. To test a web application using the Sun Java System Web Server, right-click the web application's node in the Projects window and choose Deploy to Remote Server > your web server from the pop-up menu.

Comments:

Somehow I don't get it: As stated in the posting, it's easily possible to warchive my app, use the (excellent) Sun AS as a webserver and deploy to it. If I don't use any EJB tech, there's not much overhead and hardly any configuration to be done.

The Sun AS is free however, while the webserver isn't (at least for production use). So why should I use a non-free webserver with equal or less functionality than a free appserver? I'd even lose the possibility to extend my app to use EJB later...

Posted by Henning on December 11, 2006 at 12:44 PM PST #

I agree that the bundled Application Server offers the easiest solution for developing and testing from the IDE. However, some people do not have machines with enough memory to handle both the IDE and the Application Server and report sluggishness. You are correct that deploying a war is simple enough, but when I am in the develop/test stage, the fewer clicks the better. Finally, the web server is free for the development stage, which is what this is all about. Last, you are not married to one server or the other. You can configure your IDE to use both servers and use the one that works best for the project at hand.

Posted by diva#2 on December 12, 2006 at 01:38 AM PST #

hi

Posted by guest on January 29, 2007 at 08:31 PM PST #

Post a Comment:
Comments are closed for this entry.
About

divas

Search

Archives
« August 2015
SunMonTueWedThuFriSat
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
     
Today