Selbständiger IT Berater – Java, J2EE, WebSphere Portal, Lotus Domino
RSS icon Home icon
  • Running TomCat 6 in Debug Mode under Windows

    (6 votes) 1 Star2 Stars3 Stars4 Stars5 Stars
    Loading ... Loading ...
    Posted on 11 March 2009 No comments

    While tracing some problems in one of my grails applications I had the need to do step debugging on a remote Tomcat server. Eventually I came up with the following lines to launch TomCat in debug mode:

    @echo off
    set JPDA_TRANSPORT="dt_socket"
    set JPDA_ADDRESS="8000"
    set JPDA_SUSPEND="y"
    catalina.bat jpda start
    

    Simply create a debug.bat file in TomCat’s bin directory and add these lines.

  • Lotus Notes [Send only] und [Send and File] Schaltflächen für Outlook 2003

    (4 votes) 1 Star2 Stars3 Stars4 Stars5 Stars
    Loading ... Loading ...
    Posted on 19 February 2009 17 comments

    Man kann über Lotus Notes sagen was man möchte, wenn man damit eine Weile gearbeitet hat und auf z.B. Outlook umgestiegen ist/wurde, dann fehlt einem in der Regel doch die eine oder andere liebgewonnene Funktion.

    Da ich nun bereits bei meinem zweiten Kunden “gezwungen” bin, mit MS Outlook 2003 zu arbeiten und mich scheinbar auch in Zukunft nicht um dessen Verwendung drücken kann, habe ich zwei der vielen praktische Notes-Funktionen für Outlook 2003 implementiert:

    1. Die Schaltfläche [Send only], bzw. [Nur senden] versendet eine E-Mail ohne eine Kopie davon in Outlook zu speichern.
    2. Die Schaltfläche [Send and File...] bzw. [Senden und ablegen...] erfragt vor dem Versenden in welchem Ordner die gerade geschriebene E-Mail abgelegt werden soll.

    Installation:

    1. Download des Visual Basic Moduls in der gewünschten Sprache.
      Download: Send Mail Macros for MS Outlook 2003 (EN)  Send Mail Macros for MS Outlook 2003 (EN) (4.9 KiB, 1,580 hits)

      Download: Send Mail Macros for MS Outlook 2003 (DE)  Send Mail Macros for MS Outlook 2003 (DE) (5.1 KiB, 747 hits)

    2. In Outlook den Visual Basic Editor öffnen.

      open VBE from within outlook

    3. Das Visual Basic Modul importieren

      Modul importieren Das VBE Modul auswählen Das VBE Modul wurde importiert.

    4. Das Projekt speichern.

      Das VBE Projekt speichern

    5. Die Schaltflächen in der Toolbar installieren.

      Makros Dialog öffnen Schaltfläche [Senden und ablegen...] installieren Schaltfläche [Senden und ablegen...] installiert Schaltfläche [Nur senden] installieren Schaltfläche [Nur senden] installiert

    6. Beim Erstellen einer neuen E-Mail sollten nun in der Toolbar die beiden zusätzlichen Schaltflächen angezeigt werden.

      Neue Schaltflächen in der Toolbar

    7. Beim Klick auf “Senden und ablegen…” erscheint vor dem Versenden der Ordnerdialog.

      Auswahl des Zielordners

  • getpass für Jython

    1 Star2 Stars3 Stars4 Stars5 Stars
    Loading ... Loading ...
    Posted on 21 November 2008 1 comment

    In meinem aktuellen Projekt entwickle ich u.a. verschiedene Jython basierte Kommandozeilenanwendungen. Einige davon erwarten die Eingabe von maskierten Passwörtern. Python stellt hierfür das getpass Modul bereit. Leider ist bisher keine entsprechende Implementierung für Jython verfügbar.

    Im folgenden ein passendes Modul, welches diese Funktionalität bereitstellt. Es verwendet einen Mechanismus um die Passworteingabe in der Kommandozeile zu maskieren, welcher hier beschrieben wurde http://java.sun.com/developer/technicalArticles/Security/pwordmask/. Sollte Jython in Verbindung mit Java 6 oder höher eingesetzt werden, so nutzt dieses Modul stattdessen die neue Console.readPassword() Methode. Sollte das Modul in einer Umgebung laufen in welcher eine getpass Modulimplementierung verfügbar ist, dann wird stattdessen an die entsprechende Methode im getpass Modul delegiert.

    # ext_getpass.py
    # @author Sebastian Thomschke, http://sebthom.de/
    import thread, sys, time, os
    
    # exposed methods:
    __all__ = ["getpass","getuser"]
    
    def __doMasking(stream):
        __doMasking.stop = 0
        while not __doMasking.stop:
            stream.write("b*")
            stream.flush()
            time.sleep(0.01)
    
    def generic_getpass(prompt="Password: ", stream=None):
        if not stream:
            stream = sys.stderr
        prompt = str(prompt)
        if prompt:
            stream.write(prompt)
            stream.flush()
        thread.start_new_thread(__doMasking, (stream,))
        password = raw_input()
        __doMasking.stop = 1
        return password
    
    def generic_getuser():
        for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'):
            usr = os.environ.get(name)
            if usr: return usr
    
    def java6_getpass(prompt="Password: ", stream=None):
        if not stream:
            stream = sys.stderr
        prompt = str(prompt)
        if prompt:
            stream.write(prompt)
            stream.flush()
    
        from java.lang import System
        console = System.console()
        if console == None:
    	    return generic_getpass(prompt, stream)
        else:
            return "".join(console.readPassword())
    
    try:
        # trying to use Python's getpass implementation
        import getpass
        getpass = getpass.getpass
        getuser = getpass.getuser
    except ImportError, e:
        getuser = generic_getuser
    
        # trying to use Java 6's Console.readPassword() implementation
        try:
            from java.io import Console
            getpass = java6_getpass
        except ImportError, e:
            # use the generic getpass implementation
            getpass = generic_getpass
    

    Here is an usage example:

    import ext_getpass as getpass
    
    pw = getpass.getpass("Please enter your password:")
    print "The entered password was: " + pw
    
  • Sun JDK5/6 compilers broken when linking overloaded methods with variable arguments

    (5 votes) 1 Star2 Stars3 Stars4 Stars5 Stars
    Loading ... Loading ...
    Posted on 16 May 2008 1 comment

    We are currently switching the build system of OVal from custom Ant scripts to Maven 2. During that process we accidentally compiled the project using the Java compiler of the Sun JDK 5 instead of the AspectJ compiler. Surprisingly javac did not complain about the missing aspect class files. Instead it already aborted while compiling an ordinary Java class which only referenced other non-AspectJ related classes. This is the original error message:

    [INFO] [compiler:compile]
    [INFO] Compiling 180 source files to C:\projects\oval\src\trunk\target\classes
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Compilation failure
    C:\projects\oval\src\trunk\src\main\java\net\sf\oval\Validator.java:[373,58]
    addMethodParameterChecks(java.lang.reflect.Method,int,java.lang.Object)
    has private access in net.sf.oval.internal.ClassChecks 

    There exist multiple methods named addMethodParameterChecks in the class ClassChecks with different signatures. The problem is that javac tries to link against the wrong method when compiling the class calling one of the methods.

    Read the rest of this entry »

  • OVal 1.0 veröffentlicht!

    1 Star2 Stars3 Stars4 Stars5 Stars
    Loading ... Loading ...
    Posted on 22 July 2007 No comments

    OVal ist ein pragmatisches und erweiterbares Validierungsframework für jegliche Art von Javaobjekten (nicht nur JavaBeans). Bedingungen können via Annotationen, POJOs oder XML konfiguriert werden. Zusäzliche Bedingungen können in Form von Java Klassen oder die Verwendung von Skriptsprachen wie JavaScript, Groovy, BeanShell, OGNL oder MVEL ausgedrückt werden. Neben der einfachen Objektvalidierung kann OVal auch Funktionen für Programming by Contract bereitstellen. Hierzu werden AspectJ basierte Aspekte verwendet.

    Projektseite: http://sourceforge.net/projects/oval/

  • MyPad v1.1.6 – ein PHP Editor

    (2 votes) 1 Star2 Stars3 Stars4 Stars5 Stars
    Loading ... Loading ...
    Posted on 26 July 2004 No comments

    MyPad ist ein kompakter PHP Editor. Ich habe diesen Editor entwickelt, weil ich keinen passenden mit einem Single Documend Interface finden konnte.
    Der Editor, nach dem ich gesucht habe, sollte dem Notepad ähneln, aber auch in der Lage sein, PHP Quellcode farblich hervorzuheben.
    Ein solcher Editor kann dann ideal im Zusammenhang mit einem Filemanager ähnlich dem Norton Commander verwendet werden.

    Read the rest of this entry »