Pramati Technologies

Working with Database Drivers & External JARs

Any Server configured in Studio (including the In-Built Pramati Server), starts in a separate VM (virtual machine) of its own and does not share Studio's classpath. This requires configuring the Server's classpath, just like Studio's classpath. This is usually done by setting the classpath in the Server Configuration Panel.

The classpath set in the Server Configuration panel in Studio, is set separately for each configured server instance. These classpath settings cannot be applied to the server's, that have started remotely. Servers started remotely cannot be controlled by Studio.

Example

Production WebLogic Server's classpath cannot be set.

The build classpath of a Web module, which is set using the Build Properties Panel, is used by Studio's internal Build Tool while compiling JavaServer Pages. This classpath is not available to the configured server instances or the Web application, until the application is organized.

This chapter discusses working with Database Drivers and external JARs, especially in the above scenarios.

Database Drivers

Drivers are added using the Configure Drivers dialog. To bring this dialog up, click on Tools > Configure JDBC Driver from the main menu. Refer the sections on Data Source for detailed information on database drivers. All the drivers configured get added to the server's classpath when the server is started. Therefore, the user does not need to add the driver JARs to the server classpath specifically. When a server is started, all the valid resources in the current desk will automatically be added to that server.

Resources can be added, deleted or modified only on the currently running server. This information is persisted in the resource.xml file, only when the operation succeeds. These operation are performed on all other running servers too.

External JARs

External JARs are third party libraries like log4J, used by the application. Adding the external JAR to the configured server, using the Server Configuration panel.

As the Build classpath of Web modules is not included in the server's classpath, these external JARs are not available to the WAR. Therefore, JARs used by Web modules must be added to its WEB-INF/lib folder. Adding a JAR to the WEB-INF/lib folder automatically adds it to the classpath of the "classloader", which is used to load the specific WAR.

Studio's Build Tool automatically adds these JARs to its classpath, for compiling the Web module. Note that these JARs are not available in the server classpath, and therefore will not be automatically available to the EJB JARs (EJB modules) in the application. This behavior is as per J2EE specifications.

To add classes to the Web module's classpath, use the Include Files/Folders option available in the Deploy Tab of the Properties Panel.


Pramati Technologies  © Copyright   TOCPREVNEXTINDEX