This page lists technical tips for common problems and provides instructions on how to debug your new VarPack.
If your custom VarPack is not loaded correctly, first check the following items:
Be careful to list the full class name of the HelloWorldVarPack class in CustomVarPacks.xml exactly as it is spelled in the code. It will not load if spelled or capitalized incorrectly. This might not produce errors during startup. One way to check that the VarPack is loaded correctly is to make sure that ALI Logging Spy (formerly called Plumtree Logging Spy) says the correct number were loaded (i.e., 1). For instructions, see the View Customization section of Step 2: Deploying a Custom Project.
Make sure that the name of the xml data file (HelloWorld.xml) is the same as the file name returned by the GetVarPackXMLFileName() method, and that the xml data file is located in the PT_HOME\settings\portal directory.
Check the syntax of the xml data in HelloWorld.xml. If there are syntax errors or the file is formatted incorrectly, it will not load. The XMLBaseVarPack class can only read in xml files that have a single root node with multiple section nodes underneath it. The section nodes contain multiple name/value pair nodes where the name of the node is the name and the value attribute is the value (i.e. <NodeName value="NodeValue"/>). If you need to use a different format, you must override the LoadSettingsIntoXPHashtable() method.
If none of these tips solve the problem, debug your code using the instructions below.
These instructions use the HelloWorldVarPack class created on the previous pages as an example. (If you cannot see the instructions you need, reset the language filter at the top of the page. No VB sample code is provided for this example.)
Java
If your Java Eclipse debugger is not currently set up for Tomcat, see Setting Up the Development Portal for instructions on how to add the samplevarpack project to the debugger.
In Eclipse, stop the Tomcat debugging session and open HelloWorldVarPack.java.
Add a breakpoint as shown below.
In the Eclipse menu, click Run | Debug… and select the Tomcat application.
Choose the Classpath tab, select Add Projects, and add the samplevarpack project.
Hit Debug (and Save to retain your changes).
Start the portal.
You should hit this breakpoint once during startup, when the XMLBaseVarPack class asks the HelloWorldVarPack what xml file to load.
C#
Stop the Visual Studio debugger (and close your browser if it is still open) and open HelloWorldVarPack.cs in Visual Studio.
Start the Visual Studio debugger (F5 or Start | Debug) and wait for the portal to start up.