• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Cause of Error is Not Identified

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following Java agent which runs on my client, but not on a server. I've excluded some lines of code that aren't relevant here. However, I've included all the error handling code because one of the problems I've encountered is that no error message is written to a log database and it's not apparent why.

In the middle of the code is the comment 'DOES NOT EXECUTE' which identifies the line causing the problem, but all that the log database shows is the prior line ('Point A') and not the following line ('Point B'). I'd expect to see an error such as 'XfoObj class not found'. Our server admin has verified that there is sufficient memory while the agent runs.

I'd appreciate any ideas on why the cause of the error is not being identified by the error handling code. Thanks.
_____________________________

import lotus.domino.*;
import java.io.*;
import java.util.*;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import jp.co.antenna.XfoJavaCtl.*;

class ErrDump implements MessageListener {

public void onMessage(int errLevel, int errCode, String errMessage) {
System.out.println("ErrorLevel = " + errLevel + "\nErrorCode = " + errCode + "\n" + errMessage);
}
}

public class JavaAgent extends AgentBase {
public void NotesMain() {

try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Database db = agentContext.getCurrentDatabase();
RichTextItem foStreamItem = null;
String foXML = null;
try {
foStreamItem = (RichTextItem) db.getView
("Vw_lookup").getDocumentByKey("FO").getFirstItem
("Stream");
foXML = foStreamItem.getText();
} catch (NotesException ne) {
ne.printStackTrace();
}

if ( foXML != null ) {
XfoObj axfo = null;
ByteArrayInputStream is = null;
ByteArrayOutputStream os = null;
try {
System.out.println("Point A");
axfo = new XfoObj(); /* <= DOES NOT EXECUTE /*
System.out.println("Point B");

ErrDump eDump = new ErrDump();
axfo.setMessageListener(eDump);
axfo.setExitLevel(4);
}
catch (XfoException e) {
System.out.println("ErrorLevel = " +
e.getErrorLevel() + "\nErrorCode = " +
e.getErrorCode() + "\n" + e.getErrorMessage());
return;
}
catch (Exception e)
{
e.printStackTrace();
return;
}
finally
{
try {
axfo.releaseObjectEx();
}
catch (XfoException e) {
System.out.println("ErrorLevel = " + e.getErrorLevel()
+ "\nErrorCode = " + e.getErrorCode() + "\n" +
e.getErrorMessage());
return;
}
try {
is.close();
} catch (Exception e) {}
try {
os.close();
} catch (Exception e) {}
}
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm... I don't know. But I did some formatting to look at this, so I'll post that with Code Tags to make it more inviting for the next person. (Nice to see someone else using Lotus Notes. )

[ June 15, 2006: Message edited by: marc weber ]
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic