Netscape Enterprise Server and Fasttrack Server 3.0/3.01
Notes for Java Programmers
The 3.0/3.01 versions of the Netscape web servers (Netscape Enterprise Server
and Netscape FastTrack Server) include a Java runtime environment
that lets you deploy Internet and intranet ready applications. Using Java
on a Netscape web server, you can deploy applications to serve many purposes,
such as database access, corporate intranet publishing, and electronic
commerce. Your server-side Java applications are automatically portable,
regardless of whether the server is running on a Unix or Windows system.
If you want to run a Java application on the 3.0/3.01 versions of the
Netscape Enterprise Server or Netscape FastTrack Server, you should
read this document. It provides information not covered in other Netscape
documents, as well as links to other documents containing relevant information.
CONTENTS
Using Java in Netscape Web Servers
Getting Started
Netscape's Java Runtime Environment
Class Libraries
Included with Netscape Web Servers
Sample Code
Limitations
Appendix A: Classes Included and Supported
Appendix B: Classes Included But Not Supported
Appendix C: Additional Classes Included But Not
Supported
Copyright Notice
USING
JAVA IN
NETSCAPE
WEB
SERVERS
There are three different ways to run Java applications on Netscape Enterprise
Server 3.0/3.01 and Netscape FastTrack Server 3.01.
- You can use the Web Application Interface (WAI) for developing Java
applications (you cannot use WAI with applets). See
Writing Web Applications with WAI
for information about
-
the interface definitions that facilitate WAI programming
-
examples that use the interfaces
- You can use the LiveConnect facility. If you are writing your
application using both Java and JavaScript, see Writing Client/Server JavaScript Applications
for information about using JavaScript and Java concurrently.
- Although this option is not recommended, you can use the server side
applet (HttpApplet) interface and classes provided with Enterprise Server
2.0 for server-side Java programs. They are deprecated but are still supported
for backward compatibility. Netscape does not plan further development
on them; equivalent functionality is available to you through LiveConnect.
The classes are documented in the book Programmer's Guide, Netscape
Enterprise Server Version 2.0, (for Unix
or for NT).
Netscape also plans to support Servlets in a future release.
GETTING
STARTED
This section contains information about configuring your environment, compiling
Java classes, and executing your Java program for Netscape web servers.
The information in this section pertains to Java via the LiveConnect facility
or the HttpApplet interface only. For Java via WAI, please see
Writing Web Applications with WAI..
CONFIGURING
YOUR
ENVIRONMENT
The installation process of the 3.0/3.01 versions of Netscape web servers
(Enterprise Server and FastTrack Server) makes the standard Java
classes available to you (packaged in the file serv3_0.zip) on
the path
<server root>/plugins/java/classes/serv3_0.zip
where <server root> is the directory in which you installed
the server. This file is placed automatically in the list of places that
the Java runtime engine looks for classes when trying to load a class.
In addition, the server looks for class files in the directories
<server root>/plugins/java/local-classes/
and
<server root>/plugins/java/applets/
The server also searches for classes in the directories specified in
the CLASSPATH environment variable (of the user that the server
is running as, or of the System section in the environment variables
part of Control Panel on Windows machines). Please note that when using
the CLASSPATH, this environment variable needs to be set before
the server is started, and in the environment that the server is started.
On Windows systems, if the CLASSPATH is set in the System section
of the environment variables part of Control Panel, you may need to reboot
the machine before the new CLASSPATH is visible to the server.
COMPILING
JAVA
CLASSES
Netscape's Java implementation on Enterprise Server and FastTrack Server
3.0/3.01 is a deployment
environment, not a development environment. It includes a Java virtual
machine and some of the Java classes from the Sun JDK 1.1. It does not
include an Integrated Development Environment (IDE), nor does it include
the JDK 1.1 compiler (javac), the Java command-line interpreter
(java), or the Java debugger (jdb). You can compile your
custom-developed classes using any development environment which is compatible
with JDK1.1.
EXECUTING
YOUR
JAVA
PROGRAM
To run a Java program via the HttpApplet interface on the Enterprise Server
or FastTrack Server 3.0/3.01, you must activate the Java runtime engine.
You can do this from your Server Manager by following these steps:
-
Click Programs and then choose the Java link.
-
At the prompt "Activate the Java interpreter?", click Yes and then click
OK.
-
In the "Java applet directory" field, specify the directory containing
your Java classes. The default directory for Java classes is
<server-root>/plugins/java/applets
For more information, see the administrator's guide that ships with the
product (for example, the
Netscape Enterprise Server Administrator's Guide
or Netscape FastTrack Server Administrator's Guide),
or consult its online help.
A Java program runs when a user specifies its URL. To get to the default
directory for Java programs, specify the following URL
For example, to run the RandomApplet applet, one of the examples
provided with Enterprise Server 3.0, the user specifies the following URL
<hostname>/server-java/RandomApplet
To run a Java program via the LiveConnect facility, see Writing
Client/Server JavaScript Applications for more information. If
you are using Java in a server-side JavaScript application through the
LiveConnect facility, be aware that enabling JavaScript on the server also
activates the Java runtime engine. However, that means of enabling server-side
JavaScript only allows you to access the Java runtime engine through the
LiveConnect facility. If you wish to deploy applications based on the HttpApplet
interface, you must activate the Java runtime engine using the steps given
above.
NETSCAPE'S
JAVA
RUNTIME
ENVIRONMENT
The Java runtime environment that Netscape includes with Enterprise Server
and FastTrack Server 3.0/3.01 is based on Sun's JDK 1.1, with additional
features provided by Netscape.
SUPPORTED
FEATURES OF
JDK 1.1
The following new features of JDK 1.1 are supported:
-
Networking enhancements
-
I/O enhancements
-
Math package
For information about the core Java classes, see Sun's JDK
API Reference.
UNSUPPORTED
FEATURES OF
JDK
Features of JDK not currently supported in Enterprise Server
and FastTrack Server 3.0/3.01 include AWT 1.1 (server-side Java
does not make use of graphical user interfaces), inner classes,
internationalization, JavaBeans, JDBC (including the JDK 1.1
JDBC-ODBC bridge, object serialization, reflection, RMI, security
model, and miscellaneous features such as the Byte
,
Short
, and Void
classes.
NETSCAPE
ENTERPRISE
SERVER
IIOP
FEATURES
Netscape provides the following enhancements to support IIOP-based distributed
objects in the Enterprise Server:
-
Basic ORB
-
Objects-by-value (Object Serialization)
-
Java language mapping
-
Full Visigenic Java / C++ ORB Interoperability (except for Objects-by-value)
Please look at Netscape
Internet Service Broker for Java Programmer's Guide and Netscape
Internet Service Broker for Java Reference Guide for more details.
(Note that the Netscape Internet Service Broker is included with the
Netscape Enterprise Server but is not part of the Netscape FastTrack Server.)
ENTERPRISE
SERVER 3.0
CLASS
LIBRARIES
The file serv3_0.zip contains the Java class libraries included
with Enterprise Server and FastTrack Server 3.0/3.01 for deploying
HttpApplet and LiveConnect applications. These packages and classes
are listed below:
- netscape.javascript package
These classes support LiveConnect by allowing Java-to-JavaScript and
JavaScript-to-Java communication and by allowing your code to handle
JavaScript errors. The package is documented in the JavaScript Guide.
Classes in this package include:
- JSException
- JSObject (the static method
getWindow
is not supported)
- netscape.javascript.adapters package
The classes in this package include:
- JSTargetAdapter
- PropertyChangeAdapter
- netscape.server.applet package (deprecated)
These classes support server-side Java execution using the
HttpApplet
API.
The classes in this package include:
- Catastrophe
- HttpApplet
- Misconfiguration
- Server
- ServerApplet
- ServerAppletException
- URIUtil
- Warning
- netscape.server.base package (deprecated)
Classes in this package include:
- Buffer
- Session
- filebuf
- filestat
- netFD
- netbuf
- pb_param
- pblock
- sem
- shexp
- shmem
- uriutil
- netscape.server.frame package (deprecated)
Classes in this package include:
- Request
- conf
- errorLog
- func
- http
- httpact
- netscape.server.serverenv package
The class in this package supports server-side LiveConnect.
Note: The HttpApplet API (the netscape.server.applet
,
netscape.server.base
, netscape.server.frame
packages) is deprecated.
In addition, you should be aware of these sets of server-related Java
classes that are included as part of Enterprise Server:
-
nisb.zip contains a set of Java classes that support the Netscape
Internet Service Broker and associated utilities. You can use the Netscape
Internet Service Broker for Java to develop a distributed object application.
For information on creating Java classes using Netscape's Java ORB, see
the Netscape
Internet Service Broker for Java Programmer's Guide.
(Note that the FastTrack Server does not include the Netscape Internet
Service Broker. You need the Enterprise Server, which includes the Netscape
Internet Service Broker, to develop distributed object non-WAI applications.)
-
wai.zip contains a set of Java classes that support the Web Application
Interface. For information about using WAI, see
Writing Web Applications with WAI.
SAMPLE
CODE
For the HttpApplet interface, the sample Java applet in Chapter 3 of Programmer's
Guide, Netscape Enterprise Server Version 2.0 Programmer's Guide, (for
Unix
or for NT).
continues to work with Enterprise Server 3.0.
For WAI, see the code example WASP.java included in
Writing Web Applications with WAI.
For LiveConnect, see the example bugbase.java included
in Writing
Client/Server JavaScript Applications.
LIMITATIONS
The following are known limitations in the Java VM included with the Enterprise
Server and FastTrack Server 3.0/3.01 for HttpApplet and LiveConnect
applications.
-
The java.lang.Win32Process class is not completely implemented.
While this class is used to represent the process created by calling the
Runtime.exec() methods on Windows systems, the getInputStream(),
getOutputStream(), and getErrorStream() methods of
this class will throw a RuntimeException. Consequently, on Windows
systems, the Java application can create a new process, but it cannot write
to the process's input, nor read from the process's output and error streams
as defined in the Java API. The corresponding class for UNIX systems, viz.
java.lang.UNIXProcess is completely implemented, including the
support for these standard streams.
-
The suspend() and resume() methods of the java.lang.Thread
and java.lang.ThreadGroup classes are not implemented. When
invoked, these methods throw a RuntimeException.
-
The stop() method of java.lang.ThreadGroup is not implemented.
When invoked, this method throws a RuntimeException.
-
The stop() method of java.lang.Thread is partially
implemented. When a thread invokes this method on itself , in other words,
the thread on which this method is invoked is the same as the current thread
of execution, the method works as specified in the Java API. Otherwise
when a thread tries to stop another thread, the method throws a RuntimeException.
-
The destroy() method of java.lang.Thread is not implemented.
When invoked, this method throws a NoSuchMethodError.
-
The interrupt(), interrupted() and isInterrupted()
methods of java.lang.Thread are at an interim level of implementation,
as a consequence, the former method does nothing, while the latter
two return false for all calls.
APPENDIX
A: CLASSES
INCLUDED AND
SUPPORTED
The following classes and interfaces are available for developers
to use with the Java VM in Enterprise Server and FastTrack Server
3.0/3.01. These classes are in the serv3_0.zip file and
include core JDK 1.1 classes as well as Netscape classes.
- java.lang.ArrayIndexOutOfBoundsException
- java.lang.ArrayStoreException
- java.lang.ClassNotFoundException
- java.lang.Exception
- java.lang.String
- java.lang.StringBuffer
- java.lang.Thread
- java.lang.Thread.Group
- java.lang.Object
- java.lang.System
- java.io.* (except for object serialization)
- java.net.*
- java.util.Date
- java.util.Properties
- java.util.Vector
- netscape.javascript
- netscape.javascript.adapters
- netscape.server.applet
- netscape.server.base
- netscape.server.frame
- netscape.server.serverenv
APPENDIX
B: CLASSES
INCLUDED BUT NOT
SUPPORTED
The following classes and interfaces from JDK 1.1
are included but not supported with the Enterprise Server
and FastTrack Server 3.0/3.01.
Please note that the packages, classes and interfaces in the
java.awt and java.security hierarchies are not included
in Enterprise Server and FastTrack Server.
PACKAGES
-
java.beans
-
java.lang.reflect
-
java.math
-
java.rmi
-
java.rmi.dgc
-
java.rmi.registry
-
java.rmi.server
-
java.sql
-
java.text
-
java.text.resources
-
java.util.zip
CLASSES FROM JAVA.LANG
-
AbstractMethodError
-
ArithmeticException
-
Boolean
-
Byte
-
Character
-
Class
-
ClassCastException
-
ClassCircularityError
-
ClassFormatError
-
ClassLoader
-
CloneNotSupportedException
-
Cloneable
-
Compiler
-
Double
-
Error
-
ExceptionInInitializerError
-
FDBigInt
-
Float
-
FloatingDecimal
-
IllegalAccessError
-
IllegalAccessException
-
IllegalArgumentException
-
IllegalMonitorStateException
-
IllegalStateException
-
IllegalThreadStateException
-
IncompatibleClassChangeError
-
IndexOutOfBoundsException
-
InstantiationError
-
InstantiationException
-
Integer
-
InternalError
-
InterruptedException
-
LinkageError
-
Long
-
Math
-
NegativeArraySizeException
-
NoClassDefFoundError
-
NoSuchFieldError
-
NoSuchFieldException
-
NoSuchMethodError
-
NoSuchMethodException
-
NullPointerException
-
NullSecurityManager
-
Number
-
NumberFormatException
-
OutOfMemoryError
-
Process
-
ProcessInputStream
-
Runnable
-
Runtime
-
RuntimeException
-
SecurityException
-
SecurityManager
-
Short
-
StackOverflowError
-
StringIndexOutOfBoundsException
-
ThreadDeath
-
Throwable
-
UNIXProcess
-
UnknownError
-
UnsatisfiedLinkError
-
VerifyError
-
VirtualMachineError
-
Void
-
Win32Process
CLASSES FROM JAVA.UTIL
-
BitSet
-
Calendar
-
Dictionary
-
EmptyStackException
-
Enumeration
-
EventListener
-
EventObject
-
GregorianCalendar
-
Hashtable
-
HashtableEntry
-
HashtableEnumerator
-
ListResourceBundle
-
Locale
-
MissingResourceException
-
NoSuchElementException
-
Observable
-
Observer
-
PropertyResourceBundle
-
Random
-
ResourceBundle
-
SimpleTimeZone
-
Stack
-
StackLookup
-
StringTokenizer
-
SystemClassLoader
-
TimeZone
-
TooManyListenersException
-
VectorEnumerator
APPENDIX
C: ADDITIONAL
CLASSES
INCLUDED BUT NOT
SUPPORTED
The following additional Sun classes are included but are not
supported with Enterprise Server and FastTrack Server 3.0/3.01.
PACKAGES
-
sun.audio
-
sun.beans.editors
-
sun.beans.infos
-
sun.io
-
sun.jdbc.odbc
-
sun.misc
-
sun.net
-
sun.net.ftp
-
sun.net.nntp
-
sun.net.smtp
-
sun.net.www
-
sun.net.www.auth
-
sun.net.www.content.image
-
sun.net.www.content.text
-
sun.net.www.http
-
sun.net.www.protocol.doc
-
sun.net.www.protocol.file
-
sun.net.www.protocol.http
-
sun.rmi.registry
-
sun.rmi.server
-
sun.rmi.transport
-
sun.rmi.transport.proxy
-
sun.rmi.transport.tcp
-
sunw.io
-
sunw.util
Copyright Notice
Netscape Communications Corporation ("Netscape") and its licensors retain
all ownership rights to this document (the "Document"). Use of the Document
is governed by applicable copyright law. Netscape may revise this Document
from time to time without notice.
THIS DOCUMENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN NO
EVENT SHALL NETSCAPE BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF BUSINESS,
LOSS OF USE OR DATA, INTERRUPTION OF BUSINESS, OR FOR INDIRECT, SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY KIND, ARISING FROM ANY ERROR
IN THIS DOCUMENT.
The Document is copyright © 1997 Netscape Communications Corporation.
All rights reserved.
The Software includes encryption software from RSA Data Security, Inc.
Copyright © 1994, 1995 RSA Data Security, Inc. All rights reserved.
Portions of the Software include technology used under license from Verity,
Inc. and are copyrighted. Portions of the Software copyright © 1994,
1995 Sun Microsystems, Inc. All rights reserved. Portions of the Software
copyright © 1995 PEER Networks, Inc. All rights reserved. Portions
of the Software copyright © 1996 Mortice Kern Systems, Inc. All rights
reserved. Portions of the Software copyright © 1996, 1997 Symantec
Corporation. All rights reserved.
The portion of the Software that provides the DBM function is copyright
(c) 1990, 1993, 1994 The Regents of the University of California. All rights
reserved. This code is derived from software contributed to Berkeley by
Margo Seltzer. Redistribution and use in source and binary forms of the
DBM code, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the University of California,
Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THE SOFTWARE WHICH PROVIDES THE DBM FUNCTION IS PROVIDED BY THE REGENTS
AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
Netscape and Netscape Navigator are registered trademarks of Netscape
Communications Corporation in the United States and other countries. Netscape's
logos and Netscape product and service names are also trademarks of Netscape
Communications Corporation, which may be registered in other countries.
Other product and brand names are trademarks of their respective owners.
The downloading, export or reexport of Netscape software or any underlying
information or technology must be in full compliance with all United States
and other applicable laws and regulations. Any provision of Netscape software
or documentation to the U.S. Government is with restricted rights as described
in the license agreement accompanying Netscape software.
Any sample code included above is provided for your use on an "AS IS" basis, under the Netscape License Agreement - Terms of Use