<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>lekkimworld.com - Java category</title>
  <link>http://lekkimworld.com/categories/java/</link>
  <description>a blog about lotus notes, domino, sametime, expeditor and a whole lot of java...</description>
  <language>en</language>
  <copyright>Mikkel Heisterberg (mh [at] intravision [dot] dk</copyright>
  <lastBuildDate>Thu, 18 Mar 2010 11:36:25 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  <image>
    <url>http://pebble.sourceforge.net/common/images/powered-by-pebble.gif</url>
    <title>lekkimworld.com (Java category)</title>
    <link>http://lekkimworld.com/</link>
  </image>
  
  
  <item>
    <title>Actually showing the password prompt when developing Java for Notes</title>
    <link>http://lekkimworld.com/2010/02/02/actually_showing_the_password_prompt_when_developing_java_for_notes.html</link>
    
      
        <description>
          &lt;p&gt;
If you&#039;re developing console applications in Java that access Notes resources and you&#039;re testing them in Eclipse you have experienced the following. You run your application to test it from Eclipse. It accesses a Notes resource and you haven&#039;t granted 3rd party applications access in the Security settings so it causes Notes to ask you for the password - only the Console view doesn&#039;t accept input... Bummer! :-(
&lt;/p&gt;
&lt;p&gt;
Fortunately there&#039;s a solution to this which I&#039;ll show below.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Disclaimer:&lt;/strong&gt; I can in no way take credit for this tip as I didn&#039;t discover it. The credit goes to &lt;a href=&#034;http://www.mindoo.com/web/blog.nsf&#034;&gt;Karsten Lehmann&lt;/a&gt; who posted it in the Design Partner forum.
&lt;/p&gt;
&lt;p&gt;
The solution is not to make the password prompt go to the Console view but pop up a password entry dialog instead. The way to do this is to initialize the Swing UI framework &lt;i&gt;before&lt;/i&gt; running your application as I do below (see code in bold).
&lt;pre&gt;
import javax.swing.SwingUtilities;
import lotus.domino.Session;
import lotus.domino.Database;
import lotus.domino.DocumentCollection;
import lotus.domino.NotesFactory;
import lotus.domino.NotesThread;

public class Main {

  public static void main(String[] args) {
    try {
      &lt;b&gt;&lt;/i&gt;SwingUtilities.invokeLater(new Runnable() {
        public void run() {}
      });&lt;/i&gt;&lt;/b&gt;
      
      NotesThread.sinitThread();
      s s = NotesFactory.creates();
      System.out.println(&#034;Name: &#034; + s.getUserName());
      Database db = s.getDatabase(&#034;server1/Example&#034;, &#034;names.nsf&#034;);
      DocumentCollection dc = db.getAllDocuments();
      System.out.println(&#034;Docs: &#034; + dc.getCount());
      
    } catch (Throwable t) {
      t.printStackTrace();
    } finally {
      NotesThread.stermThread();
    }
  }
}

&lt;/pre&gt;
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://lekkimworld.com/2010/02/02/actually_showing_the_password_prompt_when_developing_java_for_notes.html#comments</comments>
    <guid isPermaLink="true">http://lekkimworld.com/2010/02/02/actually_showing_the_password_prompt_when_developing_java_for_notes.html</guid>
    <pubDate>Tue, 02 Feb 2010 12:41:04 GMT</pubDate>
  </item>
  
  <item>
    <title>Developing Java plugins and applications for Notes on 64 bit</title>
    <link>http://lekkimworld.com/2010/02/01/developing_java_plugins_and_applications_for_notes_on_64_bit.html</link>
    
      
        <description>
          &lt;p&gt;
I just upgraded my Thinkpad from Windows Vista 32 bit to Windows 7 64 bit and besides being amazed at the speed improvements (thanks to moving of Windows Vista) I needed to think about how I develop Java for Notes in general. When moving to 64 bits there are some things you need to consider if, and only if, you install the 64 bit version of the Java Development Kit (JDK) as I did. You need to consider stuff for two reasons which I&#039;ll address in turn.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Please note:&lt;/strong&gt; This blog post will focus on 64 bits Windows 7 as that&#039;s what I&#039;m running now but I suspect it will apply to other Notes platforms such as Windows Vista, Linux and Mac as well. I&#039;m not using Lotus Expeditor Toolkit so I can&#039;t confirm the following is but a wise man told me that XPD Toolkit doesn&#039;t support 64 bit JDK&#039;s so in that case you need this as well as my &lt;a href=&#034;http://lekkimworld.com/pages/eclipse34_notes851.html&#034;&gt;&#034;Configure Eclipse 3.4 for Notes 8.5.1&#034;-guide&lt;/a&gt; as well.
&lt;/p&gt;
&lt;h3&gt;Notes is a 32 bit application&lt;/h3&gt;
&lt;p&gt;
Say you install a 64 bit JDK and try to run an application that access Notes using local address (NRPC; a client or server installed on the same machine) such as the following:
&lt;pre&gt;
import lotus.domino.Session;
import lotus.domino.Database;
import lotus.domino.DocumentCollection;
import lotus.domino.NotesFactory;
import lotus.domino.NotesThread;

public class Main {
  public static void main(String[] args) {
      NotesThread.sinitThread();
      Session s = NotesFactory.createSession();
      System.out.println(&#034;Name: &#034; + s.getUserName());
      Database db = s.getDatabase(&#034;server1/Example&#034;, &#034;names.nsf&#034;);
      DocumentCollection dc = db.getAllDocuments();
      System.out.println(&#034;Docs: &#034; + dc.getCount());
      
    } catch (Throwable t) {
      t.printStackTrace();
    } finally {
      NotesThread.stermThread();
    }
  }
}
&lt;/pre&gt;
The code will compile fine but when you run it you&#039;ll see a message like the following (plus a stacktrace):
&lt;pre&gt;
java.lang.UnsatisfiedLinkError: C:\Notes8\nlsxbe.dll: 
   Can&#039;t load IA 32-bit .dll on a AMD 64-bit platform
&lt;/pre&gt;
The problem is, as the message explains, that you cannot load a 32 bit DLL (remember Notes is a 32 bit application) into a 64 bit Java Virtual Machine (JVM). The solution is to install a 32 bit JDK instead and run the application using this JDK. Remember that it is perfectly valid and possible to install multiple JDK&#039;s on a single machine and it fact that&#039;s what I&#039;m doing. 
&lt;/p&gt;
&lt;h3&gt;Developing plugins for Notes 8+&lt;/h3&gt;
&lt;p&gt;
Developing plugins for Notes 8+ on 64 bit Windows is also somewhat different from doing it on a 32 bit Windows system. Of course you need Eclipse but here&#039;s the first difference - you need to use a 64 bit version of Eclipse if you&#039;re using a 64 bit JDK. The reason is that Eclipse uses SWT (&lt;a href=&#034;http://www.eclipse.org/swt&#034;&gt;Standard Widget Toolkit&lt;/a&gt;) for the user interface widgets. The reason SWT looks so nice on any supported platform is because it wraps the native, C-code, platform widgets. So remember that and &lt;a href=&#034;http://lingpipe-blog.com/2009/03/05/eclipse-ide-for-64-bit-windows-and-64-bit-java/&#034;&gt;grab a 64 bit Eclipse&lt;/a&gt;. Once that&#039;s installed and working with your 64 bit JDK configure Eclipse as you normally would but with a small difference that will cause your code not to compile (my Eclipse complained about not be able to resolve org.eclipse.swt.widgets.Shell).
&lt;/p&gt;
&lt;p&gt;
As you may know, you specify the bundles you depend on when developing your plugin and in turn you also specify which environment you run in. This is how Eclipse knows which versions to the bundles to put on the class path but since you&#039;re running 64 bit Windows and Notes is 32 bits it will be a problem. The fix is however very easy to implement and only means tweaking the target platform setup to explicitly set the architecture you&#039;re running on to &#034;x86&#034; and not &#034;x86_64&#034; which is the default if you&#039;re on a 64 bit JVM. Where to set this differs a little between Eclipse 3.4 and Eclipse 3.5 but the concept is the same.
&lt;ol&gt;
&lt;li&gt;Open the target platform setup&lt;/li&gt;
&lt;li&gt;Edit the &#034;Environment&#034; settings&lt;/li&gt;
&lt;li&gt;Set the architecture to &#034;x86&#034;&lt;/li&gt;
&lt;/ol&gt;
Once this is done the workspace will be rebuilt and everything should work just fine. Mine did anyway... :-)
&lt;/p&gt;
&lt;h3&gt;Back to our standalone Java application&lt;/h3&gt;
&lt;p&gt;
If you need to run a Java application that accesses Notes locally from within an Eclipse instance (lets face it - who writes Java code without an IDE these days?) you also need to use a 32 bit JVM although you very well may be running 64 bit Eclipse in a 64 bit JVM. The JVM used to execute an application from within Eclipse is the JVM you setup in the build path. To set it simply right-click the project, choose Build Path -&amp;lt; Configure Build Path... and replace/edit the JVM library used.
&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;

I hope the above is clear - if not let me know using the comment system. I&#039;ll soon be blogging about using Eclipse 3.5 for your Eclipse development instead of the current version 3.4. Stay tuned.
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://lekkimworld.com/2010/02/01/developing_java_plugins_and_applications_for_notes_on_64_bit.html#comments</comments>
    <guid isPermaLink="true">http://lekkimworld.com/2010/02/01/developing_java_plugins_and_applications_for_notes_on_64_bit.html</guid>
    <pubDate>Mon, 01 Feb 2010 11:56:10 GMT</pubDate>
  </item>
  
  <item>
    <title>Signed demo plugin on OpenNTF</title>
    <link>http://lekkimworld.com/2009/11/11/signed_demo_plugin_on_openntf.html</link>
    
      
        <description>
          &lt;p&gt;
Today Niklas Heidloff &lt;a href=&#034;http://twitter.com/openntf/status/5594813074&#034;&gt;tweeted&lt;/a&gt; about a new demo Java extension that have been published on OpenNTF. Besides being a very nice demo example it also has another noticeable difference from all other Java extensions that have been published so far. The difference is small although very important. The difference is that it&#039;s digitally signed!
&lt;/p&gt;
&lt;p&gt;
When installing Java extensions in Notes you have probably grown used to the &#034;Are you really, really, really, really sure you want to install this unsigned Java extension in your Notes client&#034;-prompt. Without thinking you probably click &#034;Yes&#034; out of habit which is why you may not remember the prompt. If you install this Java extension you wont see this prompt because it&#039;s signed by a certificate you trust (it&#039;s an IBM certificate).
&lt;/p&gt;
&lt;p&gt;
Using jarsigner -verify -verbose -certs on the feature will yield something like this:
&lt;pre&gt;
[entry was signed on 01-11-09 04:05]
X.509, CN=International Business Machines Corporation, 
OU=Lotus Software Group, OU=Digital ID Class 3 - Java 
Object Signing, O=International Business Machines 
Corporation, L=Westford, ST=Massachusetts, C=US
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
The difference is small but very important. You did notice it didn&#039;t prompt you right?
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://lekkimworld.com/2009/11/11/signed_demo_plugin_on_openntf.html#comments</comments>
    <guid isPermaLink="true">http://lekkimworld.com/2009/11/11/signed_demo_plugin_on_openntf.html</guid>
    <pubDate>Wed, 11 Nov 2009 09:34:53 GMT</pubDate>
  </item>
  
  <item>
    <title>Configure Eclipse 3.4 for Notes 8.5.1</title>
    <link>http://lekkimworld.com/2009/09/30/configure_eclipse_3_4_for_notes_8_5_1.html</link>
    
      
        <description>
          &lt;p&gt;
With the eminent release of Notes 8.5.1 it will become important for all you plugin guys and gals to update your configuration to work with Notes 8.5.1. This post will address this.
&lt;/p&gt;
&lt;p&gt;
One of the really nice things about this new release is how Lotus strive to minimize the disk footprint of the install package. Part of this involves how jar-files are stored in the installed package but also how many Java VM&#039;s ship with Notes. Previously there were 2 JVM&#039;s - now there&#039;s only one. There&#039;s no longer a JRE stored in the plugin directory way down in the directory structure. Now you simply use the JVM in &amp;lt;Notes install dir&amp;gt;/jvm - simple right?! 
&lt;/p&gt;
&lt;p&gt;
This is nice but it means that your Eclipse configuration needs to be a little different JVM wise. I have therefore updated my &lt;a href=&#034;http://lekkimworld.com/pages/eclipse34_notes851.html&#034;&gt;Eclipse configuration guidelines to work with Notes 8.5.1&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Happy coding...
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Please note:&lt;/b&gt; Once Notes 8.5.1 is final and released I&#039;ll update the guidelines with the correct install id etc.
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://lekkimworld.com/2009/09/30/configure_eclipse_3_4_for_notes_8_5_1.html#comments</comments>
    <guid isPermaLink="true">http://lekkimworld.com/2009/09/30/configure_eclipse_3_4_for_notes_8_5_1.html</guid>
    <pubDate>Wed, 30 Sep 2009 10:42:08 GMT</pubDate>
  </item>
  
  <item>
    <title>Domino Server Extensions: RunJava or Eclipse Plugins? - PLEASE GO VOTE!!</title>
    <link>http://lekkimworld.com/2009/08/04/domino_server_extensions_runjava_or_eclipse_plugins_please_go_vote.html</link>
    
      
        <description>
          &lt;p&gt;
A little while back I mentioned that Bob Balfe was inquiring about Domino server extensions in Java and whether it was of interest to us as developers (&lt;a href=&#034;http://lekkimworld.com/2009/07/31/javaapi_for_servertasks_documented_and_supported.html&#034;&gt;JavaAPI for Servertasks - Documented and Supported&lt;/a&gt;). Interesting? Are you kidding me? It would be VERY interesting.
&lt;/p&gt;
&lt;p&gt;
Now Bob in his blog post &#034;&lt;a href=&#034;http://blog.balfes.net/?p=735&#034;&gt;Domino Server Extensions: RunJava or Eclipse Plugins?&lt;/a&gt;&#034; is asking which extension mechanism we would prefer so PLEASE GO VOTE! This is really important and would make the Domino server much more approachable and much easier extensible.
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://lekkimworld.com/2009/08/04/domino_server_extensions_runjava_or_eclipse_plugins_please_go_vote.html#comments</comments>
    <guid isPermaLink="true">http://lekkimworld.com/2009/08/04/domino_server_extensions_runjava_or_eclipse_plugins_please_go_vote.html</guid>
    <pubDate>Tue, 04 Aug 2009 05:52:00 GMT</pubDate>
  </item>
  
  <item>
    <title>Custom plug-in builds in Eclipse</title>
    <link>http://lekkimworld.com/2009/07/01/custom_plug_in_builds_in_eclipse.html</link>
    
      
        <description>
          &lt;p&gt;
Just had an interesting issue where I needed to make sure my Eclipse plug-in had the latest version of a jar-file I build in another Java project. Normally including a jar-file in a plug-in project is easy enough but when doing that you&#039;re normally using a static jar-file that doesn&#039;t change. I needed my plug-in to use the latest jar from the other Java project whenever the plug-in was built. Hmmm....
&lt;/p&gt;
&lt;p&gt;
After some searching around and some hints via Twitter I found the solution and it was very easy as Eclipse already include the plumbing for this (from Eclipse 3.2). The solution was to contribute custom build steps to the build.xml that the PDE in Eclipse auto-generates. It&#039;s way easier than it sounds.
&lt;/p&gt;
&lt;p&gt;
The only changes I needed to make to my plug-in project was to:
&lt;ul&gt;
&lt;li&gt;Add &#034;customBuildCallbacks=customBuildCallbacks.xml&#034; to the build.properties&lt;/li&gt;
&lt;li&gt;Add a customBuildCallbacks.xml Ant file to my plug-in project (the one that needed the newest jar) with a single target called &#034;pre.gather.bin.parts&#034;&lt;/li&gt;
&lt;li&gt;Write &#034;code&#034; for the target that replaces the jar-file in my plug-in project with the one from my Java project&lt;/li&gt;
&lt;li&gt;Build the plug-in via my update site&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
For full details refer to &lt;a href=&#034;http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_custom_callbacks.htm&#034;&gt;Plug-in Development Environment Guide/Tasks/PDE Build Advanced Topics/Feature and Plug-in custom build steps&lt;/a&gt; in the online help.
&lt;/p&gt;
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://lekkimworld.com/2009/07/01/custom_plug_in_builds_in_eclipse.html#comments</comments>
    <guid isPermaLink="true">http://lekkimworld.com/2009/07/01/custom_plug_in_builds_in_eclipse.html</guid>
    <pubDate>Wed, 01 Jul 2009 21:13:46 GMT</pubDate>
  </item>
  
  <item>
    <title>Generating unique id&#039;s for Notes widgets</title>
    <link>http://lekkimworld.com/2009/06/21/generating_unique_ids_for_notes_widgets.html</link>
    
      
        <description>
          &lt;p&gt;
If you write code to automatically generate widget descriptors (aka extension.xml) for users you have to ensure that the widget id is unique. A nice exxample of this can be found &lt;a href=&#034;http://lekkimworld.com/2009/06/12/google_maps_widget_generator_come_grab_your_own.html&#034;&gt;here&lt;/a&gt;. One caveat is that the widget id is used to distinguish the widgets hence has to be unique. To easiest way to generate a unique id in Java is to use the &lt;a href=&#034;http://java.sun.com/j2se/1.5.0/docs/api/java/util/UUID.html&#034;&gt;java.util.UUID&lt;/a&gt; class. Generating a unique, random, id with this class is easy.
&lt;pre&gt;
String id = java.util.UUID.randomUUID().toString();
&lt;/pre&gt;
&lt;/p&gt;

        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://lekkimworld.com/2009/06/21/generating_unique_ids_for_notes_widgets.html#comments</comments>
    <guid isPermaLink="true">http://lekkimworld.com/2009/06/21/generating_unique_ids_for_notes_widgets.html</guid>
    <pubDate>Sun, 21 Jun 2009 08:39:40 GMT</pubDate>
  </item>
  
  <item>
    <title>Don&#039;t install Notes in the default location if doing Notes plug-in development</title>
    <link>http://lekkimworld.com/2009/06/17/dont_install_notes_in_the_default_location_if_doing_notes_plug_in_development.html</link>
    
      
        <description>
          &lt;p&gt;
A little while back I was contacted by a fellow Yellow-head who had some issues with some plug-in development for Notes 8. Unfortunately I wasn&#039;t able to help him at the time but when he some head scratching time later found the answer he was kind enough to share it. I thought I would share it here in case it can help someone. 
&lt;/p&gt;
&lt;p&gt;
From the offset the issue looked simple as it had to do with the good old nlsxbe which is normally caused by the binary Notes directory not being on the path. The issue was however a bit twisted as the error raised complained about the filename or extension being too long.
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
java.lang.UnsatisfiedLinkError: nlsxbe 
   (The filename or extension is too long. )
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
What our good Yellow-head found out was that the issue was caused by his install location of the Notes client. Specifically he had installed his client in &#034;C:\Archivos de programa\IBM\Lotus\Notes&#034; which is the default location for his OS. This however means that the path to the notes.jar for plug-ins becomes &#034;C:\Archivos de programa\IBM\Lotus\Notes\framework\rcp\eclipse\plugins\com.ibm.rcp.j2se.win32.x86_1.5.0.SR4-200707311521\jre\lib\Notes.jar&#034; which is too long a path (longer than 128 characters). Installing Notes in &#034;C:\program files\IBM\Lotus\Notes&#034; solved the issue. 
&lt;/p&gt;
&lt;p&gt;
So if you run into weird issues like this check your install path or choose an English copy of Windows! :-)
&lt;/p&gt;

        </description>
      
      
    
    
    
    <category>Java</category>
    
    <category>IBM</category>
    
    <comments>http://lekkimworld.com/2009/06/17/dont_install_notes_in_the_default_location_if_doing_notes_plug_in_development.html#comments</comments>
    <guid isPermaLink="true">http://lekkimworld.com/2009/06/17/dont_install_notes_in_the_default_location_if_doing_notes_plug_in_development.html</guid>
    <pubDate>Wed, 17 Jun 2009 13:07:58 GMT</pubDate>
  </item>
  
  </channel>
</rss>
