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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when fetching folders and documents recursive 1

Status
Not open for further replies.

ahaenle

Programmer
Apr 28, 2005
4
DE
I am trying to fetch documents and folders recursive from some folders. For this I wrote a little program in Java.

When I start the programm it works a few times fine, but then suddenly it doesn't function anymore. If it fails then I get one of these following messages.

-get(name) not implemented for this datatype
-enumerateValues() not implemented for this datatype
[/color red]
After that I can't connect to Livelink for up to several hours.

Status: -2147482645
StatusMessage: Could not connect.

But with IE there is no problem connecting LL.

Could it be that I have to close the Connection?
I couldn't find a function which will do this.

If anybody knows something about this please help.
I already searched in the opentext discussion, but I couldn't find a solution

thanks
 
The error is coming from the lapicall.You need to understand,put debugging stuff in your code to figure out that.For eg:in your code you musthave done fetchversion.Have you done any serious debugging here.Surely you are calling the fetchversion for objectsubtype=144.If your code recurses and finds a bunch of items(projects,tasklists,documents,compounddocuments) under a folder and it encounters a fetchversion for objectsubtype other than 144 ,the lapi call will try to do fetchversion and you will get errors.First make sure you have the program flow right
Also to rule that out you can put a filter in your listobjects call for documentsubtye which is akin to calling(select * from dtree where subtype=144 connect by parentid start with <your recursivefolderid>),the sql may not be correct but to give you an idea.

LAPI calls whenever possible should be done with good debugging techniques because when a session is established it is tying a thread on your server and may get freed only by a restart

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Thank you appnair for your response.

But I think you have misunderstood.
I can use my program a few times. So I know that it does what it should.
But after this few times it ends with one of the errors and at the next use of the program, it can't connect to Livelink for up to several hours.
So I only get the errors once and then the connection establishment isn't possible.

I think the problem has to be on the server side. You've written that when a session is established it is tying a thread on my server and may get freed only by a restart of the server.
Isn't there a possibility to tell Livelink to close outdated connection threads?

I'm using Livelink 9.5 and also LAPI 9.5.0.0.
 
-get(name) not implemented for this datatype
-enumerateValues() not implemented for this datatype
From my experience I could be dead wrong here
But usually these errors are coming from simple(silly)
mistakes like you are getting a huge output recarray and
the enumerator is going wrong.Enumeration should be done
knowing the type of the object.PrintTypeTree is a great enumerator and can be found in the KB,in greggriffiths
site,in almost all my coding I use Glenn's enumerator class.
From what you describe it looks like a hung lapiconnection I am not sure if livelink recovers or times out
I hope I am not offending you.I have written LAPI programs that scans 1000's and 1000's of documents (upload,download,versioning)
and am yet to see lapi errors that are really the server's fault.Surely there is a lot of documentation errors in lapi.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Can there be a mistake in my code when I use the same test data for every testing? I am only fetching some MsWord documents.
 
Who is the lapi user involved 'Admin' or another user.
Are you using tunneling through ad or anything like that.
Do you see a pattern where it is failing or is it random ?
Would like me to see your code or is it too complex?

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Also one more test to rule out problems with the code is to run your LAPI call in a lapi only server(configure another livelink instance and allow lapi traffic only).That way you can rule out thread contention and backlog.One more thing I would do is to not use LLsession pooling(even though I write this,I don't know how to do it,so I pretty much do everything very simple) because LAPI is not thread safe.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
I am using the 'Admin' user.
I don't use tunneling through or anything like that.
I think it fails randomly.

I have more than one class and a lot of methods so I show you only the relevant methods.


/**
* Filters all documents, puts these documents in a vector
* and returns this vector
*/

public Vector getAllDocuments(int parentFolderID, int
volumeID, LAPI_DOCUMENTS documents) throws Exception
{
int docsAnz = 0;
int objAnz = 0;
LLValue node = new LLValue();
documents.ListObjects(volumeID, parentFolderID, "DTree", null, LAPI_DOCUMENTS.PERM_FULL, node);

sleep(2000); // sleeps 2s, that there won't be to much requests in short time

LLValueEnumeration enumVal = node.enumerateValues();
Vector valElements = new Vector();

while ( enumVal.hasMoreElements() )
{
LLValue element = (LLValue) enumVal.nextElement();

objAnz++;

int subType = element.toInteger("SubType");
if ( subType == 144 || subType == 145 )
{
valElements.add(element);

String name = element.toString("Name");
int volId = element.toInteger("VolumeId");
int id = element.toInteger("ID");
int pid = element.toInteger("ParentID");

System.out.print("- " + name + " (id=" + id + ";pid=" + pid + ";type=" + subType + ")\n");
docsAnz++;
}
}
System.out.print("Dokumente insgesamt: " + docsAnz + "(von " + objAnz + " Objekten)\n");
return valElements;
}


/**
* Fetches recursive documents from given folder id
*/

public void fetchAllFoldersWithDocs(int parentFolderID, int volumeID, LAPI_DOCUMENTS documents, String path) throws Exception
{
//download all documents from current folder
fetchAllDocumentsOfFolder(parentFolderID, volumeID, documents, path);
//get Subfolders
Vector foldersLLValue = getAllFolders(parentFolderID, volumeID, documents);

//goes into the folders from current folder
for ( int i = 0; i < foldersLLValue.size(); i++ )
{
LLValue element = (LLValue) foldersLLValue.get(i);

int volID = element.toInteger("VolumeId");
int id = element.toInteger("ID");
String name = element.toString("Name");

System.out.print("\nFolder: " + name + " ParentID: " + id + " VolumeID: " + volID + "\n");

fetchAllFoldersWithDocs(id, volID, documents, path + File.separator + name + File.separator);
}
}

I hope these are the relevant methods you wished to see.
 
Could not find anything wrong with the calls and
public Vector getAllDocuments(int parentFolderID, int
volumeID, LAPI_DOCUMENTS documents) throws Exception
this worked fine in my install.
Sorry am stumpted.Post this in OT and have Hans Giger or paul huelskamp take a look
I couldn't test this out because
public void fetchAllFoldersWithDocs(int parentFolderID, int volumeID, LAPI_DOCUMENTS documents, String path) throws Exception
{
I am missing an inner function.
Also you can do thsi for getting subtype=144 documents
documents.ListObjects(volumeID, parentFolderID, "DTree", "subtype=144", LAPI_DOCUMENTS.PERM_FULL, node);

If you post your email I will send you my java file and some dbugging info
Good Luck




Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
So how did you finally figure this out ?

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top