0

i am trying to developp an app in lotus notes to connect to filenetp8, and manage the documents. anyway i was using the filenet java api and did really connect from a distant machine but through a java app. anad when it comes to lotus i'm stuck this is the error output

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

and this is my agent code

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();
    }
}

}
ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
  • Describe your FileNet environment (app srv, db, LDAP, fn version). – Marko Bonaci Feb 04 '15 at 08:22
  • so funny the java security error was fixed just by restarting the lotus machine ! but i still have this one com.filenet.api.exception.EngineRuntimeException: FNRCE0040E: E_NOT_AUTHENTICATED: The user is not authenticated. Message was: Aucun LoginModule configuré pour FileNetP8WSI i think the problem is in lotus , is ther a way to configure JAAS in lotus ? – Khaled Kacem Feb 04 '15 at 10:29

2 Answers2

0

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

You need to look at CEWS transport protocol chapter.

  1. Check the JAAS configuration file
  2. Check the JVM JAAS params.

Or you can try to use IIOP transport ... or you can develop your own JAAS login module to exclude login/password from source code.

swepss
  • 481
  • 3
  • 9
0

I know this is an old question, but i thought because i have ran into this same issue soo many times i have to post the answer somewhere, so here it is.

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

to the JVM arguments of the server

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

STEPS TO ADDING THE JVM ARG THROUGH ADMIN CONSOLE

- 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.
pam kaur
  • 11
  • 1