JWNL problem : deadlock in multithread enviro

  • Mladen Adamovic

    Mladen Adamovic - 2007-01-11

    Hi All,

    I'm using JWNL 1.3 at http://www.online-utility.org/english/index.jsp English language online tools.

    But sometimes some of my widgets which use JWNL stop to work. It seems like some kind of deadlock.
    I'm using File mapped dictionary.

    Usually each JSP (Servlet) use class WordNetProcessor which use JWNL in static way as follows:
    <%! static WordNetProcessor wordNetProcessor=new WordNetProcessor(); %>

    Class WordNetProcessor initialize JWNL at the following way :
        /** Creates a new instance of WordNetProcessor */
        public WordNetProcessor() {
            String propsFile = common.CommonResource.getString("WordNetProperty");
            try {
                // initialize JWNL (this must be done before JWNL can be used)
                    JWNL.initialize(new FileInputStream(propsFile));
            } catch (Exception ex) {

    I've tried also with the line if(!JWNL.isInitialized()) removed but it seemed I had leak of file descriptors.

    I would appreciate any idea or comment.

    Thanks in advance.

  • Aliaksandr Autayeu

    You might have faced some of the multithreading issues people in other forums talk about. In my fork at http://extjwnl.sourceforge.net/ there is a way to use Dictionary normally, not only with a single static instance. You may want to try to instantiate dictionary per thread.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks