When a Web Server is All You Need
By divas on Dec 05, 2006
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.jarand 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.
- Click the Java tab.
- In the sidebar, click JVM Path Settings.
- 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.jarFor example, on a Windows system, enter:
- If you will be using databases, enter the following in the Classpath Suffix field, using OS
specific path separators and no line breaks:
- Click OK in the JVM Path Settings tab.
- 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.
- In the Servers window in the IDE, right-click Remote Deployment Servers, and choose Add Remote Server.
- For Server Type, choose Sun Java System WebServer 6.1.
- 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).
- Select the radio button for Data Sources Configured Automatically by JSCreator.
- 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.