Lotus中的Java代理说明连接到FileNet P8

时间:2015-02-03 15:35:37

标签: java lotus-notes lotus-domino filenet-p8 filenet-content-engine

我正在尝试在Lotus Notes中开发一个app来连接到filenetp8,并管理文档。 无论如何,我使用的是filenet java api,并且确实通过远程计算机连接,但通过Java应用程序。 anad说到莲花我被卡住了 这是错误输出

log4j:WARN Caught Exception while in Loader.getResource. This may be       innocuous.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.log4j.helpers.Loader.getTCL(Loader.java:154)
at org.apache.log4j.helpers.Loader.getResource(Loader.java:92)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:103)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at org.apache.log4j.Logger.getLogger(Logger.java:104)
at com.filenet.apiimpl.util.BaseLogger.getErrorLogger(BaseLogger.java:507)
at com.filenet.apiimpl.util.BaseLogger.info(BaseLogger.java:388)
at com.filenet.apiimpl.util.ConfigValueLookup.<clinit>(ConfigValueLookup.java:1268)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.filenet.apiimpl.util.BaseLogger.<clinit>(BaseLogger.java:46)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.filenet.api.util.UserContext.<clinit>(UserContext.java:88)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at JavaAgent.<init>(Unknown Source)
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1547)
at lotus.domino.AgentInfo.newInstance(Unknown Source)
at lotus.domino.AgentLauncher.run(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
Caused by: java.security.AccessControlException: Access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessController.throwACE(AccessController.java:100)
at java.security.AccessController.checkPermission(AccessController.java:174)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
at     COM.ibm.JEmpower.applet.AppletSecurity.superDotCheckPermission(AppletSecurity.java:1449)
at COM.ibm.JEmpower.applet.AppletSecurity.checkRuntimePermission(AppletSecurity.java:1311)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1611)
at     COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1464)
at java.lang.Thread.getContextClassLoader(Thread.java:458)
... 27 more
log4j:WARN Caught Exception while in Loader.getResource. This may be innocuous.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.log4j.helpers.Loader.getTCL(Loader.java:154)
at org.apache.log4j.helpers.Loader.getResource(Loader.java:92)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:105)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at org.apache.log4j.Logger.getLogger(Logger.java:104)
at com.filenet.apiimpl.util.BaseLogger.getErrorLogger(BaseLogger.java:507)
at com.filenet.apiimpl.util.BaseLogger.info(BaseLogger.java:388)
at com.filenet.apiimpl.util.ConfigValueLookup.<clinit>   (ConfigValueLookup.java:1268)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.filenet.apiimpl.util.BaseLogger.<clinit>(BaseLogger.java:46)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.filenet.api.util.UserContext.<clinit>(UserContext.java:88)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at JavaAgent.<init>(Unknown Source)
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1547)
at lotus.domino.AgentInfo.newInstance(Unknown Source)
at lotus.domino.AgentLauncher.run(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
Caused by: java.security.AccessControlException: Access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessController.throwACE(AccessController.java:100)
at java.security.AccessController.checkPermission(AccessController.java:174)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
at    COM.ibm.JEmpower.applet.AppletSecurity.superDotCheckPermission(AppletSecurity.java:1449)
at COM.ibm.JEmpower.applet.AppletSecurity.checkRuntimePermission(AppletSecurity.java:1311)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1611)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1464)
at java.lang.Thread.getContextClassLoader(Thread.java:458)
... 27 more
log4j:WARN No appenders could be found for logger   (filenet_error.api.com.filenet.apiimpl.util.ConfigValueLookup).
log4j:WARN Please initialize the log4j system properly.
http://172.17.20.155:9080/wsi/FNCEWS40MTOM
FileNetP8WSI
gci_admin
Passw0rd

Invalid login credentials supplied - please try again
com.filenet.api.exception.EngineRuntimeException: FNRCE0040E:     E_NOT_AUTHENTICATED: The user is not authenticated. Message was: Access denied    (javax.security.auth.AuthPermission createLoginContext.FileNetP8WSI)
at       com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:127)
at com.filenet.api.util.UserContext.createSubject(UserContext.java:288)
at JavaAgent.establishConnection(Unknown Source)
at JavaAgent.NotesMain(Unknown Source)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
Caused by: java.security.AccessControlException: Access denied (javax.security.auth.AuthPermission createLoginContext.FileNetP8WSI)
at java.security.AccessController.throwACE(AccessController.java:100)
at java.security.AccessController.checkPermission(AccessController.java:174)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
at COM.ibm.JEmpower.applet.AppletSecurity.superDotCheckPermission(AppletSecurity.java:1449)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1617)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1464)
at javax.security.auth.login.LoginContext.init(LoginContext.java:247)
at javax.security.auth.login.LoginContext.<init>(LoginContext.java:426)
at com.filenet.apiimpl.core.UserPasswordToken$1.run(UserPasswordToken.java:147)
at java.security.AccessController.doPrivileged(AccessController.java:327)
at com.filenet.apiimpl.core.UserPasswordToken.getPrivilegedLoginContext(UserPasswordToken.java:152)
at com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:112)
... 5 more

