Before you import the PopChart Embedder library into a Java Server Page or a Servlet, you first need to include the PopChartEmbedder.jar file in your web application server's classpath. This file, located in the dev_tools/java_embedder folder, contains all of the classes necessary to use the PopChart Embedder in a Java environment.
How you include the PopChartEmbedder.jar file will depend upon your web application server. Listed below are the instructions for several of the more common web application servers. If yours is not listed, consult your web application server's documentation for instructions.
Before you read on, though, you should copy the PopChartEmbedder.jar file to a location accessible to your web application server.
Launch the ColdFusion Administrator on the machine where you are installing the PopChart Embedder. Once there, click on the Java option under Server on the left hand menu. This will bring you into the Java Settings window.
Make sure Load JVM when starting Cold Fusion has been checked. If it hasn't, you will also need to specify the location of the Java VM on your server. On Microsoft Windows, look for jvm.dll. On UNIX, look for libjvm.so. If you installed a Java VM with PopChart Server, you can find the appropriate file in the jre/bin/hotspot folder.
After making sure the Java VM is enabled, you then need to add the location (absolute path) of your PopChartEmbedder.jar file to the Class Path variable, as shown in the following image.
Note: If there are already other files in the classpath, make sure you separate the files with a semi-colon.
Click on the Apply button to save your changes.
Begin by logging in to the iPlanet Web Administration Page. Once you are logged in, choose the server which you wish to alter from the pulldown list and press the Manage button.
Click on the Servlets tab. Make sure that you have enabled JSPs and Servlets for your server by selecting Yes for the following settings: Activate the Servlet Engine? and Enable JSP? (only the first setting needs to be enabled for Servlets).
To add the PopChartEmbedder.jar file to the iPlanet application server classpath, select the Configure JVM Attributes from the left sidebar. Add the absolute path to the appropriate jar file to the end of the Classpath variable. If there are already other files in this list, be sure to add a semi-colon before the path to PopChartEmbedder.jar.
Once a jar file has been added to the classpath, the server must be restarted. To do this, push the OK button and then hit Apply to verify that iPlanet has restarted.
To add the PopChartEmbedder.jar file to the JRun application server classpath, copy it to the /JRun/servers/default/default_app/WEB-INF/lib/ directory, where default is the name of the server and default_app is the name of the web application to which you wish to add the JAR file (within every web application there should be a WEB-INF/lib/ directory that holds JAR files). Once the jar file is added, the web server must by restarted so that JRun will load the new jar file.
To add the PopChartEmbedder.jar file to the classpath of a Tomcat web application application, copy it to the lib folder of your web application (e.g. /Tomcat/webapps/default/WEB-INF/lib, where default is the name of the web application). Then restart Tomcat.
To add the PopChartEmbedder.jar file to the WebLogic application server classpath, copy it to the WEB-INF\lib subdirectory within the root directory of your web application. On Microsoft Windows, for example, the root directory is usually C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp_myserver. After you add the file, WebLogic will need to be restarted.
You need to add the path to your PopChartEmbedder.jar file in two locations.
In your /Supporting Files/Makefile.preamble file, search for the OTHER_CLASSPATH variable. Add to this variable the location of your PopChartEmbedder.jar file. For example, if you've copied the file to /System/java_jars/PopChartEmbedder.jar, this line would read as follows:
OTHER_CLASSPATH = /System/java_jars/PopChartEmbedder.jar
In your /Supporting Files/CustomInfo.plist file, search for the NSJavaUserPath variable. Add to this variable the location of your PopChartEmbedder.jar file. For example, if you've copied the file to /System/java_jars/PopChartEmbedder.jar, this line would read as follows:
NSJavaUserPath = (/System/java_jars/PopChartEmbedder.jar)
To add the PopChartEmbedder.jar file to the WebSphere application server classpath, go into the administration console and expand the WebSphere Administrative Domain tree on the left side. Several machine names should appear. Select the name of the machine that you wish to use with PopChart Server.
Next, select the appropriate web server. By default, every machine with WebSphere has a server named Default Server. Then, select a servlet engine (e.g. Default Servlet Engine). Finally, select a web application within the servlet engine (e.g. default_app).
After selecting a web application, click on the Advanced tab. At this point you should see the Classpath, containing a list of JAR and ZIP files. Click on the button to the right of Classpath and browse to the location of PopChartEmbedder.jar (be sure the files of type box at the bottom of the browsing dialog is set to Jar Files (.jar)).
After you select the file from this dialog, the PopChartEmbedder.jar file should appear in the list of jar and zip files in the classpath. The web application will not load this jar file until you push the Apply button.
After pushing Apply, the newly added jar file should appear in the bottom list, Classpaths in Use. At this point, you will know that the jar file was successfully added to the web application.