简体   繁体   English

Lotus Notes Classess在Sametime中插入插件-整个故事

[英]Plugin inside Sametime with Lotus Notes Classess - The Whole Story

It's gonna be a long read so Thanks for being patient :). 这将是一本长篇小说,所以感谢您耐心等待:)。

I have been trying to develop a plugin to be executed inside Lotus Sametime. 我一直在尝试开发一个在Lotus Sametime中执行的插件。 The idea of this plugin is to extract the calendar entries for a given date and then display it in sametime. 该插件的想法是提取给定日期的日历项,然后同时显示它。 Simple isn't it, i thought so too. 很简单,我也这么认为。 Apparently I was wrong and grossly misunderstood the JVM version compatibility issues. 显然我错了,严重误解了JVM版本兼容性问题。 I first did an independent test in the default Java 1.6 and it worked fine, I got the entries and got the code ready to move to the Sametime Development environment. 我首先在默认的Java 1.6上进行了独立测试,并且工作正常,我获得了条目并准备好将代码移至Sametime开发环境。

I moved to the plugin development environment to insert my code.My first issue came, when I added the Notes.jar to the External jar list and the import lotus.domino line. 我转到插件开发环境中插入代码。我的第一个问题是将Notes.jar添加到外部jar列表和import lotus.domino行中。 The IDE told me this IDE告诉我这个

The type org.omg.CORBA.UserException cannot be resolved. It is indirectly referenced from required .class files

After some googling , i referenced the ibmorbapi.jar in the project and got it running. 进行一些谷歌搜索后,我在项目中引用了ibmorbapi.jar并使其运行。 Unfortunately for me even that didn't work out. 对我来说不幸的是,即使那没有解决。 The plugin itself failed to load and this is what i got 插件本身无法加载,这就是我得到的

    java.lang.NoClassDefFoundError: lotus.notes.Session
 at java.lang.J9VMInternals.verifyImpl(Native Method)
 at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
 at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
 at java.lang.Class.newInstanceImpl(Native Method)
 at java.lang.Class.newInstance(Class.java:1244)
 at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:157)
 at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:759)
 at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
 at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
 at com.ibm.collaboration.realtime.imhub.ImHub.loadMiniAppExtensions(ImHub.java:416)
 at com.ibm.collaboration.realtime.imhub.ImHub.getMiniApps(ImHub.java:356)
 at com.ibm.collaboration.realtime.imhub.workbench.ImHubWorkbenchWindowAdvisorShelf.transformMiniApps(ImHubWorkbenchWindowAdvisorShelf.java:354)
 at com.ibm.collaboration.realtime.imhub.workbench.ImHubWorkbenchWindowAdvisorShelf.createWindowContents(ImHubWorkbenchWindowAdvisorShelf.java:179)
 at org.eclipse.ui.internal.WorkbenchWindow.createContents(WorkbenchWindow.java:938)
 at org.eclipse.jface.window.Window.create(Window.java:426)
 at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:805)
 at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1453)
 at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1404)
 at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:190)
 at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:708)
 at org.eclipse.ui.internal.Workbench.init(Workbench.java:1101)
 at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1863)
 at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
 at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
 at com.ibm.collaboration.realtime.ui.WorkbenchAdapter.createAndRunWorkbench(WorkbenchAdapter.java:103)
 at com.ibm.collaboration.realtime.ui.WorkbenchAdapter.run(WorkbenchAdapter.java:85)
 at com.ibm.collaboration.realtime.application.RTCApplication.run(RTCApplication.java:765)
 at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
 at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:211)
 at java.lang.reflect.Method.invoke(Method.java:272)
 at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
 at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
 at org.eclipse.core.launcher.Main.run(Main.java:977)
 at org.eclipse.core.launcher.Main.main(Main.java:952)

