Topic
1 reply Latest Post - ‏2012-07-16T16:11:26Z by SystemAdmin
LennyECM
LennyECM
2 Posts
ACCEPTED ANSWER

Pinned topic NoClassDefFoundError: com/filenet/api/core/Factory$Connection

‏2012-07-16T15:33:14Z |
All,

i can successfully able to compile my sample FileNet p8 connection code in unix command using putty

steps:
1) craete setenv CLASSPATH "/local/home/websphr/FileNet_Test/TestQA/FileNet_lib/activation.jar:/local/home/websphr/FileNet_Test/TestQA/FileNet_lib/commons-lang-2.6.jar:/local/home/websphr/FileNet_Test/TestQA/FileNet_lib/jaas.jar:/local/home/websphr/FileNet_Test/TestQA/FileNet_lib/Jace.jar:/local/home/websphr/FileNet_Test/TestQA/FileNet_lib/log4j-1.2.13.jar:/local/home/websphr/FileNet_Test/TestQA/FileNet_lib/mailapi.jar:/local/home/websphr/FileNet_Test/TestQA/FileNet_lib/pe.jar:/local/home/websphr/FileNet_Test/TestQA/FileNet_lib/peResources.jar"

2) javac FileNetCE_Connection.java

code
import javax.security.auth.Subject;
import com.filenet.api.core.Factory;
import com.filenet.api.util.UserContext;
import com.filenet.api.core.Connection;

public class FileNetCE_Connection
{
public static UserContext userContext = null;
public static void main(String args[])
{
Connection connection = Factory.Connection.getConnection("http://YYYYYYYY:XXXX/wsi/FNCEWS40DIME");
Subject subject = UserContext.createSubject(connection, "username", "password", "FileNetP8");
userContext = UserContext.get();
userContext.pushSubject(subject);

System.out.println(connection);
}
}
[/code]

3) java -cp /local/home/websphr/FileNet_Test/TestQA FileNetCE_Connection

then i am getting following error

Exception in thread "main" java.lang.NoClassDefFoundError: com/filenet/api/core/Factory$Connection
at FileNetCE_Connection.main(FileNetCE_Connection.java:12)

Please guide me...

Thanks
Lenny
Updated on 2012-07-16T16:11:26Z at 2012-07-16T16:11:26Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    693 Posts
    ACCEPTED ANSWER

    Re: NoClassDefFoundError: com/filenet/api/core/Factory$Connection

    ‏2012-07-16T16:11:26Z  in response to LennyECM
    When you run that java command at the end, you are setting the classpath to just a single directory. You are not getting the stuff you put on CLASSPATH because of your use of the -cp command line option.