Environment[indent]TS 671 SP1 P2
Solaris 10
CSSDK 3.1.0[/indent]
Issue[indent]I'm looking at page 29 of the "Interwoven®
ContentServices™ for TeamSite - Cookbook - Release 2.5" (is there a 3.1.0 version of this document?) and there's some sample code that looks [somewhat] like this:
import com.interwoven.cssdk.common.*;
import com.interwoven.cssdk.factory.*;
import java.util.*;
import java.io.*;
public class foo {
public static void main(String[] args) {
// ... variable declarations ...
Properties props = new Properties();
try {
props.load(new FileInputStream("path-to-properties-file"));
} catch ( FileNotFoundException fnf ) {
System.out.println( "The properties file was not found" );
} catch ( IOException io ) {
System.out.println( "Some type of I/O exception has occurred" );
}
System.out.println("props: " + props); // debugging
// get the factory
factory = CSFactory.getFactory(props);
name = factory.getClass().getName();
// ... more code ...
}
}
My CLASSPATH looks essentially like this:
IWHOME/cssdk/cssdkjni.jar:IWHOME/cssdk/cssdkiface.jar:.
I made sure that
IWHOME/tools/java/bin
is at the front of my PATH and I run:
javac foo
No errors - good, then I run:
> java foo
props: {com.interwoven.cssdk.factory.CSFactory=com.interwoven.cssdk.factory.CSLocalFactory , cssdk.cfg.path=/opt/appbin/TShome/cssdk/cssdk.cfg}
Exception in thread "main" com.interwoven.cssdk.factory.CSFactoryInitializationException: (Factory initialization failed)
at com.interwoven.cssdk.factory.CSFactory.getFactory(CSFactory.java:132)
at foo.main(foo.java:23)
Root cause:
java.lang.ClassNotFoundException: com.interwoven.cssdk.factory.CSLocalFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.interwoven.cssdk.factory.CSFactory.getFactory(CSFactory.java:127)
at foo.main(foo.java:23)
Hmm, I know I included cssdkjni.jar on my CLASSPATH - and:
> unzip -l IWHOME/cssdk/cssdkjni.jar | grep LocalFactory
8498 08-28-07 15:22 com/interwoven/cssdk/factory/CSLocalFactory.class
The jar file certainly seems to include the desired class information.
I've tried explicitly adding
-cp $CLASSPATH on the command line when running the program - no help. I've swapped the first two elements in the CLASSPATH - no help. I've swaped the first two 'import' statements in the source file - no help.[/indent]
So - what am I missing? / what am I doing wrong?