Since that was not gonna work. 因为那是行不通的。 I thought why not create the NotesCalendarExtraction part into a separate jar execution file and get a xml file with the calendar entries in it and then give it to the plugin to show the entries. 我想为什么不将NotesCalendarExtraction部分创建到一个单独的jar执行文件中,并获取一个包含日历项的xml文件,然后将其提供给插件以显示这些项。 I know it was not the best solution but i was desperate and wanted to get this working. 我知道这不是最好的解决方案,但是我很拼命,想让它正常工作。 In anycase, the idea kinda worked well when I had hardcoded the jar file and and the path to the generated xml file. 无论如何,当我对jar文件和生成的xml文件的路径进行硬编码时,这个想法有点奏效。 Btw I was executing the jar file using the getRuntime.exec module in java. 顺便说一句,我正在使用Java中的getRuntime.exec模块执行jar文件。 Time came to get it running generically and unfortunately for me the exec module was not accepting spaces in its path so program files was out of question. 是时候让它普遍运行了,不幸的是,对于我来说exec模块未在其路径中接受空格,因此程序文件毫无疑问。 I was not sure if this was right method but then the jar as such was not executing either for some reason. 我不确定这是否是正确的方法,但由于某种原因,这样的jar也不执行。 I tried putting in a bat file with the appropriate command line parameters and it generated the xml when executed in the command line but not when running from the eclipse ide for reasons known only to the IDE. 我尝试放入带有适当命令行参数的bat文件,并在命令行中执行时生成了xml,但从Eclipse IDE运行时却生成了xml(仅出于IDE已知的原因)。 I was out of options at this point and I got my hands on another plugin which did exactly the same thing with regard to getting the calendar entries. 在这一点上,我没有选择,我开始使用另一个插件,该插件在获取日历条目方面做的完全相同。 I decompiled plugin and checked out the source code and saw the code was using a class loader to do the job. 我反编译了插件,并签出了源代码,发现代码正在使用类加载器来完成这项工作。 A new hope got into me when i saw this code. 当我看到这段代码时,我有了新的希望。 After some googling i put together some code which did the job for me. 经过一番谷歌搜索后,我整理了一些代码对我有用。 Time came for the acid test, i put the code into the plugin env and this is what I got. 进行酸性测试的时间到了,我将代码放入了env插件中,这就是我得到的。

    !ENTRY org.eclipse.ui 4 0 2009-09-27 22:05:55.996
!MESSAGE (org/omg/CORBA/UserException) bad major version at offset=6
!STACK 0
java.lang.UnsupportedClassVersionError: (org/omg/CORBA/UserException) bad major version at offset=6
 at java.lang.ClassLoader.defineClassImpl(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:246)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:109)
 at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1028)
 at java.net.URLClassLoader$4.run(URLClassLoader.java:549)
 at java.security.AccessController.doPrivileged(AccessController.java:213)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:547)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:625)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:582)
 at java.lang.ClassLoader.defineClassImpl(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:246)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:109)
 at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1028)
 at java.net.URLClassLoader$4.run(URLClassLoader.java:549)
 at java.security.AccessController.doPrivileged(AccessController.java:213)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:547)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:625)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:582)
 at java.lang.J9VMInternals.verifyImpl(Native Method)
 at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
 at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
 at java.lang.reflect.AccessibleObject.initializeClass(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:248)
 at com.ibm.collaboration.realtime.lotusnotes.LotusNotes.getNotesSession(LotusNotes.java:179)
 at com.ibm.notes.sametime.calendar.hack.SpeakUpMiniApp.createControl(SpeakUpMiniApp.java:58)
 at com.ibm.collaboration.realtime.miniapp.MiniAppViewPart.createPartControl(MiniAppViewPart.java:41)
 at com.ibm.rcp.ui.internal.shelf.ShelfViewReference.createPartHelper(ShelfViewReference.java:330)
 at com.ibm.rcp.ui.internal.shelf.ShelfViewReference.createPart(ShelfViewReference.java:201)
 at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
 at com.ibm.rcp.ui.shelf.ShelfPage.activatePart(ShelfPage.java:1168)
 at com.ibm.rcp.ui.shelf.ShelfPage.access$10(ShelfPage.java:1159)
 at com.ibm.rcp.ui.shelf.ShelfPage$7.handleEvent(ShelfPage.java:1312)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
 at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:706)
 at com.ibm.rcp.swt.swidgets.SViewForm.toggleMaximize(SViewForm.java:1501)
 at com.ibm.rcp.swt.swidgets.SViewStack.expand(SViewStack.java:596)
 at com.ibm.rcp.swt.swidgets.SViewStack.toggleMaximize(SViewStack.java:526)
 at com.ibm.rcp.swt.swidgets.SViewStack$5.handleEvent(SViewStack.java:312)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
 at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:706)
 at com.ibm.rcp.swt.swidgets.SViewForm.onMouseUpMaximize(SViewForm.java:1437)
 at com.ibm.rcp.swt.swidgets.SViewForm.onMouseUp(SViewForm.java:1127)
 at com.ibm.rcp.swt.swidgets.SViewForm$4.handleEvent(SViewForm.java:421)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284)
 at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
 at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
 at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
 at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
 at com.ibm.collaboration.realtime.ui.WorkbenchAdapter.createAndRunWorkbench(WorkbenchAdapter.java:103)
 at com.ibm.collaboration.realtime.ui.WorkbenchAdapter.run(WorkbenchAdapter.java:85)
 at com.ibm.collaboration.realtime.application.RTCApplication.run(RTCApplication.java:765)
 at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
 at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:211)
 at java.lang.reflect.Method.invoke(Method.java:272)
 at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
 at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
 at org.eclipse.core.launcher.Main.run(Main.java:977)
 at org.eclipse.core.launcher.Main.main(Main.java:952)

