klehmann / domino-jna Goto Github PK
View Code? Open in Web Editor NEWJava project to access the IBM/HCL Domino C API using Java Native Access (JNA)
License: Apache License 2.0
Java project to access the IBM/HCL Domino C API using Java Native Access (JNA)
License: Apache License 2.0
Just downloaded the 0.9.9 version from this link. Extracted the downloaded ZIP and imported the plugin in my updatesite.nsf database. Restarted the http task, but the plugin doesn't load: a tell http osgi ss com.mindoo
on the server returns a blank list. Any ideas?
Tested on CentOS 6 64, Domino 901 FP9.
Dear klehmann,
trouble you again. we encounter following error when convert an email with a gif image. the gif image which must be an animation image. (e.g. sample gif )
I think it should be IBM API's bug.
com.mindoo.domino.jna.errors.NotesError: HTMLAPI Problem converting to HTML (error code: 14941, raw error with all flags: 14941)
at com.mindoo.domino.jna.errors.NotesErrorUtils.toNotesError(NotesErrorUtils.java:53)
at com.mindoo.domino.jna.errors.NotesErrorUtils.checkResult(NotesErrorUtils.java:26)
at com.mindoo.domino.jna.NotesNote.convertHtmlElement(NotesNote.java:4089)
at com.mindoo.domino.jna.NotesNote.convertHtmlElement(NotesNote.java:4032)
at com.mindoo.domino.jna.NotesNote$HtmlConversionResult$1.writeImage(NotesNote.java:4231)
Hello Klehmann,
Thank you very much for your work.
Could you illustrate an example of using such functionality as "reading categorized views with expanded/collapsed entries"?
For example, if I need to go over all the entries of a fully expanded navigator with collapsed entries only 1.1.1, 10.3 and 20.
Another example, if I need to go over all the entries of a fully collapsed navigator with expanded entries only 2.10.1, 5.8 and 10.
Thanks
I need a way to connect to db from already connected one,
I have part already connected to notes by standard lotus.domino.Database so instead of writing the credentials and file path again
to this library,
I suggest to provide new constructor from NotesDatabase to accept lotus.domino.Database object and internally you will take the needed info
Hi Klehmann,
Is it possible run java (standalone) program on domino server host (linux)?
currently I've tried, but receive error:
Initializing Domino JNA with mode Direct
com.mindoo.domino.jna.errors.NotesError: Could not open the ID file (error code: 6402, raw error with all flags: 6402)
on NotesDatabase dbData = new NotesDatabase(session, "", "fakenames.nsf");
java environment variables are:
-DNOTESINI=/local/notesdata/notes.ini -DNOTESDATA=/loca/notes/data -Duser.dir=/local/notesdata
java.library.path=/opt/ibm/domino/notes/latest/linux
thanks in advance
Mike
Hello Klehmann,
I did:
NotesDatabase dbData = new NotesDatabase...; NotesCollection colFromDbData = dbData.openCollectionByName...; String searchQuery = "error"; NotesFTSearchResult res = colFromDbData.ftSearch(searchQuery, 0, EnumSet.of(FTSearch.NUMDOCS_ONLY));
But this ftSearch returns 0 num docs always.
Will the ftSearch work if the database is not built index (legacy will be)?
How to use the specific sorting when performing a ftSearch?
Can you give an examples?
Thanks
I run in some strange bug yesterday:
When processing a big NSF-file (~30GB), my program hangs when it tries to get the item "$MessageID" using the method "getItemValueString". This happens when the Form-Type is a "Notice" or an "Appointment". After implementing a workaround my programm can process the whole file with about 100k documents.
I've built an OSGi plugin which runs on the Domino server and provides a JAX-RS REST API. Some operations must start existing LotusScript business logic in the context of the user which is done by calling an agent. This all works well but I have some unexplainable performance issues when using domino-jna in production. First issue was the initialization of domino-jna and I've moved it to the OSGi Activator and that's ok so far.
But I've still some performance issues. I've added trace logs and seen there getting a database or an agent can take up to 3...4 seconds. Another few seconds to create a note or attach attachments to it. Next time calling the same REST API endpoint the execution of the same operations which have taken multiple seconds before runs then within a few milliseconds. I have no idea what is taking so long to create a new note for example.
To show you the basics of what I've done I added the code snippet and a sample log of an execution below. As you see, the log below shows only a time gap when attaching files to the note. But as I sad, I've seen gaps in other logs like this while getting the database or getting the agent.
Do you have an idea what is causing this bad performance?
@Override
protected void executeAgent(String user) throws Exception {
LOG.debug("Starting execute");
try {
LOG.trace("Starting domino-jna with auto GC processing");
String prints = NotesGC.runWithAutoGC(() -> {
LOG.trace("Getting database");
NotesDatabase ndb = getDatabase(user);
LOG.trace("Getting agent");
NotesAgent ag = getAgent(ndb, user);
LOG.trace("Create note");
NotesNote note = ndb.createNote();
for (Attachment attachment : files) {
LOG.trace("Attach file {} to note", attachment.getFileName());
note.attachFile(attachment, attachment.getFileName(), attachment.getCreated(), attachment.getModified());
}
for (Map.Entry<String, Object> param : params.entrySet()) {
LOG.trace("Setting agent param {} with value {}", param.getKey(), param.getValue());
note.replaceItemValue(param.getKey(), param.getValue());
}
LOG.trace("Prepare agent run context");
Writer printWriter = new StringWriter();
NotesAgentRunContext narc = new NotesAgentRunContext();
narc.setDocumentContextAsNote(note);
narc.setUsername(user);
narc.setCheckSecurity(true);
narc.setOutputWriter(printWriter);
LOG.trace("Execute agent run");
ag.run(narc);
LOG.trace("Agent execution completed");
note.update();
return printWriter.toString();
});
} finally {
LOG.debug("Agent execution completed");
}
}
2020-10-30 09:53:46,539 DEBUG Starting execute
2020-10-30 09:53:46,539 TRACE Starting domino-jna with auto GC processing
2020-10-30 09:53:46,539 TRACE Getting database
2020-10-30 09:53:46,539 TRACE Getting agent
2020-10-30 09:53:46,539 TRACE Create note
2020-10-30 09:53:46,539 TRACE Attach file mailbody.html to note
2020-10-30 09:53:50,976 TRACE Setting agent param att_targetfield with value sys_attachment
2020-10-30 09:53:50,992 TRACE Setting agent param sys_bcid with value 1
....
Hi am looking for guidance on a pet project. I noticed that your project can perform rich text to HTML conversions. My project is based on using C / C++. How can I use your Java project with my current code?
Can you send me an email at [email protected] with your response?
Thanks,
I wanted to know if I can use this project in a java web application ? (spring, java ee, etc).
Is it possible to prevent server console output when I run an agent with NotesAgentRunContext and a Writer set?
I access legacy LotusScript web agents from an OSGi bundle and grab the generated prints with an StringWriter but I don't want that the output is printed on the server console what at the moment is the case.
I'm deeply impressed about the functionality and that is the last puzzle piece for a perfect solution for me.
Anyway, a big thank you for your work
See topic:
Is there an equivalent to the legacy-API-method "getAllDocuments()"? At that moment i'm using the following code (Short version):
List<NotesCollectionSummary> collections = db.getAllCollections();
for (NotesCollectionSummary collection : collections) {
NotesCollection view = db.openCollectionByName(viewName);
LinkedHashSet<Integer> noteIDs = view.getAllIds(Navigate.NEXT_NONCATEGORY);
for (Integer noteId : noteIDs) {
NotesNote note = db.openNoteById(noteId);
}
}
Is there a better and faster way to go through all documents sequentially?
When improting the project into Eclipse, NotesViewEntryData shows an error in line 446 on
return Collections.emptyIterator();
From what I found, Ie should be something like
return Collections.<String> emptyList().iterator();
instead.
Hi, I deployed Domino JNA on a Verse enabled server and we're getting this error. I've not seen requirements for java.policy changes related to Domino-JNA.
Is this something known or possibly a real side-effect of deplyoing Domino-JNA on a Verse enabled servers.
Note: Current Domino-JNA version 0.35 -> Pending ugprade to 0.39
7/28/20 6:48 PM: Exception Thrown com.ibm.pim.sequoia.osgi.servlets.NoAccessSignalError at com.ibm.pim.sequoia.osgi.servlets.UserInfo.generateUserInfoCacheKey(UserInfo.java:406) at com.ibm.pim.sequoia.osgi.servlets.UserInfo.getUserInfo(UserInfo.java:446) at com.ibm.pim.sequoia.osgi.servlets.SequoiaResourceServlet.doGet(SequoiaResourceServlet.java:146) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at com.ibm.domino.xsp.adapter.osgi.OSGIModule.invokeServlet(OSGIModule.java:167) at com.ibm.domino.xsp.adapter.osgi.OSGIModule.access$0(OSGIModule.java:153) at com.ibm.domino.xsp.adapter.osgi.OSGIModule$1.invokeServlet(OSGIModule.java:134) at com.ibm.domino.xsp.adapter.osgi.AbstractOSGIModule.invokeServletWithNotesContext(AbstractOSGIModule.java:181) at com.ibm.domino.xsp.adapter.osgi.OSGIModule.doService(OSGIModule.java:128) at com.ibm.domino.xsp.adapter.osgi.OSGIService.doService(OSGIService.java:418) at com.mindoo.domino.jna.xsp.http.DominoJNAHttpService$2.call(DominoJNAHttpService.java:76) at com.mindoo.domino.jna.xsp.http.DominoJNAHttpService$2.call(DominoJNAHttpService.java:1) at com.mindoo.domino.jna.gc.NotesGC$1.run(NotesGC.java:537) at java.security.AccessController.doPrivileged(AccessController.java:678) at com.mindoo.domino.jna.gc.NotesGC.runWithAutoGC(NotesGC.java:532) at com.mindoo.domino.jna.xsp.http.DominoJNAHttpService.doService(DominoJNAHttpService.java:68) at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:357) at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313) at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
Thanks in advance.
NotesNote.java line 142 ff
original:
if (NotesJNAContext.is64Bit()) { notesAPI.b64_NSFNoteGetInfo(m_hNote64, NotesCAPI._NOTE_ID, retOid); } else { notesAPI.b64_NSFNoteGetInfo(m_hNote32, NotesCAPI._NOTE_ID, retOid); }
must be :
if (NotesJNAContext.is64Bit()) { notesAPI.b64_NSFNoteGetInfo(m_hNote64, NotesCAPI._NOTE_OID, retOid); } else { notesAPI.b64_NSFNoteGetInfo(m_hNote32, NotesCAPI._NOTE_OID, retOid); }
Domino JNA should detecty automaticly if it runs in an unsupported environment like AIX and throws an exception than.
com.mindoo.domino.jna.internal.NotesJNAContext.getNotesAPI() would be a good place.
Hi Klehmann,
An error occurred when calling writeImage method if the mail contained images in nested reply mails. I have attached a .nsf file for your reference.
Let's see if you have any idea for the issue.
Here are the error log and the reference code
IHtmlImageRef image = null;
String imgSrc = inlineIcon.attr("src");
for (int i = 0; i < images.size(); i++) {
if (images.get(i).getReferenceText().equalsIgnoreCase(imgSrc)) {
image = images.get(i);
break;
}
}
String imgCID = java.util.UUID.randomUUID().toString();
String fileName = inlineIcon.attr("alt");
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
System.out.println("filename:"+ fileName);
if (image != null) {
image.writeImage(byteArrayOutputStream);
}
byteArrayOutputStream.flush();
byte[] originalImg = byteArrayOutputStream.toByteArray();
byteArrayOutputStream.close();
Seems to happen if the view that's being read doesn't have any sorting. Stacktrace:
04-01-2018 20:29:07 HTTP JVM: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
04-01-2018 20:29:07 HTTP JVM: at java.util.ArrayList.rangeCheck(ArrayList.java:664)
04-01-2018 20:29:07 HTTP JVM: at java.util.ArrayList.get(ArrayList.java:440)
04-01-2018 20:29:07 HTTP JVM: at com.mindoo.domino.jna.NotesCollection.scanColumnsNew(NotesCollection.java:2884)
04-01-2018 20:29:07 HTTP JVM: at com.mindoo.domino.jna.NotesCollection.scanColumns(NotesCollection.java:2847)
04-01-2018 20:29:07 HTTP JVM: at com.mindoo.domino.jna.NotesCollection.getColumnNames(NotesCollection.java:2801)
04-01-2018 20:29:07 HTTP JVM: at com.mindoo.domino.jna.NotesViewEntryData.getColumnNames(NotesViewEntryData.java:510)
04-01-2018 20:29:07 HTTP JVM: at com.mindoo.domino.jna.NotesViewEntryData.getColumnDataAsMap(NotesViewEntryData.java:538)
(I'm using the latest release: 0.9.10)
HI! I would like to contribute with this project by offering a translation of any PR in to Spanish (My native language). Let me know if you're interested!
looking for a way to issue an empty ($Trash) view command, or programmatically delete the notes in the trash view
addEntry()
and removeEntry()
force name to canonical. But updateEntry()
is missing a call to NotesNamingUtils.toCanonicalName(name)
before converting to a memory.
Compare https://github.com/klehmann/domino-jna/blob/master/domino-jna/src/main/java/com/mindoo/domino/jna/NotesACL.java#L661 and https://github.com/klehmann/domino-jna/blob/master/domino-jna/src/main/java/com/mindoo/domino/jna/NotesACL.java#L613
Hi,
I'm currently trying to use a newer version of Domino-JNA. It seems that since version 0.9.28 richtext-handling is broken.
Version 0.9.27
System.out.println(note.getRichtextContentAsText("Body"));
--> (See attached file: 1234.pdf) - 1234.pdf
System.out.println(note.getItemValue(("Body")));
-> com.mindoo.domino.jna.errors.UnsupportedItemValueError: Use NotesNote.getRichtextNavigator() to read richtext item data
Version 0.9.28 and above:
System.out.println(note.getRichtextContentAsText("Body"));
--> Empty string
System.out.println(note.getItemValue(("Body")));
-> java.lang.NegativeArraySizeException: -136
Hi Klehmann,
Thank you for the excellence library.
I notice that there's a problem in the original Domino Java API, where inline image cannot be retrieved. I am wondering can we read it with this great library? And can you give us a sample of doing it?
Regards
Server is Domino 9.0.1/64 FP9 on Win
The last update from 04-JAN-2017 does not crash the server right after DOTS start. But I am still having problems when running DirectoryScanner .
here is the stripped down code that I use
public class ScannerManager extends BaseJNA {
private List<SearchResultData> searchResultData;
private ConfigProvider configProvider = ConfigProvider.getInstance();
public void run() {
runWithSession(new IDominoCallable<Object>() {
@Override
public Object call(Session session) throws Exception {
try {
if (configProvider.isUpdateExecutor()) {
ServerTaskManager.getInstance().logMessageText(strTask + Constants.TASK_ACTIVITY_PROCESSING);
configProvider.getConfiguredServers();
DirectoryScanner scanner = null;
for (Server server : configProvider.getServersList()) {
scanner = new DirectoryScanner(server.getServerName(), null,
EnumSet.of(FileType.ANYNOTEFILE, FileType.RECURSE));
searchResultData = scanner.scan();
ServerTaskManager.getInstance()
.logMessageText(strTask + String.format(" App count: %d", searchResultData.size()));
scanner = null;
}
ServerTaskManager.getInstance().logMessageText(strTask + Constants.TASK_ACTIVITY_FINISHED);
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
});
}
}
Here is what happens on the console
te dots apptool scanner run
[0EFC:0002-1818] 01/05/2018 07:44:35 AM [DOTS] application.tool - Scanner Task processing ...
[0EFC:0002-1818] 01/05/2018 07:44:39 AM [DOTS] application.tool - Scanner Task App count: 182
[0EFC:0002-1818] 01/05/2018 07:44:42 AM [DOTS] application.tool - Scanner Task App count: 162
[0EFC:0002-1818] 01/05/2018 07:44:42 AM [DOTS] application.tool - Scanner Task finished.
Then, after 30 seconds the server goes down. No evidence on the console, what is going wrong.
The NSD only gives some vague hint about an unhandled exception and that DOTS terminated abnormally.
@[ 8] 0x7FF9FE050657 nnotes.OSNTUnhandledExceptionFilter+423 (13b8a7b0,7FF9FF50E630,13b8d810,13b8a4f6)
Parameter 1: 13b8a7b0 30A8B813 00000000 00000000 00000000 | 0... .... .... .... | 13b8a7c0 00000000 00000000 00000000 00000000 | .... .... .... .... | Parameter 2: ff50e630 50414E49 433A2025 73000000 00000000 | PANI C: % s... .... | ff50e640 4E4F5445 535F4150 49444556 00000000 | NOTE S_AP IDEV .... | Parameter 3: 13b8d810 50726F63 65737320 433A5C50 726F6772 | Proc ess C:\P rogr | 13b8d820 616D2046 696C6573 5C49424D 5C446F6D | am F iles \IBM \Dom | 13b8d830 696E6F5C 6E646F74 732E4558 45202833 | ino\ ndot s.EX E (3 | 13b8d840 3833362F 30784546 43292068 61732074 | 836/ 0xEF C) h as t | 13b8d850 65726D69 6E617465 64206162 6E6F726D | ermi nate d ab norm | 13b8d860 616C6C79 00000000 0A000200 00000000 | ally .... .... .... | Parameter 4: 13b8a4f6 00000000 0000 | .... .. | 13b8a4fc 00000000 39E650FF F97F0000 38E650FF | .... 9.P. .... 8.P. | 13b8a50c F97F0000 29C98803 0000 | .... )... .. |
@[ 9] 0x7FF9FDFED227 nnotes.Panic+1047 (efc,125820C00252535,13b8d8e0,e)
I am getting some errors when building via mvn, apparently I am missing something?
Cloned this from the current master branch... but I can´t see the mentioned class in package
com.mindoo.domino.jna.internal.structs
PS C:\domino-jna\domino-jna> mvn -DJVMPARAMS= -DDOMINOOSGIDIR="C:\Program Files (x86)\HCL\Notes\osgi" -DDOMINODIR="C:\Program Files (x86)\HCL\Notes" -DNOTESINI="C:\Program Files (x86)\HCL\Notes\notes.ini" clean install
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.mindoo.domino:domino-jna >--------------------
[INFO] Building Domino JNA 0.9.40
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ domino-jna ---
[INFO] Deleting C:\domino-jna\domino-jna\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ domino-jna ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ domino-jna ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 317 source files to C:\domino-jna\domino-jna\target\classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/NotesSearch.java: Some input files use or override a deprecated API.
[WARNING] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/NotesSearch.java: Recompile with -Xlint:deprecation for details.
[WARNING] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/richtext/FieldInfo.java: Some input files use unchecked or unsafe operations.
[WARNING] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/richtext/FieldInfo.java: Recompile with -Xlint:unchecked for details.
[INFO] 4 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/utils/IDUtils.java:[23,46] cannot find symbol
symbol: class KFM_PASSWORDStruct
location: package com.mindoo.domino.jna.internal.structs
[ERROR] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/internal/INotesNativeAPI.java:[4,46] cannot find symbol
symbol: class KFM_PASSWORDStruct
location: package com.mindoo.domino.jna.internal.structs
[ERROR] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/internal/INotesNativeAPI.java:[485,43] package KFM_PASSWORDStruct does not exist
[ERROR] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/internal/NotesNativeAPI64.java:[13,65] package com.mindoo.domino.jna.internal.structs.KFM_PASSWORDStruct does not exist
[ERROR] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/internal/INotesNativeAPI64.java:[6,46] cannot find symbol
symbol: class KFM_PASSWORDStruct
location: package com.mindoo.domino.jna.internal.structs
[ERROR] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/internal/NotesNativeAPI64.java:[1528,69] cannot find symbol
symbol: class ByReference
location: class com.mindoo.domino.jna.internal.NotesNativeAPI64
[ERROR] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/internal/INotesNativeAPI64.java:[1833,43] package KFM_PASSWORDStruct does not exist
[ERROR] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/internal/NotesNativeAPI.java:[25,65] package com.mindoo.domino.jna.internal.structs.KFM_PASSWORDStruct does not exist
[ERROR] /C:/domino-jna/domino-jna/src/main/java/com/mindoo/domino/jna/internal/NotesNativeAPI.java:[812,67] cannot find symbol
symbol: class ByReference
location: class com.mindoo.domino.jna.internal.NotesNativeAPI
Thank you very much for your amazing contribution.
I encounter an encoding issue when extract mailbody as HTML , all Chinese characters display as question marks("??????").
is this library not support non-English languages?
Thanks!
Hi Karsten,
I have a categorized view. One of the categories is named SKIBSVÆRFT B/C. So it has the Æ character and a slash in it.
When I use JNA to get the entries in that category I get the wrong results when using one of the getXXInCategory() functions. Tested it with v0.42:
The standard API also returns the correct results when I use createViewNavFromCategory()
Is this a bug? Or am I doing something wrong?
Attachment file name in most of cases is correct and in case of duplicate filename
file name will be like : file1.002.docx/file1.docx so i can get the first part of the name
but
some attachments filename will be like : ATT8TYAQ.docx/testFile.docx
ATT7B4UN.xlsx/testFile2.xlsx and there are no duplicate in attachment names
so the actual file name is the second part.
so what is the problem for these files and is there common way to get the needed name ?
First of all, great stuff.
Did you ever find a way to use the column name instead of the progamatical name to get the value from a view column?
I see an issue when you use the method with an application where you do not have control of the design.
You can never be sure, that the programatical name will never change.
I propose to use the name View instead of NotesCollection, because every Java Developer will looks for NotesDatabase.openView(...) or NotesDatabase.getView(...) instead of NotesDatabase.[get|open]Collection(...). NotesCollection ius the C name, but view is the well known name, I think.
When you add an interface View, that is implemented by NotesCollection, and add some methods, e.g. NotesDatabase.openView(...), than this should easy to implement, without break running code
Hello Klehmann,
I would like to confirm if this library support Notes 8.5?
We have encountered some JNA initialization error under Notes 8.5.
Thanks,
KeniZhou
The above method puts out the following exception since version 0.9.30. Version 0.9.29 works.
Initializing Domino JNA with mode Classic
com.mindoo.domino.jna.errors.FormulaCompilationError: . , line=0, column=0, offset=0, length=5, formula=@True
IBM Domino (r) Server (64 Bit) (Release 9.0.1FP7HF370 for Linux/64) 13.01.2018 09:41:48
Linux serv02.fritz.box 3.10.0-693.1.1.el7.x86_64 #1 SMP Thu Aug 3 08:15:31 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
DirectoryScanner crashes on RHEL while scanning databases on a remote server.
com.mindoo.domino.jna.errors.NotesError: Error searching database at com.mindoo.domino.jna.NotesSearch.search(NotesSearch.java:559) at com.mindoo.domino.jna.NotesSearch.searchFiles(NotesSearch.java:237) at com.mindoo.domino.jna.NotesDatabase.searchFiles(NotesDatabase.java:2086) at com.mindoo.domino.jna.directory.DirectoryScanner.scan(DirectoryScanner.java:67) at com.mindoo.domino.jna.directory.DirectoryScanner.scan(DirectoryScanner.java:52) at de.eknori.dots.manager.ScannerManager$1.call(ScannerManager.java:104) at de.eknori.dots.BaseJNA$1.call(BaseJNA.java:55) at com.mindoo.domino.jna.gc.NotesGC.runWithAutoGC(NotesGC.java:481) at de.eknori.dots.BaseJNA.runWithSession(BaseJNA.java:51) at de.eknori.dots.manager.ScannerManager.run(ScannerManager.java:66) at de.eknori.dots.tools.Commands._apptool(Commands.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at com.ibm.dots.internal.OSGIConsoleAdaptor.runCommand(OSGIConsoleAdaptor.java:288) at com.ibm.dots.task.ServerTaskManager._processCommand(ServerTaskManager.java:669) at com.ibm.dots.task.ServerTaskManager.processCommand(ServerTaskManager.java:630) Caused by: com.mindoo.domino.jna.errors.NotesError: Error converting date/time value from GMT to local zone: [5767168, 83886086] at com.mindoo.domino.jna.utils.NotesDateTimeUtils.innardsToCalendar(NotesDateTimeUtils.java:287) at com.mindoo.domino.jna.utils.NotesDateTimeUtils.timeDateToCalendar(NotesDateTimeUtils.java:57) at com.mindoo.domino.jna.internal.ItemDecoder.decodeTimeDate(ItemDecoder.java:87) at com.mindoo.domino.jna.internal.NotesLookupResultBufferDecoder$ItemValueTableData.getItemValue(NotesLookupResultBufferDecoder.java:525) at com.mindoo.domino.jna.internal.NotesLookupResultBufferDecoder$ItemTableData.asMap(NotesLookupResultBufferDecoder.java:1002) at com.mindoo.domino.jna.directory.DirectoryScanner$1.noteFound(DirectoryScanner.java:75) at com.mindoo.domino.jna.NotesSearch$1.invoke(NotesSearch.java:440) at com.mindoo.domino.jna.internal.NotesNativeAPI64.NSFSearchExtended3(Native Method) at com.mindoo.domino.jna.NotesSearch$2.run(NotesSearch.java:538) at com.mindoo.domino.jna.NotesSearch$2.run(NotesSearch.java:534) at java.security.AccessController.doPrivileged(AccessController.java:413) at com.mindoo.domino.jna.NotesSearch.search(NotesSearch.java:534)
Hi,
currently i'm using the Domino Java API to open and extract e-mails from locally stored nsf-files.The Domino server is not running on my development system and i use "notes.jar" directly:
Here is some code which i use to open a nsf-file:
NotesThread.sinitThread();
Session session = NotesFactory.createSession();
Database db = this.session.getDatabase(null, filename, false);
List<View> views = this.db.getViews();
...
Is it possible to use "domino-jna" for local database-files? I've tried your sample application but i can't get it running.
I am using DirectoryScanner with
int fileType = NotesCAPI.FILE_ANYNOTEFILE + NotesCAPI.FILE_RECURSE;
in a DOTS tasklet.
when starting DOTS, I get the following error message / stack trace
java.lang.IllegalStateException: Duplicate handle detected. Object to store: NotesNamesList [handle=422, values=[CN=serv01/O=singultus, serv01, *, */O=singultus, LocalDomainServers, LocalDomainRelays, NotesServers]], object found in open handle list: NotesDatabase [handle=422, server=, filepath=bcc\adt\cgweb.nsf]
at com.mindoo.domino.jna.gc.NotesGC.__objectCreated(NotesGC.java:45)
at com.mindoo.domino.jna.utils.NotesNamingUtils.buildNamesList(NotesNamingUtils.java:323)
at com.mindoo.domino.jna.NotesDatabase.(NotesDatabase.java:212)
at com.mindoo.domino.jna.NotesDatabase.(NotesDatabase.java:112)
at com.mindoo.domino.jna.NotesDatabase.(NotesDatabase.java:86)
at de.eknori.dots.manager.ScannerManager$1$1.entryRead(ScannerManager.java:99)
at com.mindoo.domino.jna.directory.DirectoryScanner$1.noteFound(DirectoryScanner.java:128)
at com.mindoo.domino.jna.NotesDatabase$1.invoke(NotesDatabase.java:1486)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:485)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:515)
at com.sun.jna.Native.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:384)
at com.sun.jna.Function.invoke(Function.java:323)
at com.sun.jna.Library$Handler.invoke(Library.java:236)
at com.sun.proxy.$Proxy29.b64_NSFSearch(Unknown Source)
at com.mindoo.domino.jna.NotesDatabase.search(NotesDatabase.java:1574)
at com.mindoo.domino.jna.directory.DirectoryScanner.scan(DirectoryScanner.java:52)
at de.eknori.dots.manager.ScannerManager$1.call(ScannerManager.java:119)
at com.mindoo.domino.jna.BaseJNA$1.call(BaseJNA.java:60)
at com.mindoo.domino.jna.gc.NotesGC.runWithAutoGC(NotesGC.java:174)
at com.mindoo.domino.jna.BaseJNA.runWithSession(BaseJNA.java:56)
at de.eknori.dots.manager.ScannerManager.scanDirectory(ScannerManager.java:79)
at de.eknori.dots.manager.ScannerManager.run(ScannerManager.java:62)
at de.eknori.dots.runonstart.ScannerTask$1.doRun(ScannerTask.java:68)
at de.eknori.dots.runonstart.ScannerTask$1.doRun(ScannerTask.java:63)
at de.eknori.dots.tools.DominoRunner.runWithSession(DominoRunner.java:89)
at de.eknori.dots.runonstart.ScannerTask.doRun(ScannerTask.java:63)
at com.ibm.dots.task.AbstractServerTaskExt.run(AbstractServerTaskExt.java:47)
at com.ibm.dots.task.JobTaskService$ServiceTaskJob.doRun(JobTaskService.java:137)
at com.ibm.dots.task.JobTaskService$ServiceTaskJob.run(JobTaskService.java:100)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
All subsequent ( periodic ) runs do not throw an exception.
I am sorry to bother you again.
The inline image works like magic but now I am having issue with rich text field attachment and section. The section seems to be a missing linkage and I cannot find a way to get embedded object like the image. Please shed some light on me.
Would it be possible to execute a Lotusscript code block from within jna?
Headlines are meant to attract you ;)
I was so excited when I found your project!!!
I've decided to refactor my NotesUtil, which is used to export .nsf
data in a standard format.
In addition, as the title says, have you ever experienced a JVM crash when call IBM Notes API?The dependency I introduced earlier is Notes.jar
, provided by IBM. Especially when exporting old NSF templates, it happens with extraordinary frequency.It makes me very confused and depressed....
The above are just a few complaints, if you also have no train of thought can be ignored :P
Thank you for your project!
Hi, Thanks for great repo. I have cloned this repo and run the standalone app. And found problem like this
mvn -DJVMPARAMS=-d64 -DDOMINOOSGIDIR=/Applications/HCL\ Notes.app/Contents/MacOS -DDOMINODIR=/Applications/HCL\ Notes.app/Contents/MacOS -Djava.library.path=/Application/HCL\ Notes.app/Contents/MacOS -DNOTESINI=~/Library/Preferences/Notes\ Preferences exec:java -Dexec.mainClass=com.mindoo.domino.jna.samples.standaloneapp.DominoJNAStandaloneSampleApp
Initializing Domino JNA with mode Classic
com.mindoo.domino.jna.errors.NotesError: Error initializing Domino JNA API
at com.mindoo.domino.jna.internal.NotesNativeAPI.get(NotesNativeAPI.java:254)
at com.mindoo.domino.jna.utils.NotesInitUtils.notesInitExtended(NotesInitUtils.java:44)
at com.mindoo.domino.jna.samples.standaloneapp.DominoJNAStandaloneSampleApp.main(DominoJNAStandaloneSampleApp.java:69)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'notes': Native library (darwin/libnotes.dylib) not found in resource path ([file:/Users/forte/Workspace/standalone-app-sample/target/classes/, file:/Users/forte/.m2/repository/com/mindoo/domino/domino-jna/0.9.24/domino-jna-0.9.24.jar, file:/Users/forte/.m2/repository/org/elasticsearch/jna/4.5.1/jna-4.5.1.jar, file:/Users/forte/.m2/repository/com/drewnoakes/metadata-extractor/2.11.0/metadata-extractor-2.11.0.jar, file:/Users/forte/.m2/repository/com/adobe/xmp/xmpcore/5.1.3/xmpcore-5.1.3.jar, file:/Users/forte/.m2/repository/cglib/cglib/3.2.6/cglib-3.2.6.jar, file:/Users/forte/.m2/repository/org/ow2/asm/asm/6.0/asm-6.0.jar, file:/Users/forte/.m2/repository/org/apache/ant/ant/1.9.6/ant-1.9.6.jar, file:/Users/forte/.m2/repository/org/apache/ant/ant-launcher/1.9.6/ant-launcher-1.9.6.jar, file:/Users/forte/.m2/repository/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.4.2/concurrentlinkedhashmap-lru-1.4.2.jar, file:/Users/forte/.m2/repository/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jar, file:/Users/forte/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar])
This is not really an issue with domino-jna but an addition:
You can use domino-jna and "Notes.jar" with Java 11 when using the libraries "glassfish-corba-omgapi" and "glassfish-corba-orb" which replace the deprecated Corba implementation from Java 8.
They work as a drop in replacement. Just put them as a dependency to your project and you can use Java 11. They are no caveats. I've processed about 2TB of databases and ~150 million documents using Java 11.
Dependency for Gradle
compile group: 'org.glassfish.corba', name: 'glassfish-corba-orb', version: '4.2.1'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
I need sample code to get document fields and how to convert rich text fields to html along with thier attachment and note that rich text might have inline images
Is there a way to get subforms related to a specific form?
In standard notes. jar I can get any subform by name using Database.getForm but
I didn't find any linkage between form and related subforms
viewEntry.getUNID()
is always null. Also
viewEntry.toString()
does not include unid. ( This works as designed in NotesViewEntryData ) :)
if (m_unid!=null) { sb.append(",unid="+m_unid); }
Isn't this
fileObject.HostType = fileObject.HostType;
a little bit scary?
I am currently extracting file like doc/excel via dataNote.getItems() then override the callback to retrieve all the document. Is it possible to extract attachment like images? I found it difficult to update the HTML reference string to the latest file path, unless using static which is not desirable. One issue with the reference link to the attachment is, if you have two attachment with the same name, the reference link will become /DBNAME/0/UNID/$File/ then without duplication only have the name test1.docx with duplication will turn the link to test1.001.docx/test1.docx.
On the other side, the IHtmlApiReference could not recognise the reference object as an attachment but just a HREF.
What do the various error codes the exception "NotesError" throws mean? I'm getting for example the the error code "418" but i have no idea what this code means.
Good day!
There is an error (HTTP 502) following the download link provided in README for the test databases
Kind regards
Sven
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.