Server User Manual
Table Of Contents
- Developing Applications for J2EE™ Servers
- Contents
- Ch 1: Introduction
- Ch 2: Programming for the Java 2 Platform, Enterprise Edition
- Ch 3: Creating applications with J2EE technologies
- Ch 4: Configuring the target server settings
- Ch 5: Using JBuilder with Borland servers
- Configuring Borland servers in JBuilder
- Making the ORB available to JBuilder
- Configurations, partitions, partition services, and J2EE APIs
- Starting the configuration or server
- Remote deploying
- Remote debugging
- Web module workarounds
- Displaying the Borland Management Console in JBuilder
- International issues
- Borland servers and JDataStore 7.0
- Ch 6: Using JBuilder’s CORBA tools
- Ch 7: Using JBuilder with BEA WebLogic servers
- Ch 8: Using JBuilder with IBM WebSphere servers
- Ch 9: Using JBuilder with JBoss servers
- Ch 10: Using JBuilder with Tomcat
- Ch 11: Editing J2EE deployment descriptors
- Ch 12: Integrating with Enterprise Information Systems
- Ch 13: Building J2EE modules
- J2EE modules
- Setting module build properties
- Adding custom file types
- Sample build scenarios
- EJB JAR without any bean classes
- EJB JAR with custom files
- EJB JAR without EJB designer XML descriptors
- WAR with custom descriptor(s) in the WEB-INF directory
- WAR without any classes
- WAR with custom class filters
- WAR with custom file types
- EAR with custom files
- RAR with classes and dependencies
- Application client module with classes and dependencies
- Improving module build performance
- Index
Chapter 10: Using JBuilder with Tomcat 97
Running your servlet or JSP with Tomcat
Changing Tomcat’s port number
Occasionally, you may run into a problem where the default port number assigned to
your web server (typically 8080) is in use by another application. You can reassign the
port number, or simply instruct JBuilder to search for an unused port. (In a typical
installation, this is set as the default.)
To change Tomcat’s port number,
1 Choose Run|Configurations and select the runtime configuration for your web
application. Choose Edit.
2 Choose the JSP/Servlet Service in the tree on the lower left side of the Edit Runtime
Configuration dialog box.
3 Enter the port number the web server should listen to in the Port Number field.
4 Choose the Search For Unused Port option to tell JBuilder to choose another port if
the specified one is in use. (The port is only searched for the first time a web run is
requested.) It is useful to select this option when you are running more than one
servlet or JSP, as otherwise you might get a message that the port is busy. It is also
useful to check this option in the event that a user problem brings the web server
down. With this option selected, you will be protected if the web server is not shut
down properly. This option works in conjunction with the Web View options on the
Web page of the Preferences dialog box when the specified port is in use by a non-
web process.
Creating a custom server.xml file with Tomcat
Typically, when you run your web application using Tomcat in the JBuilder IDE,
JBuilder creates a
serverXXXX.xml file (where XXXX is the port number Tomcat is
listening to) and deletes it when you shut down Tomcat. You can edit the file and force
JBuilder to keep it.
To create a custom
server.xml file,
1 Run your web application in JBuilder as you normally would.
2 Go to your project’s Tomcat\conf directory while Tomcat is running. This folder is
created by JBuilder when your web application is running.
3 Make a copy of the conf directory in a temp directory.
4 Open serverXXXX.xml in the conf directory in a text editor.
5 Remove the second line of the file:
<!--This comment marks this file as generated, so it may be deleted and
regenerated at any time. To preserve manual changes to this file, delete
this comment.-->
With this line removed, JBuilder will not automatically delete the file when you stop
the server.
6 Make other changes to the server configuration file as needed. (Save the file and
leave it open in the editor.)
7 Go back to JBuilder and shut down Tomcat.
8 Save the edited file to the copy of the conf directory.
9 Copy the conf directory back to your project’s Tomcat directory.
10 Restart the web server and your web application.
Now, when you re-start the web application and the web server, your edited
serverXXXX.xml file will be used instead of an auto-generated one.