It's really frustrating again to the version error. 再次使版本错误令人沮丧。 The sametime plugin dev environment runs on J9 JVM and the for some reason that is not enough for notes.jar ibmorbapi.jar i guess. 同时插件开发环境在J9 JVM上运行,出于某种原因,我猜这对于notes.jar ibmorbapi.jar来说还不够。 Atleast that is what my assumption is about the error. 我的假设是关于错误的。

I would appreciate any help on this from you guys. 谢谢你们的帮助。 "org/omg/CORBA/UserException" seems to be crux of the issue and I am simply not able to get over it. “ org / omg / CORBA / UserException”似乎是问题的症结所在,我根本无法克服。 I can get the external jar execution working in some complex way but I don't want to do it as i feel its the best way to get calendar entries from notes. 我可以使外部jar执行以某种复杂的方式工作,但是我不想这样做,因为我认为这是从笔记中获取日历条目的最佳方法。 I am sure it has to be reasonably simple and any help on this would be appreciated. 我确信它必须相当简单,对此将提供任何帮助。

There are two jars that are related to talking to a Notes application. 有两个与与Notes应用程序交谈有关的jar。

Notes.jar - This is a JNI wrapper for LSXBE classes. Notes.jar-这是LSXBE类的JNI包装器。 In order for it to work correctly you will need Lotus Notes installed on the machine and the main directory on the system PATH. 为了使其正常工作,您需要在计算机上安装Lotus Notes,并在系统PATH上安装主目录。

NCSO.jar - This is for making DIIOP connections to a Domino server. NCSO.jar-用于建立与Domino服务器的DIIOP连接。 This does not require Lotus Notes to be installed. 这不需要安装Lotus Notes。 It does require a Domino server you can connect to which has DIIOP enabled on it. 它确实需要您可以连接并启用了DIIOP的Domino服务器。

It is unclear if you have Notes installed? 还不清楚您是否安装了Notes?

The jars are also specific to certain JVM versions. 这些jar也特定于某些JVM版本。

  • Java 6 - Notes 8.5.1 Java 6-笔记8.5.1
  • Java 5 - Notes 8.x Java 5-Notes 8.x
  • Java 1.4.2 - Notes 7.x Java 1.4.2-Notes 7.x
  • Java 1.3 - Notes 6.x Java 1.3-Notes 6.x

"bad major version at offset" means your are running the wrong jar for the JVM (eg. 851 jar on 1.4.2). “偏移时的主要版本不正确”表示您为JVM运行了错误的jar(例如1.4.2上的851 jar)。

To rule out any configuration issues first I recommend creating just a simple java application which makes a connection to Notes/Domino. 为了排除任何配置问题,我建议仅创建一个简单的Java应用程序,该应用程序可连接到Notes / Domino。 Once that works then you know your paths/jars are all set up correctly. 一旦可行,您就知道所有路径/罐子都已正确设置。

Looks like CORBA classes are compiled for a newer JDK. 看起来CORBA类是为较新的JDK编译的。 You need to find an older version of the JAR, or, alternatively, get the sources and compile them under your JDK (J9?). 您需要找到一个较旧的JAR版本,或者获取源代码并在您的JDK(J9?)下进行编译。 From what I see from a brief Google search, J9 is either 1.4 or even 1.3 compatible. 从简短的Google搜索中可以看出,J9是1.4甚至1.3兼容的。

Also, make sure that all the code you compile yourself has the same target Java version, ie 1.4 (1.3?) in this case. 另外,请确保您自己编译的所有代码都具有相同的目标Java版本,在这种情况下为1.4(1.3?)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM