Topic
1 reply Latest Post - ‏2012-03-07T01:35:06Z by Rav81
SystemAdmin
SystemAdmin
42 Posts
ACCEPTED ANSWER

Pinned topic FileNet Java API.. Connecting to Content Engine

‏2008-06-30T21:34:06Z |
Hello All,

I am having some troubles connecting our content engine. I have developing an app on my local machine and trying to connect to the engine on our server.. Here is the information below (code, VM args, ...)

Code...




package com.ibm.filenet.edu;

import java.util.Iterator;
import javax.security.auth.Subject;
import java.util.Hashtable;
import java.net.InetAddress;
import java.util.Properties;
import javax.naming.*;
import com.filenet.api.collection.ObjectStoreSet;
import com.filenet.api.core.*;
import com.filenet.api.util.UserContext;
import java.lang.String;

public class AddToFileNetMain {
public Connection getCEConnectionEDU()
{ String uri = "iiop://host:8080/FileNet/Engine";
String username = "User";
String password = "Pass";

Connection conn = Factory.Connection.getConnection(uri);
Subject subject = UserContext.createSubject( conn, username, password, null);

UserContext uc = UserContext.get();
uc.pushSubject(subject);

return conn;
}
public Domain getDomainEDU(Connection conn)
{ String domainName = "DevP8Domain";
System.out.println( " - Fetch Instance...");
Domain domain = Factory.Domain.fetchInstance(conn, domainName, null);
System.out.println( "Domain Name is: "+ domain.get_Name());
return domain;
}
public void getObjectStoresEDU(Domain domain)
{ ObjectStoreSet osSet = domain.get_ObjectStores();
ObjectStore store;
Iterator osIter = osSet.iterator();
System.out.println( "Available Object Stores: ");
while (osIter.hasNext())
{ store = (ObjectStore)osIter.next();
System.out.println(store.get_Name());
} }
public ObjectStore getObjectStoreEDU (Domain domain, String objectStoreName)
{
ObjectStore store = Factory.ObjectStore.fetchInstance(domain, objectStoreName, null); System.out.println( "Objectstore is: "+ store.get_Name());

return store;
}
public Folder getFolderEDU(ObjectStore store, String folderName) {
Folder folder= Factory.Folder.fetchInstance(store,folderName, null);
folderName = folder.get_FolderName();
System.out.println(folderName + " folder has been retrieved");
return folder;

}
public static void main(String[] args)
{ try { System.out.println( "Creating Instance...");
AddToFileNetMain myInstance = new AddToFileNetMain();

System.out.println( "Get Connection...");
Connection conn = myInstance.getCEConnectionEDU();

System.out.println( "Get Domain...");
Domain domain = myInstance.getDomainEDU(conn);

System.out.println( "Get Object Stores...");
myInstance.getObjectStoresEDU(domain);
}
catch (Exception e)
{ e.printStackTrace();
}
} }


VM Args...
+
-Djava.security.auth.login.config="C:\API\jaas.conf.JBoss"
-Djava.naming.provider.url=iiop://host:1099
-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+

Included Jars..
+
jre1.6.0_05.jar
jboss.jar
jbossall-client.jar
jboss-j2ee.jar
log4j-1.2.13.jar
Jace.jar
italics

Error..
*Creating Instance...
Get Connection...
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.
Get Domain...
- Fetch Instance...
com.filenet.api.exception.EngineRuntimeException: API_UNEXPECTED_JNDI_ERROR: An unexpected error occured accessing JNDI.
at com.filenet.apiimpl.util.SessionLocator.locateEJBByPath(SessionLocator.java:789)
at com.filenet.apiimpl.util.SessionLocator.findEJBSessionByPath(SessionLocator.java:724)
at com.filenet.apiimpl.util.SessionLocator.createNewSession(SessionLocator.java:510)
at com.filenet.apiimpl.util.SessionLocator.getSession(SessionLocator.java:133)
at com.filenet.apiimpl.core.IndependentObjectImpl.getObject(IndependentObjectImpl.java:153)
at com.filenet.apiimpl.core.IndependentObjectImpl.refresh(IndependentObjectImpl.java:161)
at com.filenet.api.core.Factory$Domain.fetchInstance(Factory.java:2724)
at com.ibm.filenet.edu.AddToFileNetMain.getDomainEDU(AddToFileNetMain.java:38)
at com.ibm.filenet.edu.AddToFileNetMain.main(AddToFileNetMain.java:95)
Caused by: javax.naming.CommunicationException: Could not obtain connection to any of these urls: iiop://host:8080 and discovery failed with error: javax.naming.CommunicationException: Receive timed out Root exception is java.net.SocketTimeoutException: Receive timed out [Root exception is javax.naming.CommunicationException: Failed to connect to server iiop:1099 Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server iiop:1099 Root exception is java.net.UnknownHostException: iiop]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.filenet.apiimpl.util.SessionLocator.locateEJBByPath(SessionLocator.java:778)
... 8 more
Caused by: javax.naming.CommunicationException: Failed to connect to server iiop:1099 Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server iiop:1099 Root exception is java.net.UnknownHostException: iiop
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
... 12 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server iiop:1099 Root exception is java.net.UnknownHostException: iiop
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243)
... 13 more
Caused by: java.net.UnknownHostException: iiop
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
at java.net.InetAddress.getAddressFromNameService(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:76)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)
... 13 more
*

Has anyone had this error before or know how to help? I have tried including a jndi.properties with pretty much my same VM arguments but nothing seems to work..

Thanks for the help.
Updated on 2012-03-07T01:35:06Z at 2012-03-07T01:35:06Z by Rav81
  • Rav81
    Rav81
    1 Post
    ACCEPTED ANSWER

    Re: FileNet Java API.. Connecting to Content Engine

    ‏2012-03-07T01:35:06Z  in response to SystemAdmin
    How did you solve this problem?

    Thanks.