Lotus Notes API在访问NSF时出现错误 [英] Lotus Notes API giving error while accessing the NSF

查看:102
本文介绍了Lotus Notes API在访问NSF时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用JAVA Lotus Notes API从外部服务器访问Lotus Notes(.nsf)数据,但是在访问NSF时遇到了很多功能的以下错误.

I have been working for accessing the Lotus Notes(.nsf) data from the external server using JAVA Lotus notes API, but I'm getting the following error for Lot of functions while accessing the NSF.

NotesException: Not implemented
  at lotus.domino.cso.Base.notImplemented(Unknown Source)
  at lotus.domino.cso.View.getAllUnreadEntries(Unknown Source)
  at com.lotus.GetName.runNotes(GetName.java:40)
  at lotus.domino.NotesThread.run(Unknown Source)

观察:

  1. 我已经使用类路径(Notes.jar)重新检查了我的设置
  2. 能够访问外部服务器.
  3. 能够在外部服务器上创建Lotus Domino会话

因此,我想请求所有人提供任何建议或解决方案,以解决此问题.

So I would like to request all for any suggestions or solutions to sort out this issue.

感谢您的快速回复.我真的很感激.我正在使用NCSO.jar,是的,我正在进行远程呼叫.我与管理员进行了检查,并要求提供相同的NCSO.jar和Notes.jar.他们使用的服务器是8.5.但是它仍然抛出相同的错误.除此之外,我不知道如何使用eclipse编写和使用Java,因为我完全是Notes Java开发的新手.请尽快帮助我.谢谢.:)

Thanks for your quick reply. I really appreciate that. I am using NCSO.jar and yes i am making remote calls.I checked with my admin and asked for the same NCSO.jar as well as Notes.jar . The server they are using is 8.5 . But it is still throwing the same Error. Apart from that i Dont know how to write and use a java using eclipse as i am completly novice to the Notes Java Development . Please help me as soon as possible . Thanks. :)

我正在使用的代码是:

public class GetName
{
  public static void main(String argv[])
  {
       try
       {

           Database db;

           String ior = NotesFactory.getIOR("****");

             Session s =  NotesFactory.createSessionWithIOR(ior,"****","****");

             db =  s.getDatabase("****","mail/mail1/****");

    View v =  db.getView("$Inbox");

System.out.println(v.getAllUnreadEntries().getCount());// Getting error on this line
}
}

推荐答案

在这里,我将不得不推断一些信息而无需更多信息.首先,该错误表明您正在使用仅在Lotus Notes/Domino 8.5中可用的功能.鉴于该错误显示为未实现",我猜您正在使用的是Notes.jar/NCSO.jar,它没有实现getAllUnreadEntries.我怀疑这个问题是环境问题,而不是您的逻辑.

I'm going to have to infer some things here without more information. Firstly, the error indicates you're using a feature only available in Lotus Notes/Domino 8.5. Given that the error says "not implemented", I would guess that you're using a Notes.jar/NCSO.jar that does not implement getAllUnreadEntries. I suspect this problem is environmental rather than your logic.

检查已导入到项目中的jar文件是否来自Domino 8.5.Domino的Java API的早期版本不支持"getAllUnreadEntries".

Check that your jar files you've imported into your project are from Domino 8.5. Earlier versions of Domino's java API do not support "getAllUnreadEntries".

确保的最佳方法是查找并复制Lotus Notes客户端(位于notes \ jvm \ lib \ ext目录中)中通过defaut安装的jar文件.另外,请确保要针对其进行编译的jar文件与运行时使用的版本相匹配.因此,如果您使用Notes 8.5 jar进行了开发,并且在服务器或客户机上的Domino 7或8.0上运行,则运行时将在尝试运行不存在的方法时产生错误.您需要确保它在8.5上运行.

The best way to make sure is to locate and copy the jar files that are installed (by defaut) in a Lotus Notes client (found in the notes\jvm\lib\ext directory). Also, make sure the jar files you're compiling against match the version you're running with. So, you if you've developed this using Notes 8.5 jar's, and this runs on a Domino 7, or 8.0 on the server or client, the runtime will generate an error trying to run a method that doesn't exist. You'll need to make sure it's running on 8.5.

这是我从Domino Designer帮助中提取的Java代理的示例,该Java代理访问视图中的未读条目.

Here is an example of a java agent I extracted from the Domino Designer help that accesses unread entries in a view.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      View view = db.getView("All");
      ViewEntryCollection vec = view.getAllUnreadEntries();
      System.out.println("View has " +
      vec.getCount() + " unread entries");     
      view.markAllRead();
      view.refresh();
      vec = view.getAllUnreadDocuments();
      System.out.println("View has " +
      vec.getCount() + " unread entries after markAllRead");    
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}

这可能无法完全反映您要执行的操作,因为它对Java代理使用了"AgentBase".但是try语句中的所有内容均适用.听起来好像您在Notes代理之外运行.

This may not exactly reflect what you're trying to do, because it uses "AgentBase" for a java agent. But everything inside the try statement is applicable. Sounds like you're running outside of a Notes agent.

通过确保Notes.jar和NCSO.jar位于类路径中并检查实际使用了哪些导入,可以编写使用Domino-Java API的任何类.如果您不进行远程呼叫,则可以使用Lotus.多米诺骨牌*,而不是lotus.domino.cso.*.

You can write any class that uses the Domino-Java API by making sure Notes.jar and NCSO.jar are in your class path and check which imports are actually being used. If you're not doing remote calls you can just use lotus.domino.*, not lotus.domino.cso.*.

这篇关于Lotus Notes API在访问NSF时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