首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >连接到FileNet P8的Lotus notes中的Java代理

连接到FileNet P8的Lotus notes中的Java代理
EN

Stack Overflow用户
提问于 2015-02-03 23:35:37
回答 2查看 940关注 0票数 0

我正在尝试开发一个应用程序在莲花笔记连接到filenetp8,并管理文件。无论如何,我使用的是filenet java api,我确实是从一台远程机器上通过java应用程序进行连接的。当涉及到lotus时,我被卡住了,这是错误输出

代码语言:javascript
复制
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

这是我的代理代码

代码语言:javascript
复制
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();
    }
}

}
EN

回答 2

Stack Overflow用户

发布于 2015-02-26 22:17:26

看看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参数。

或者您可以尝试使用IIOP传输...或者,您可以开发自己的JAAS登录模块,以便从源代码中排除登录名/密码。

票数 0
EN

Stack Overflow用户

发布于 2016-08-18 00:51:20

我知道这是一个老生常谈的问题,但我想,因为我多次遇到同样的问题,所以我必须在某个地方发布答案,所以它就在这里。

代码语言:javascript
复制
ADD 
-Djava.security.auth.login.config=C:\..\..\FileNet\BPMClient\jaas.conf.WebSphere 

添加到服务器的JVM参数

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

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

代码语言:javascript
复制
- 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.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28302788

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档