filenet connection with java api to process engine not working
843789May 27 2009 — edited May 27 2009import javax.security.auth.Subject;
//import com.filenet.api.core.Factory;
import com.filenet.api.util.UserContext;
import com.filenet.api.core.*;
import filenet.vw.api.VWSession;
import filenet.vw.api.VWException;
public class peconn
{
public static void main(String args[])
{
peconn pe = new peconn();
pe.peconnection();
}
public void peconnection()
{
//System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); //for JBoss
/*Connection ceConnection =
Factory.Connection.getConnection("http://hqdemo1:9080/wsi/FNCEWS40MTOM");
Subject ceSubject =
UserContext.createSubject(ceConnection,"administrator", "filenet", null);
UserContext.get().pushSubject(ceSubject);*/
System.setProperty("java.naming.factory.initial", "com.ibm.websphere.naming.WsnInitialContextFactory"); //for WebSphere
//System.setProperty("filenet.pe.bootstrap.ceuri", "jnp://<server_name>:1099/FileNet/Engine"); //for JBoss
System.setProperty("filenet.pe.bootstrap.ceuri", "http://hqdemo1:9080/wsi/FNCEWS40DIME"); //for WebSphere
System.out.println("I am");
VWSession vwSes=null;
try{
//logon to PE
System.out.println("I am");
vwSes = new VWSession("administrator","filenet","PEConnection");
System.out.println("stage 3");
System.out.println("Router URL: " + vwSes.getRouterURL());
System.out.println("Is Logged on?: " + vwSes.isLoggedOn());
}catch (VWException e) {
System.out.println("hello I am here");
e.printStackTrace();
}
}
}
When I run the above code I get the error
I am
I am
2009-05-27 14:31:58,125 FATAL [main] - Unable to locate a login configuration
hello I am here
log4j:WARN The log4j system is not properly configured!
log4j:WARN All ERROR messages will be sent to the system console until proper configuration has been detected.
Problem getting JAAS Context: java.lang.SecurityException: Unable to locate a login configuration
at filenet.pe.peorb.client.JAASContext.getJAASContext(JAASContext.java:494)
at filenet.pe.peorb.client.ORBSession.getJAASContextOnly(ORBSession.java:697)
at filenet.pe.peorb.client.ORBSession.getJAASContext(ORBSession.java:711)
at filenet.pe.peorb.client.ORBSession.establishORBSession(ORBSession.java:642)
at filenet.pe.peorb.client.ORBSession.<init>(ORBSession.java:985)
at filenet.vw.server.PECommandsFactory.getPECommands(PECommandsFactory.java:119)
at filenet.vw.api.VWSession.logonByDomain(VWSession.java:864)
at filenet.vw.api.VWSession.logon(VWSession.java:723)
at filenet.vw.api.VWSession.<init>(VWSession.java:643)
at peconn.peconnection(peconn.java:38)
at peconn.main(peconn.java:17)
Plz help me out...
Thank You