• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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 ]
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic