Skip Headers

# Classpath Exceptions

Previous

Next

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 following:

- 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.

You should 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 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: Location of the sessions.xml file.

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 `ServerSession`. This provides improved performance and reduces the number of database connections and login time.