Sun Java System Application Server Enterprise Edition 8.2 Upgrade and Migration Guide

Chapter 5 J2EE 1.4 Compatibility Issues

The following topics are covered in this chapter:

Binary Compatibility

The Java SDK included in Application Server 8.2 is the J2EE version 1.4 SDK. This version of the J2EE SDK is compatible with J2EE SDK, v1.3.

Source Compatibility

Downward source compatibility is not supported. If source files use new J2EE APIs, they are not usable with an earlier version of the J2EE platform.

In general, the policy is as follows:

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 plans to remove such methods and classes entirely.

Incompatibilities with the J2EE 1.4 Platform (since the J2EE 1.3 release)

The Sun Java System Application Server 8.2 release is based on the Java 2 Platform, Enterprise Edition, version 1.4. The Sun Java System Application Server 7 release is based on the Java 2 Platform, Enterprise Edition, version 1.3.

Almost all existing programs must run on the Sun Java System Application Server 8.2 release without modification. However, there are some minor potential incompatibilities that involve rare circumstances and corner cases that have been documented here for completeness.

JAXP and SAX Incompatibilities

Sun Java System Application Server 8.2 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.

The pass-by-reference Element

Sun Java System Application Server 8.2 is compatible with the Java 2 Platform, Enterprise Edition specification by default. In this case, all portable J2EE programs run on the Application Server without modification. However, as allowed by the J2EE compatibility requirements, it is possible to configure applications to use features of the Sun Java System Application Server 8.2 that are not compatible with the J2EE specification.

The pass-by-reference element in the sun-ejb-jar.xml file only applies to remote calls. As defined in the EJB 2.0 specification, section 5.4, calls to local interfaces use pass-by-reference semantics.

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 2.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 Enterprise Edition 8.2 Developer’s Guide.