Question & Answer
Question
Why is there a compilation error from the Cognos SDK API ?
Cause
Attempting to compile a Java Sample or source code provided with the IBM Cognos Product, or with any Technote document may generate a " package does not exist " error.
The error message will indicate which package cannot be located depending on the version of IBM Cognos product referenced within the Sources.
For Cognos Reportnet (CRN) the compile / execution command : Javac <myclass>.java
will produce the following error:
<myclass>.java:<line #>: package com.cognos.developer.schemas.bibus._2 does not exist
For IBM Cognos version 8.x.x / 10.x.x or 11.x.x.x the command : Javac <myclass>.java
will produce the following error:
<myclass>.java:<line #>: package com.cognos.developer.schemas.bibus._3 does not exist
More errors can follow this error , as the compiler goes through the source code.
Answer
The library Jar files distributed with the IBM Cognos products are not in the classpath , is the usual problem.
Ensure that the jar files in <IBMCognos Install>/sdk/java/lib are included in the classpath before executing the javac compiler command.
Please do be careful not add all jar files , that will be incorrect to do. See the first referenece below regarding SET1 (obsolete) , SET2 and SET3 information.
An example of a valid classpath setup can be found in any of the java sample build files included with the SDK product in the Java folder.
Review the build-samples.bat or build-samples.sh / build.bat or build.sh in the directories
For instance <IBMCognos Install>/sdk/java/build-samples.bat or <IBMCognos Install>/sdk/java/build-samples.sh files contain the right libraries and Classpath locations.
It is important to note that the versions of IBM Cognos do have a different bibus version entry.
Using incorrect libraries between the compilation of application code , and the run-time environment targets will also cause this error to appear.
Referencing old libraries in the sources, will compile this compile for use against a higher version server
See the referenced Technotes below for further information on how Environment and Application Source code needs to be modified to work in IBM Cognos Versions.
Related Information
Historical Number
1019559
Was this topic helpful?
Document Information
Modified date:
24 February 2020
UID
swg21339634