Usability - Productivity - Business - The web - Singapore & Twins

Websphere, Domino and Java insights

When you are a LotusScript buff and make your first baby steps in Java and Domino, there are a few things quite different. Working on DominoWebDAV I learned a few lessons I'd like to share:  
  • Get yourself a copy of this. It is still the best transition from your sound knowledge of Lotus Script Domino Objects to Java Domino Objects  
  • Domino comes with an entitlement of a Websphere server, so this can be a good starting point. One caveat: Websphere likes to have EAR files for application deployments. When you start off with a simple servlet or JSP, it is most likely, that you just have a WAR file. When deploying a war file Websphere wants to know the application context (Tomcat on the other hand simply uses the WAR file name as context, easier but less flexible). When you enter "myapp" it won't work. You have to enter "/myapp/"  
  • When linking Websphere to Domino for authentication (a topic for another Thursday). Websphere by default activates J2EE security. This is a good thing for applications deployed in production, but a nightmare for a Java novice. So when you tick the security icon, untick the J2EE security icon below (in your development environment only of course)  
  • Before you get started with servlets, you might want to test your Java skills on an agent first. While the build in IDE is OK, editing Java in Eclipse is much more fun. To edit Java agents there, you can use the Domiclipse plugin.  
  • Not sure about Java itself? There is an excellent Java learning IDE called BlueJ. And there are the outstanding Head First books about Java, Servlets, EJB and Patterns.  
  • There are also plenty of places where you can get Java help and insights. My favourite places are Javaranch, Java Coffee Break and Jakarta.  
  • When looking at a specific problem to solve, check the Jakarta Commons before you start coding. There a lot of problems have been solved for you. For example there is a complete HTTP client, that handles authentication, cookies, html parsing or encryption for you.  
  • When you are done with a Domino object in Java, call its recycle() method. Otherwise you create a army of Zombie C objects that eat all your memory. Of course you need to be careful of the sequence. If you recycle a database object, you can't access the documents in there any more, even if you have a Java object pointing to one  
  • Have a look at session.resolve(url). This session method allows you to take a notes URL (notes://....) and resolve it directly to a database, view or document. That's a very nice shortcut thru the object hierarchy.

Posted by on 22 February 2006 | Comments (3) | categories: Show-N-Tell Thursday


  1. posted by Kapali on Saturday 25 February 2006 AD:
    Thanks for that Java Coffee Break link; very useful.

    I am also exploring Java with Domino - posted a code in my site with what I have done - http://kapalienator.blogspot.com/2006/02/java-code-that-fetches-data-from-notes.html
  2. posted by Senthil Kumar on Saturday 25 February 2006 AD:
    Thanks Stephan for showing me BlueJ. I have started reading and about to download the software. I am not a regular object oriented developer when doing Lotusscript and i find it difficult to visualise interms of classes and objects. Hopefully, i have gotten something which is an eye-opener.

    Nextly, am eagerly waiting for Head First book in Java as am in the que. Am yet to find a copy of Domino with Java by Bob. Any ideas of the availability in Singapore Book Stores. Am gonna hunt for it soon :)
  3. posted by Christian Brandlehner on Monday 27 February 2006 AD:
    Have you got Domiclipse working with Notes 7.0? I tried it with one of the Java Agent in the BlogSphere template but Domino refuses to run the agent due to some code element not being signed. Emoticon huh.gif
    Anyway, Domiclipse is a GREAT tool, I hope it will stay available for free.