filenet connection with java api not working
843810May 27 2009 — edited Jun 2 2009I have written the following code to connect content engine and process engine..
MY content engine is connected fine and good...But process engine is not connecting
code:
public String PE_CONNECTION_POINT = "PEConnection";
public Connection ceConnection;
public Domain ceDomain;
public void testFileNetConnection()
{
/*
* Connect to Content Engine and retrieve a list of
* properties for the base 'Document' document class
*/
ceConnection =
Factory.Connection.getConnection(FILENET_URI);
Subject ceSubject =
UserContext.createSubject(ceConnection, FILENET_USERNAME, FILENET_PASSWORD, null);
UserContext.get().pushSubject(ceSubject);
ceDomain = Factory.Domain.fetchInstance(ceConnection, CE_DOMAIN, null);
ObjectStore ceObjectStore = Factory.ObjectStore.fetchInstance(ceDomain, CE_OBJECTSTORE, null);
ClassDefinition classDef =
Factory.ClassDefinition.fetchInstance(ceObjectStore, "pawan", null);
PropertyDefinitionList properties = classDef.get_PropertyDefinitions();
for (Iterator propertyIter = properties.iterator(); propertyIter.hasNext();) {
PropertyDefinition property = (PropertyDefinition) propertyIter.next();
System.out.println("Property: " + property.get_DisplayName());
}
//this.instantiateFolder(ceObjectStore);
//this.createFile(ceObjectStore, ceDomain);
UserContext.get().popSubject();
/*
* Connect to Process Engine and retrieve a list of
* Queues for this Connection Point
*/
VWSession peSession = new VWSession();
peSession.setBootstrapCEURI(FILENET_URI);
String[] queueNames = null;
try
{
peSession.logon(FILENET_USERNAME ,FILENET_PASSWORD,PE_CONNECTION_POINT);
queueNames =
peSession.fetchQueueNames(VWSession.QUEUE_PROCESS);
}
catch(Exception es){es.printStackTrace();}
for (String queue : queueNames)
{
System.out.println("Queue: " + queue);
}
}
The output of above code I have attached part of successful connection of the content engine and the error of process engine
Property: Ignore Redirect
Property: Entry Template Object Store Name
Property: Entry Template Launched Workflow Number
Property: Entry Template Id
java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/ObjectURL
at filenet.pe.peorb.client.ORBSession.establishORBSession(ORBSession.java:667)
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 FileNetConnectionTest.testFileNetConnection(FileNetConnectionTest.java:97)
at FileNetConnectionTest.main(FileNetConnectionTest.java:35)
Caused by: java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/ObjectURL
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.ibm.websphere.naming.WsnInitialContextFactory.init_implClassCtor(WsnInitialContextFactory.java:172)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:112)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at filenet.pe.peorb.client.ORBServiceHelper.getORB(ORBServiceHelper.java:442)
at filenet.pe.peorb.client.ORBServiceHelper.initFromORBRouterInfo(ORBServiceHelper.java:286)
at filenet.pe.peorb.client.ORBServiceHelper.<init>(ORBServiceHelper.java:873)
at filenet.pe.peorb.client.ORBSession.establishORBSession(ORBSession.java:653)
... 6 more
Exception in thread "main" java.lang.NullPointerException
at FileNetConnectionTest.testFileNetConnection(FileNetConnectionTest.java:104)
at FileNetConnectionTest.main(FileNetConnectionTest.java:35)
When to remove the above error I add IBMORB.jar in enviroment variable then I get following error
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.
Exception in thread "main" com.filenet.api.exception.EngineRuntimeException: SECURITY_INVALID_CREDENTIALS: Invalid credentials.
at com.filenet.apiimpl.wsi.ClientOperation.getCredential(ClientOperation.java:303)
at com.filenet.apiimpl.wsi.ClientOperation.setCallContext(ClientOperation.java:194)
at com.filenet.apiimpl.wsi.ClientOperation.start(ClientOperation.java:102)
at com.filenet.apiimpl.wsi.ClientOperation.run(ClientOperation.java:69)
at com.filenet.apiimpl.wsi.ServiceSession.getObjects(ServiceSession.java:242)
at com.filenet.apiimpl.util.SessionHandle.getObjects(SessionHandle.java:334)
at com.filenet.apiimpl.core.Session.callGetObjects(Session.java:121)
at com.filenet.apiimpl.core.Session.executeGetObject(Session.java:325)
at com.filenet.apiimpl.core.Session.getObject(Session.java:339)
at com.filenet.apiimpl.core.IndependentObjectImpl.getObject(IndependentObjectImpl.java:154)
at com.filenet.apiimpl.core.IndependentObjectImpl.refresh(IndependentObjectImpl.java:161)
at com.filenet.api.core.Factory$Domain.fetchInstance(Factory.java:1543)
at FileNetConnectionTest.testFileNetConnection(FileNetConnectionTest.java:69)
at FileNetConnectionTest.main(FileNetConnectionTest.java:35)
Plz help me out..Thank you