Skip Headers

Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# Common J2SE Deployment Exceptions

The following are some of the most common exceptions that may be encountered when you try to deploy a J2SE (non-J2EE) application using TopLink.

## Classpath Exceptions

An exception may occur while setting up the connection pool. You must check the nested SQL exception to determine the cause of the exception. Typical reasons for this include:

- The location of JDBC driver is not specified on the classpath.

- The user name or password provided by the user is incorrect.

- The server URL or driver name is not properly specified.

Please consult the application server documentation and the JDBC driver documentation for help with this exception.

If the required TopLink JAR files have not been copied into the application extensions classpath, a classpath exception will be raised. You must ensure that the `toplink.jar` and `antlr.jar` files are copied into the `<Application Server install>``\lib\app` directory.

If TopLink encounters problems finding the deployment `project.xml` or `sessions.xml` files, a classpath exception will be raised. Refer to Chapter 10, "Deploying a TopLink Application".

JDeveloper places the `sessions.xml` file in the META-INF directory. To load the `sessions.xml` file in a non-J2EE application, you must explicitly provide the location of the `sessions.xml` file as shown in Example 15-1.

Example 15-1 Location of the sessions.xml file

            XMLSessionConfigLoader loader = new
               XMLSessionConfigLoader("META-INF/sessions.xml");
            session = (DatabaseSession)SessionManager.getManager().getSession(
               loader, "MySession", Thread.currentThread().getContextClassLoader());

If the J2SE application is a single-user application, a `DatabaseSession` can be used instead of a Server session. This provides improved performance and reduces the number of database connections and login time.

## Communication Exceptions

In situations where cache coordination is used, a communication exception may occur. A communication exception is a run-time exception that wraps all RMI, CORBA, or input and output exceptions that occur.

Refer to the Communication Exceptions (12000 - 12003) section in the TopLink Exception Reference chapter for detailed information on communication exceptions that may occur.

## Descriptor Validation Exceptions

A descriptor exception is a development exception that is raised when insufficient information is provided to the descriptor. The message that is returned includes the name of the descriptor or mapping that caused the exception. If a mapping within the descriptor caused the error, then the name and parameters of the mapping are part of the returned message.

The internal exception, mapping and descriptor appear only if TopLink has enough information about the source of the problem to provide this information.

Refer to the Descriptor Exceptions (1 – 200) section in the TopLink Exception Reference chapter for detailed information on descriptor validation exceptions that may occur.