Hi ,
I am having jdev version 11.1.2.4.0 , I am trying to call FileNet to search document based on SSN . the below code works if I create a Java EE application in Jdeveloper but it does not work with
FusionADFApplication.
When I run inside FusionADFApplication I can below error , Any Pointers on which jar conflict could be causing issue ?
2017-03-13 11:24:55,468 filenet_tracing.api.detail.com.filenet.api.util.UserContext.traceResponse() - UserContext <168924280> created in Thread <903275145>
com.filenet.api.exception.EngineRuntimeException: FNRCE0066E: E_UNEXPECTED_EXCEPTION: An unexpected exception occurred. The unexpected exception is chained to this exception.
at com.filenet.apiimpl.exception.Exceptions.evaluate(Exceptions.java:43)
at com.filenet.apiimpl.util.XMLHelper.trace(XMLHelper.java:83)
at com.filenet.apiimpl.util.XMLHelper.trace(XMLHelper.java:62)
at com.filenet.apiimpl.transport.TransportLogger.traceResponse(TransportLogger.java:214)
at com.filenet.apiimpl.core.Session.callExecuteChanges(Session.java:182)
at com.filenet.apiimpl.core.Session.executeChanges(Session.java:557)
at com.filenet.apiimpl.core.Session.executeChange(Session.java:846)
at com.filenet.apiimpl.core.IndependentlyPersistableObjectImpl.save(IndependentlyPersistableObjectImpl.java:83)
at com.filenet.apiimpl.core.IndependentlyPersistableObjectImpl.save(IndependentlyPersistableObjectImpl.java:74)
at view.Class1.main(Class1.java:75)
Caused by: java.lang.IllegalArgumentException
at oracle.xml.jaxp.JXTransformer.setOutputProperty(JXTransformer.java:796)
at com.filenet.apiimpl.util.XMLHelper.configureTraceOutputProperties(XMLHelper.java:115)
at com.filenet.apiimpl.util.XMLHelper.trace(XMLHelper.java:78)
... 8 more
import com.filenet.api.collection.IndependentObjectSet;
import com.filenet.api.constants.RefreshMode;
import com.filenet.api.core.Connection;
import com.filenet.api.core.Document;
import com.filenet.api.core.Domain;
import com.filenet.api.core.Factory;
import com.filenet.api.core.ObjectStore;
import com.filenet.api.property.Properties;
import com.filenet.api.query.SearchSQL;
import com.filenet.api.query.SearchScope;
import com.filenet.api.util.UserContext;
import java.util.Iterator;
import javax.security.auth.Subject;
public class Class1 {
public Class1() {
super();
}
public static void main(String[] args) {
//wlthinclient
System.setProperty("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
System.setProperty("java.security.auth.login.config","C:\config\\jaas.conf.WebLogic");
//log4j
// org.apache.log4j.BasicConfigurator.configure();
Connection connection = null;
String uri = "t3://test:8050/FileNet/Engine";
try {
//System.out.println("FileNet getConnection to " + uri);
connection = Factory.Connection.getConnection(uri);
System.out.println("Connection: " + connection);
// Add jaas configuration later
Subject subject = UserContext.createSubject(connection, "****", "*****", null);
System.out.println("Subject: " + subject);
UserContext uc = UserContext.get();
System.out.println("User Context: " + uc);
uc.pushSubject(subject);
ObjectStore objectStore = null;
Domain domain = Factory.Domain.getInstance(connection, null);
objectStore = Factory.ObjectStore.getInstance(domain, "ObjectStore");
System.out.println("Object Store: " + objectStore);
// Search the object store with the sql and get the returned items
String query = "SELECT TOP 5 d.this, d.* FROM PremiumFilings d WHERE DocID=405996495";
SearchSQL sql = new SearchSQL();
sql.setQueryString(query);
SearchScope scope = new SearchScope(objectStore);
//System.out.println("Search scope: " + scope);
IndependentObjectSet documents = scope.fetchObjects(sql, null, null, false);
System.out.println("test!!");
for (Iterator<Document> iter = documents.iterator(); iter.hasNext();) {
Document document = (Document) iter.next();
Properties docProps = (Properties) document.getProperties();
System.out.println("Document: " + docProps);
long documentID = (docProps.getFloat64Value("DocID")).longValue();
System.out.println("Document ID: " + documentID);
//docProps.putValue("Closed", "True");
String test = null;
String state = docProps.getStringValue("Closed");
System.out.println("State: " + state);
if(state == null){
System.out.println("The Document is already Restored!");
}
docProps.putValue("Closed", test);
document.save(RefreshMode.REFRESH);
}
System.out.println("test2!!");
} catch (Exception e) {
System.out.println("Error getting the FileNet CE connection ");
//throw new RaException(e);
}
}
}