The following topics are covered in this chapter:
In this Application Server 9 release, the included Java SDK is The Java Platform, Enterprise Edition version 5 SDK (Java EE 5). This version of the Java EE is upwards binary-compatible with J2EE SDK 1.3, 1.4, and 1.5, except for the incompatibilities listed below. This means that, except for the noted incompatibilities, applications built for version 1.4 run correctly in the Sun Java System Application Server 9 release.
In general, the policy is as follows:
Maintenance releases do not introduce any new APIs, so they maintain source compatibility with one another.
Functionality releases and major releases maintain upwards but not downwards source compatibility.
Deprecated APIs are methods and classes that are supported only for backward compatibility, and the compiler generates a warning message whenever one of these is used, unless the -nowarn command-line option is used. It is recommended that programs be modified to eliminate the use of deprecated methods and classes, though there are no current plans to remove such methods and classes entirely from the system.
Almost all existing programs should run on the Sun Java System Application Server 9 release without modification. However, there are some minor potential incompatibilities that involve rare circumstances and corner cases that we are documenting here for completeness.
The java.net.Proxy class was added in 5.0, making two classes named Proxy — java.lang.reflect.Proxy and java.net.Proxy. The introduction of java.net.Proxy will cause a source-level incompatibility in existing code if a compilation unit has the following type-import-on-demand declarations:
import java.lang.reflect.*; import java.net.*;
Java Servlet Specification Version 2.5 ships with the Sun Java System Application Server 9 release, and can be downloaded from the following URL:
Sun Java System Application Server 9 supports JAXP 1.3, which in turn supports SAX 2.0.2. In SAX 2.0.2, DeclHandler.externalEntityDecl requires the parser to return the absolute system identifier for consistency with DTDHandler.unparsedEntityDecl. This might cause some incompatibilities when migrating applications that use SAX 2.0.0.
To migrate an application that uses SAX 2.0.0 to SAX 2.0.2 without changing the previous behavior of externalEntityDecl, you can set the resolve-dtd-uris feature to false. For example:
SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setFeature("http://xml.org/sax/features/resolve-dtd-uris",false);
Other incompatibilities between SAX 2.0.0 and SAX 2.0.2 are documented in the JAXP Compatibility Guide.
All portable Java EE programs run on the Application Server 9 without modification. However, as allowed by the Java EE compatibility requirements, it is possible to configure applications to use features of the Sun Java System Application Server 9 that are not compatible with the Java EE specification.
If the pass-by-reference element is set to its default value of false, the parameter passing semantics for calls to remote interfaces comply with the EJB 3.0 specification, section 5.4. If set to true, remote calls involve pass-by-reference semantics instead of pass-by-value semantics, contrary to this specification.
Portable programs cannot assume that a copy of the object is made during such a call, and thus that it is safe to modify the original. Nor can they assume that a copy is not made, and thus that changes to the object are visible to both caller and callee. When this flag is set to true, parameters and return values are considered read-only. The behavior of a program that modifies such parameters or return values is undefined. For more information about the pass-by-reference element, see the Sun Java System Application Server Platform Edition 9 Developer’s Guide.
If the delegate attribute in the class-loader element of the sun-web.xml file is set to its default value of true, classes and resources residing in container-wide library JAR files are loaded in preference to classes and resources packaged within the WAR file, contrary to what is recommended in the Servlet 2.5 specification. If set to false, the classloader delegation behavior complies with what is recommended in the Servlet 2.5 specification.
Do not package portable programs that use the delegate attribute with the value of true with any classes or interfaces that are a part of the J2EE specification. The behavior of a program that includes such classes or interfaces in its WAR file is undefined. For more information about the class-loader element, see the Sun Java System Application Server Platform Edition 9 Developer’s Guide.