Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  IBM Sametime Forum

IBM Sametime Forum

developerWorks

  

PreviousPrevious NextNext

RE: Sametime Server Toolkit - Access not privileged
Mohar H Bhise 24.Nov.03 10:21 PM a Web browser
Deverloper Toolkits 3.0 Windows NT/2000


Thanks Everyone. Your suggestions worked perfectly and I am able to login as a server application.

There is one more issue however.

The method evt.getAttrList() returns null rather than returning the buddylist Vector.

public void attrQueried(StorageEvent evt)
{
log(">> attribute queried code = " + Integer.toHexString(evt.getRequestResult()) );
if (evt.getAttrList() == null)
log("***** Attr List is null");
log("vector is null" + (v == null));
}

I get an exception that vector v is null.

I wait for the Storage Service to be available, before resolving the username. It seems that everything goes fine till here and the username is resolved. Then I query for attribute 0 using:
m_storageService.queryAttr(m_user, 0);

The attrQueried event is fired. I get an result code of ST_FAIL (80000000) in this event. I then get a null value for evt.getAttrList().

I have tried this experiment for different users.

Here is a more detailed code snippet:
void initSametime()
{
try
{
m_session = new STSession("" + this );
loadComponents();
m_session.start();
}
catch (DuplicateObjectException e) {}

LookupService lookup = (LookupService) m_session.getCompApi(LookupService.COMP_NAME);
m_resolver = lookup.createResolver(true, false, true, false);
m_resolver.addResolveListener(this);
log(">> Initializing Sametime ....Phase 1 Done");
m_saService = (ServerAppService) m_session.getCompApi(ServerAppService.COMP_NAME);
m_storageService = (SAppStorageService) m_session.getCompApi(SAppStorageService.COMP_NAME);
m_tokenService = (SATokenService) m_session.getCompApi(SATokenService.COMP_NAME);
m_tokenService.addTokenServiceListener(this);
m_blService = (BLService) m_session.getCompApi(BLService.COMP_NAME);
log(">> Initializing Sametime ....Phase 2 Done ");
log (">> Logging into Server ......");
loginToServer(servername);
doPost();
log(">> Finished initialization of Sametime");
}

private void loginToServer(String serverName)
{
m_saService.addLoginListener(this);
short loginType = STUserInstance.LT_SERVER_APP;
Connection[] connections = {
new SocketConnection(port, 17000)};
m_saService.setConnectivity(connections);

log(">> login to sametime server name is " + serverName);
m_saService.loginAsServerApp( serverName, loginType, "ddd", null);
try
{
synchronized(this)
{
log(">> Waiting ....see if log in event returns control back");
wait();
}
}
catch (InterruptedException e)
{
log(">> CAught Interrupted Exception");
}
log(">> Yes, control returned");
}


public void loggedIn(LoginEvent event)
{
log(">> loggedIn to Sametime Server "+ Integer.toHexString(event.getReason()) );
m_storageService.addStorageServiceListener(this);
synchronized(this)
{
notify();
}
}
public void loggedOut(LoginEvent event){ }

public void serviceUnavailable(StorageEvent evt){ }

public void serviceAvailable(StorageEvent evt)
{
log(">> Storage service available");
synchronized(this)
{
notify();
}
}

public void doPost()
{
log(">> Inside doPost....");
m_userName = username;
log(">> do post user name is " + m_userName);
synchronized(this)
{
try
{
log(">> waiting for storage service to be available");
wait();
}
catch (InterruptedException e)
{}
}

resolveUserName();
synchronized(this)
{
try
{
log(">> waiting for user name to be resolved");
wait();
}
catch (InterruptedException e)
{}
}
log(">> creating response...");
createResponse();
}

private void resolveUserName()
{
log(">> Resolving user name....");
m_resolver.resolve(m_userName);
log(">> Invoked the Resolver");
}

public void resolved(ResolveEvent event)
{
log(">> User Name Resolved");
STObject obj = event.getResolved();
m_user = new STUser(obj.getId(), m_userName, "", "") ;
log(">> " + m_user.getDisplayName());
log(">> Trying to query user attribute...");
if(m_user == null) {log(">> m_user is NULL");}
m_storageService.queryAttr(m_user, query_no);
log(">>Sent a query...");
}

public void resolveConflict(ResolveEvent event) { log("***** resolvedConflict"); }
public void resolveFailed(ResolveEvent event) { log("***** resolvedFailed reason = " + event.getReason() ); }


public void attrQueried(StorageEvent evt)
{
log(">> Got a Storage event inside attrQueried");
log(">> attribute queried code = " + Integer.toHexString(evt.getRequestResult()) );
if (evt.getAttrList() == null)
{
log("***** Attr List is null");
}

Vector v = evt.getAttrList();
log("vector is null" + (v == null));
STAttribute attr = (STAttribute) v.elementAt(0);
log("attr is null" + (attr == null));
m_buddylist = attr.getString();
log("m_buddylist is null" + (m_buddylist == null));
log(">> generate token");
m_tokenService.generateToken(m_user);
synchronized(this)
{
notify();
}
}

public void attrUpdated(com.lotus.sametime.storage.StorageEvent se) {log(">> Storage attr updated successfully"); }
public void attrStored(StorageEvent evt) { log("***** Storage attr Stored"); }
public void requestFailed(StorageEvent evt) { log("***** Storage request failed reason = " + evt.getRequestResult()); }


public void tokenGenerated(TokenEvent event)
{
log(">> token generated");
m_token = event.getToken();
synchronized(this)
{
log(">> wake up call");
notify();
}
}


public void generateTokenFailed(TokenEvent event) { log("***** Storage request failed = " + event.getReason() ); }
private void createResponse() { writeBuddyList(); }


Can anyone please help me find a possible bug, or is it some other issue?

I am running sametime server on default ports. Thank you.

Regards, MHB




Sametime Server Toolkit - Access no... (Mohar H Bhise 22.Nov.03)
. . RE: Sametime Server Toolkit - Acces... (Carl Tyler 22.Nov.03)
. . RE: Sametime Server Toolkit - Acces... (Brett van Gelde... 24.Nov.03)
. . . . RE: Sametime Server Toolkit - Acces... (Mohar H Bhise 24.Nov.03)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite