I've a Lotus Script agent which usage Script library which is having Lotus Script classes and those classes are used in the agent.
Sometimes agent unable to include the script library so the line where I create an object of the class gets failed. It throws "Type mismatch on external name" error.
To fix this, I only require to re-save the agent. It doesn't happen frequently but once or twice in a month. How to get rid of this problem ?
A week ago I've asked this question on stackoverflow.com and surprisingly didn't receive any response.
I'm going to get involve ( may be fully ) in deploying customized SharePoint application on our development server.I will sure post my experience with how to do steps.
Meanwhile,I'm really interested to know someone's else experience :)
From past couple of days I'm working on a prototype project in which pdf form fields should be accessed using Domino Java.
There are couple of tasks involved in this project ,
* Designing user interface in pdf and
* Reading fields data using Java
I have struggle a lot to accomplish these tasks so I thought to blog it for my other fellow LN developers.Designing user interface in pdf
To design user interface in pdf , You may choose any of these following options,1- Using iText Java API: IText for Java API provides handful of methods to design user interface in pdf.It's like a old Java AWT methods where you need to calculate coordinates to place your objects.It's not very precise and takes lots of time to design simple interface.Don't go with it if you want to design complex form.
2- Adobe LiveCycle Designer: I've tried with trial version of this tool and found it allows you to design user interface and save it.But,You can't edit it in Adobe reader. For that, You must "Distribute" the form after saving.Distribution option is disabled in trial version and this option remain disabled if you are using stand alone version of this tool ( which I got from net).Adobe LiveCycle designer is integrated with Adobe Acrobat Pro.
3- Adobe InDesign: This can be used to design acro pages but you must use Adobe Acrobat Pro to convert designed page into Acrobat form.You can refer following link to design form in InDesign,
InDesign CS3, In Good Form
4- Adobe Acrobat Pro: I'm using this and it fits perfectly to my need. Here is my sample form designed using Adobe Pro where information can be added and saved.,Reading fields data using Java
To accomplish this,I've used iText for Java API which seems only way to communicate easily with pdf objects.
Since I'm not using iText to design pdf interface so accessing existing pdf using iText is pretty straight forward.
As this project goes, I will write more about it.
I prefer to keep my jars in Archive folder
But some bloggers says better to keep in \jvm\lib\ext\ path.
I'm testing my project on my client later it will work as scheduler.So, I tried to remove my jar from "Archive" folder and placed in following path on my local ,
Restarted my client and recompiled my code, It stop detecting Oracle driver class and suggested following,
Next, I thought to set in Java build path. So, I added my jar in Libraries->Add external jars of project properties. Now, I was able to compile my code but when ran it throws an error "Class is missing".
So, Now I'm again back to my working solution i.e., adding jars in archive folder of an agent.It works perfectly on my client but when I tried making it as a scheduler . It didn't work and server console says,
Should I assume it's because agent is not able to detect "odbc.jar" ?
But some bloggers say "Java.lang.UnsupportedClassVersionError: Bad version number" because when you compile a .java file with one version of JDK and running the .class file with a different version of JVM.
I'm compiling my code on 8.5.1 and server is 8.0.1 ( Linux OS ).
What I would like to know ,
* Where should I keep my jars for client or server based Domino Java apps ?
* If domino client and server are not using same JDK version, How do I make sure my compile code works perfectly on any Domino server?
In my last post ( http://planetlotus.org/735190 ), I've mentioned adding JavaDebugString=-XX:MaxPermSize=256M in my workstation's notes.ini increased the heap size.But,it doesn't seems true when I tested with following piece of code ,
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
//Get the jvm heap size.
long heapSize = Runtime.getRuntime().totalMemory();
//Print the jvm heap size.
System.out.println("Heap Size = " + heapSize);
} catch(Exception e) {
e.printStackTrace();
}
}
It says 16777216 in both the cases. Does this setting only works on server's ini file or something wrong with my settings ? So, here are still my unanswered questions,
* How do I increase heap size of Java agents on client or server machine ?
* I assume increasing heap size may affect server performance, So is it possible to increase for just one agent or database ?
I've tried changing HTTPJVMMaxHeapSize but no effect.
I'm in process of aligning my Java agent which mainly does two tasks, One to create Oracle table based on Oracle table configuration domino form and second to push Lotus Notes documents to Oracle.
Unfortunately I haven't used recycle () correctly which leads memory leak and then overflow error. Once I get "Overflow" error, I can't run my Java agent. Every time I try it says same error doesn't matter if I try only with ,
System.out.println("hello world");
I thought if I restart my domino server it will kill hanged threads but I get same error even if I restart my domino server. However, when I restart my client it fixed the problem. So my question are,
* How does Java threads are connected to Notes client?
* How to kill Java threads without restarting Domino server?
Demonstration of recycle method in designer help is fairly simple but how to use efficiently in little complex classes. Here is simple example,
Places where I've used recycle method is commented with "my assumptions".Let me know my mistakes or suggest me better way to design classes.
JavaAgent.java
--------------------------------------------
import lotus.domino.*;
public class JavaAgent extends AgentBase
{
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Database db = agentContext.getCurrentDatabase();
...
Animal cat= new Animal(session);
cat.findDetails(session);
/* my assumptions */
session.recycle();
db.recycle();
/*-------------*/
}
catch(Exception e) {
e.printStackTrace();
}
}
}
Animal Class
-----------------------------------------------
import lotus.domino.*;
import java.sql.*;
public class Animal {
/* find details method */
public String findDetails(Session session) throws Exception
{
try{
Database A= session.getDatabase(db.getServer(), "A");
getCatFromDb("A");
removeCat();
...
/* my assumptions */
conn.close(); //created in constructor
stmt.close(); // created in getCatFromDb
rs.close(); // created in getCatFromDb
A.recycle(); //created in findDetails
db.recycle(); // created in constructor
/*----------*/
}
catch(Exception e)
{
e.printStackTrace();
}
}
/* Start Constructor */
Animal (Session session)throws Exception {
try {
AgentContext agentContext = session.getAgentContext();
db = agentContext.getCurrentDatabase();
conn=...external driver...
...some stuffs from db...
Document doc = db.getProfileDocument("config","");
...some stuffs from doc...
...jdbc connection here...
...
}
catch(Exception e)
{
e.printStackTrace();
}
} // end Constructor
/* getCatFromDb method */
public void getCatFromDb(Database dbPath){
try{
View v=dbPath.getView("A");
if(v!=null)
{
Document doc= v.getFirstDocument();
while (doc != null)
{
..some stuffs from external db like
creating statement,recordset etc ...
doc = v.getNextDocument(doc);
}
}
}catch(Exception e){e.printStackTrace();}
}
public void removeCat() {
// some stuffs here..
}
}
Any clue about this error ? Please note, I'm not doing anything to handle attachments.
My Java console says , "java.lang.OutOfMemoryError"
I'm recycling session and database once agent is done. Here is some piece of code,
Some more updates , code even doesn't execute very first "system.out.println.." line
Updates:
Adding following in workstation's notes.ini solved the problem,
JavaDebugString=-XX:MaxPermSize=256M
Any consequences in performance if I go with following setting ?
To further continue on my problem ( http://planetlotus.org/6a6c9c ),I'm seeking best possible way to build and pass xml of Notes document to third party application.I can't use view directly to generate xml because view contents needs to be updated each time when user use filter conditions.
I've been fighting with Lotus Notes limit issue from past couple of days. I'm building xml file from notes documents and passing them to non domino application.
In my first "How do you do" xpages learning series I learned how to execute client side simple Java Script on xpages , Thanks to Tim Tripcony who shared interesting work around.
Actually I was trying to execute existing LS dashboard agent on xpage using client side Java Script to draw a chart. Lets see how I've done,
1- Created a new JavaScript script library with client side JavaScript which contains my xmlhttp module to call Lotus Script agent.
2- I've my Lotus Script agent ready which have logic to build flash charts ( Fusion Charts )
3- Created button "Draw Chart" on xpage and added JavaScript function "drawChart()" which is inside my JavaScript library.
You might notice I've selected "Server" tab instead "Client" one , Just following Tim's advice.
4- Open source of xpage and add your Client side JavaScript library reference .

To add Server side JavaScript library reference instead of ".js" use ".jss" and clientSide="false"
5- As per Tim's advice add additional tags in source,
6- Switch to "Design" view of your xpage and notice now code is moved into "Client" tab ( though we have started with "Server" tab )
Here is my desire output on the web when button is clicked ,
Few days ago I was working on "Flex builder" and it's interesting to see xpages development is very similar to flex development. Those who knows either of these can accelerate really fast.
It's very common to see new articles and tips about xpages in planet Lotus every day. Today I thought to make myself familiar with xpages. To do so I thought to try with very popular and simple program alerting "Hello World" when xpage loads .
Here is what I've tried,
When I view my xpage on web got something like ,
I'm using 8.5.1 designer with 8.5 server . Any clue ?
Is it the right way to execute client side JavaScript on xpages ?
Just started my day with a cup of coffee and Google news and found an article in zdnet about some Microsoft market strategy.I don't get much interest in reading non technical stuffs but something is quite noticeable in this article.
"In a briefing earlier this week, Ron Markezich, corporate VP, Microsoft Online Services told me that most of his team’s customer wins are at the expense of the IBM division: “Seventy-five percent of our enterprise customers are coming from a non-Microsoft platform — predominantly [Lotus] Notes.”
What only I care , Is this a correct figure ? If it is then It's serious concern for Lotus Notes professionals , But if not then what..
I would say F**k off Microsoft, don't spoil my day !
In my last article, I've demonstrated how designer 8.5.1 can be used to connect SVN environments within domino designer for version controls.
In this series, I'm going to show how designer 8.5.1 can be used to test Web Services in simple steps using SoapUI within Lotus Notes. Those who haven't done much in web services can follow my last article ( Web Services implementation in Domino ) and I would discuss the same flight booking availability web service here. So lets skip the code and other details which I've added in the last article only Web Service testing part will be discussed.
You may notice I've used Eclipse WTP to test my web service in earlier article. Let's check how SoapUI plugin with Domino designer 8.5.1 can used to test Web Services.
First step would be to install SoapUI plugin from http://www.soapui.org/eclipse/update/site.xml update site. Other details will be the same as mentioned in the last article. Once installation is done you can see SoapUI plugin in application location like below,
Now go to designer and change your perspective to SoapUI,

Create new SoapUI project ,
Specify project name and WSDL file location,
Once you have done with wizard you should get following hierarchy ( It may differ if you generate TestSuite and MockService ).
Double click on "Request 1" to open SOAP request window,
You may notice there are some question marks in XML tag which denotes SOAP request needs argument to generate SOAP response. My flight booking web service takes four arguments Travel start date, Travel end date, Travel from and Travel to. I will pass the arguments as per my sample documents.
Pass your arguments and click on green arrow button . Here are both the results,

Drop me an e-mail for the database discussed in the article.
Stay tune for more...
I was trying to find if we could do version controlling in Domino without using any paid software (something like Teamstudio). I had a curiosity if Eclipse having tight integration with the Concurrent Versions System (CVS) and Subversion (SVN), so can domino 8.5.1 provides the same? To keep this in mind I've started my R&D and found some possibilities. Here they are,
My first task was to find the way to enable Subclipse ( Subclipse is a project to add Subversion support to the Eclipse IDE )in domino designer. In Eclipse it can be achieved easily using Help->Software Updates menu option but it's not available in designer 8.5.1
However designer 8.5.1 has this feature hidden ( not completely the same as Eclipse ). To enable this feature you need to add following line in plugin_customization.ini file which is located at \Notes\framework\rcp path.
com.ibm.notes.branding/enable.update.ui=true
You must need to start designer after modification. Now here is your Install option,
Next task to enable Subclipse. Steps are,
Use Subclipse update site "http://subclipse.tigris.org/update_1.0.x"





Once done you will be asked to restart Notes
Now go to designer and change your perspective to SVN Repository
Add new SVN repository ( For demo I'm connecting to Subclipse site where SVN is setup),
Login id is : guest and password is space.
Once connected you can see existing repositories from SVN server,
To create version on SVN server use Team->Share Project option,



Stay tune for more..
