Is your library really named: "LIBRARY". If so, then I don't see a
problem. If not, then you need to use the real library name for the
data area. Other than that it looks fine.
You also have the word "SERVERIP" for the IP address. Might want to use
"localhost" or a real ip address.
On your try/catch why don't you spit out the exception message to a log
file or something. This should tell you a lot.
Regards,
Richard Schoen
RJS Software Systems Inc.
"Get the information you need. Now!"
Email: richard@xxxxxxxxxxxxxxx
Web Site:
http://www.rjssoftware.com
Tel: (952) 898-3038
Fax: (952) 898-1781
Toll Free: (888) RJSSOFT
-----Original Message-----
----------------------------------------------------------------------
message: 1
date: Fri, 26 Oct 2007 12:26:17 -0500
from: "Harley Wallis" <harley@xxxxxxxxxx>
subject: DataArea access from domino web server
I have been trying to access both to read and alter a DataArea on the
400 using Domino as a web server.
I have created a form with a single field called "TEST" and a java agent
as the "WebQueryOpen" agent and then access this form with a browser
writing to "TEST" as the code progresses. It stops at the
"dataArea.read()" statement below. Here's the code:
import lotus.domino.*;
import com.ibm.as400.access.*;
public class dataAreaRead extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext ac =
session.getAgentContext();
Document doc =
ac.getDocumentContext();
doc.replaceItemValue("TEST", "A");
AS400 system = new AS400("SERVERIP",
"QNOTES", "QNOTES"); // 270 IP
doc.replaceItemValue("TEST", "B");
String daName = "CTLDTABK"; // name
of the dataarea
doc.replaceItemValue("TEST", "C");
QSYSObjectPathName path = new
QSYSObjectPathName("LIBRARY", daName, "DTAARA");
doc.replaceItemValue("TEST", "D");
CharacterDataArea dataArea = new
CharacterDataArea(system, path.getPath());
doc.replaceItemValue("TEST", "E");
doc.replaceItemValue("TEST",
dataArea.getPath() );
// this prints the following path =
"/QSYS.LIB/LIBRARY.LIB/CTLDTABK.DTAATA"
which is where the object is located.
String daStr = dataArea.read(); //
stops here.
doc.replaceItemValue("TEST", "F");
doc.replaceItemValue("TEST", daStr
);
} catch(Exception e) {
}
}
}
I have restarted the server after placed in the Server INI file the
following line:
JavaUserClasses=/QIBM/ProdData/HTTP/Public/jt400;/QIBM/ProdData/HTTP/Pub
lic/
jt400/lib/db_classes.jar
This has been tested on 2 other fronts with some success using a PC with
Client Access installed:
1. From a Notes Client accessing the database on the server I changed
"replaceItemValues" with java print lines and are able to read the
DataArea in the Java Console.
2. Using a browser to access a local database then going to the 400 I
can read the DataArea.
I just doesn't work when going from Domino to the 400.
What am I missing?
Thanks.
------------------------------
As an Amazon Associate we earn from qualifying purchases.