Java agent error (the page cannot be display)

hi all;i have this agent in java :

import lotus.domino.*;

import com.ibm.as400.access.*;

import java.sql.*;

public class JavaAgent extends AgentBase {

public void NotesMain()

{

try

{

Connection dbConn = null;

Statement st=null;

System.out.println(“3”);

DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());

dbConn = DriverManager.getConnection (“jdbc:as400://” + “ASPBNK01”, “FBSSUSERP”, “FBSSUSERP”);

st = dbConn.createStatement();

String qString=new String();

qString = “SELECT CRBNO FROM ABPDATALIB.RMO”;

ResultSet rs=st.executeQuery(qString);

Session session = getSession();

AgentContext agentContext = session.getAgentContext();

Database db = agentContext.getCurrentDatabase();

Document doc = db.createDocument();

String s;

while (rs.next())

{

doc.appendItemValue(“Form”, “MT_103”);

doc.appendItemValue(“BRANCHCODE”,“ASPBGRAA”);

s = rs.getString(“CRBNO”);

doc.appendItemValue(“RECEIVINGBANK”,s);

doc.save();

}

}

catch(Exception e)

{e.printStackTrace();}

}

}

this agent compiles succesfully and run without buggs but

i have a form with a button and this button calls the agent but everytime i call the agent to run from the form i get “the page cannot be display” and ofcourse nothing works.

can you help me? this agent supposed to create documents with fields from the database.

thank you

ioanna

Subject: java agent error (the page cannot be display)

Are you calling this in WebQuerySave?

Check to make sure that you are running this agent as a web user and that you are signed in with proper authorities if it is essential to run this from a browser. If you are not using input from your form then why not run your agent once or run it on a schedule.

Check your logs for stack traces and add System.out.println statments to your code. Unfortunatly this is the only way to debug Java agents.

I’m not clear on why you are running this agent from a browser.

Jon

jonledrew@hotmail.com