这是我的代理商代码

import java.util.Iterator;
import java.util.Vector;

import javax.security.auth.Subject;

import com.filenet.api.collection.ObjectStoreSet;
import com.filenet.api.core.Connection; 
import com.filenet.api.core.Domain;
import com.filenet.api.core.Factory;
import com.filenet.api.core.ObjectStore;
import com.filenet.api.exception.EngineRuntimeException;
import com.filenet.api.exception.ExceptionCode;
import com.filenet.api.util.UserContext;

import lotus.domino.*;

public class JavaAgent extends AgentBase {

public Connection con = null;
public UserContext uc = UserContext.get();
Domain dom = null;
String domainName = null;
ObjectStoreSet ost = null;
Vector<String> osnames = new Vector<String>();
boolean isConnected = false;

public void establishConnection(String userName, String password,
        String stanza, String uri) {
    System.out.println("entree");

    con = Factory.Connection.getConnection(uri);

    Subject sub = UserContext
            .createSubject(con, userName, password, stanza);
    System.out.println("sortie");

    uc.pushSubject(sub);
    dom = fetchDomain();
    domainName = dom.get_Name();
    ost = getOSSet();


}

/*
 * Returns Domain object.
 */
public Domain fetchDomain() {
    dom = Factory.Domain.fetchInstance(con, null, null);
    return dom;
}

/*
 * Returns ObjectStoreSet from Domain
 */
public ObjectStoreSet getOSSet() {
    ost = dom.get_ObjectStores();
    return ost;
}

/*
 * Returns vector containing ObjectStore names from object stores available
 * in ObjectStoreSet.
 */
public Vector<String> getOSNames() {
    if (osnames.isEmpty()) {
        Iterator<?> it = ost.iterator();
        while (it.hasNext()) {
            ObjectStore os = (ObjectStore) it.next();
            osnames.add(os.get_DisplayName());
        }
    }
    return osnames;
}

/*
 * Checks whether connection has established with the Content Engine or not.
 */
public boolean isConnected() {
    return isConnected;
}

/*
 * Returns ObjectStore object for supplied object store name.
 */
public ObjectStore fetchOS(String name) {
    ObjectStore os = Factory.ObjectStore.fetchInstance(dom, name, null);
    return os;
}

/*
 * Returns the domain name.
 */
public String getDomainName() {
    return domainName;
}

public void NotesMain() {

    try {
        Session session = getSession();
        AgentContext agentContext = session.getAgentContext();



        String uri = "http://172.17.20.155:9080/wsi/FNCEWS40MTOM";
        String stanza = "FileNetP8WSI";
        String user = "gci_admin";
        String password = "Passw0rd";

        System.out.println(uri);
        System.out.println(stanza);
        System.out.println(user);
        System.out.println(password);
        // (Your code goes here)

        try {

            establishConnection(user, password, stanza, uri);
            System.out.println(getDomainName());
            System.out.println(getOSNames());

        } catch (EngineRuntimeException e) {
            if (e.getExceptionCode() == ExceptionCode.E_NOT_AUTHENTICATED) {
                System.out
                        .println("Invalid login credentials supplied - please try again");
            } else if (e.getExceptionCode() == ExceptionCode.API_UNABLE_TO_USE_CONNECTION) {
                System.out
                        .println("Unable to connect to server.  Please check to see that URL is correct and server is running");
            } else {
                System.out.println(e.getMessage());
            }
            e.printStackTrace();
        }

    } catch (Exception e) {
        e.printStackTrace();
    }
}

}

2 个答案:

答案 0 :(得分:0)

查看http://www-304.ibm.com/support/knowledgecenter/SSNW2F_5.2.0/com.ibm.p8.ce.dev.ce.doc/gs_concepts_setup_thick_client.htm

您需要查看CEWS传输协议章节。

  1. 检查JAAS配置文件
  2. 检查JVM JAAS参数。
  3. 或者您可以尝试使用IIOP传输...或者您可以开发自己的JAAS登录模块以从源代码中排除登录名/密码。

答案 1 :(得分:0)

我知道这是一个老问题,但我想,因为我遇到了同样的问题,所以很多时候我必须在某处发布答案,所以现在就是这样。

ADD 
-Djava.security.auth.login.config=C:\..\..\FileNet\BPMClient\jaas.conf.WebSphere 

到服务器的JVM参数

=============================================== ===

通过管理员控制台添加JVM ARG的步骤

- In the Administration Console select Servers 
- Expand Server Type and select WebSphere application servers 
- Click on the name of your server 
- Expand Java and Process Management and select Process Definition. 
- Under the Additional Properties section, click Java Virtual Machine. 
- Scroll down and locate the textbox for Generic JVM arguments.