Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in CreateUser

Status
Not open for further replies.

smallredville

Programmer
Aug 18, 2008
115
SG
Hi All,

Recently I tried to test the CreateUser() which I got from KB.

However when I ran it in my image, I got the following errors:

statustext : Error creating new user
errtext : OnTime: Could not communicate with the OnTime Calendaring service. (-1)

Hope somebody who has any idea, can share with me on how to deal with this error message.

Many thanks in advance,
smallredville

///////////////////////////////////////////////////////////
Code is shown below:
///////////////////////////////////////////////////////////

import com.opentext.api.*;

public class createUser
{
// Declare some constants for the user and group to add
// In production, your code would read a file where this information is stored.
public static final String USER_NAME = "imauser";
public static final String USER_PASS = "livelink";
public static final String USER_FIRST = "Ima";
public static final String USER_LAST = "User";
public static final String USER_GROUP = "All_Athena_Users";

public static void main( String[] args )
{
try
{
// Declare some local fields
LLSession session;
int status;

// Get the session - Hard coded here but you may want to prompt the user
session = new LLSession( "localhost", 2099, "", "Admin", "password" );
LAPI_USERS users = new LAPI_USERS( session );

// Declare some value objects
// Note that some have their type declared and some do not. Why?

LLValue userData = ( new LLValue() ).setAssocNotSet();
LLValue id = ( new LLValue() );
LLValue row = ( new LLValue() ).setAssocNotSet();

// There are more fields in row than these. What are they?
//row.add( "LastName", USER_LAST );
//row.add( "FirstName", USER_FIRST );

// Create the user if you can.
// You may wish to call the GetUserInfo() method to test for the
// existence of this user before creating. CreateUser() will fail
// if the user already exists.
status = users.CreateUser( USER_NAME, USER_PASS,
LAPI_USERS.PRIV_LOGIN | LAPI_USERS.PRIV_UAPI_SESSION |
LAPI_USERS.PRIV_DAPI_SESSION | LAPI_USERS.PRIV_WAPI_SESSION | LAPI_USERS.PRIV_PERM_WORLD,
userData, LAPI_USERS.GROUP, USER_GROUP, row, id );

if ( status != 0 )
{
String statustext = session.getStatusMessage();
String errtext = session.getErrMsg();
String apitext = session.getApiError();
System.out.println("statustext : " + statustext);
System.out.println("errtext : " + errtext);
System.out.println("apitext : " + apitext);
System.out.println( "\nERROR: " + statustext + "\n" + errtext + "\n" + apitext );
} else {
System.out.println( "\nSUCCESS: New user " + USER_NAME + " has been added" );
}
}
catch ( Throwable e )
{
String x = e.getClass().getName();
String s = e.getMessage();
e.printStackTrace();
}
} // end main
}
 
This is an error indicating that OnTime is not correctly working on the server you are connecting to. OnTime is a calendaring application that OpenText provide and it synchronises with Livelink and vice versa, when a user is created in Livelink it is pushed to OnTime to create the matching account in there.

Can you create the user via the webbrowser on the same server ? Is the OnTime service up and working ?

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top