Ruben Laguna's blog

Jul 27, 2010 - 2 minute read - client desktop evernote java netbeans platform

EN4J 1.0M2 released - Evernote Java Client

I finally decided to release the project I was working on the last year: A java desktop client for the Evernote service. The distributions for Mac OS X, Linux and Windows can be found on the downloads page. And the source code can be accesses and forked from the git repository on github. The README for EN4J-1.0M2 EN4J What is it? ----------- EN4J is a client to the Evernote services written in Java.

Jul 15, 2010 - 1 minute read - debug debugging drop eclipse frame netbeans rewind stack stackframe

Netbeans "Drop to Frame" debugging

I took me a while to figure out how to rewind the stack while debugging in Netbeans. This feature is called “Drop to Frame” in Eclipse and there is accesible in the toolbar. In Netbeans the feature that allows you to go back in the callstack is called Pop to Here and you invoke it right clicking on the stack. There is also a “Debug / Stack / Pop Topmost Call”

Jul 3, 2010 - 2 minute read - application area document editor grey hide java netbeans noeditor platform remove

Getting rid of the grey empty area on your Netbeans Platform Application (RCP)

The short answer is that the gray area that you are seeing in lower bottom of the window is actually the editor area (aka document area) and you can hide it by adding run.args.extra=-J-Dnetbeans.winsys.hideEmptyDocArea=true to your file. Or by calling System.setProperty("netbeans.winsys.hideEmptyDocArea", "true"); from one of your module’s Installers. That’s all you need to know but if you are interested on getting some details and references continue reading. If you create a new Netbeans RCP application and only add TopComponents to modes other than editor (modes which kind=“view”) then you will end up with an empty document area (could be at the bottom, top, left, right or in between TopComponents depending which modes you placed the TCs on).

Jul 3, 2010 - 1 minute read - area document documentarea empty exception grey hide java netbeans npe null nullpointer nullpointerexception pointer

NullPointerException when using hideEmptyDocArea

When I put run.args.extra=-J-Dnetbeans.winsys.hideEmptyDocArea=true in my I got a NullPointerException (NPE) at startup. I though it was a bug and I reported it but then I realized that I got the NPE because I had removed/hidden also the editor.wsmode in my layer.xml ... ... <folder name="Windows2"> <folder name="Modes"> <folder name="editor_hidden"/> <file name="editor.wsmode_hidden"/> </folder> </folder> ... ... As soon as I removed those entries from the layer.xml hideEmptyDocAre worked perfectly.

Apr 10, 2010 - 1 minute read - bug java leak lucene memory tika

Lucene 2.9.0/3.0.1 memory leaks

If you are experiencing high memory comsumption with Lucene 2.9.0/3.0.1 it could be due… ... to a recently reported and fixed bug in StandardTokenizer where JFlex generated code was expanding a buffer (zzBuffer) and never trimming it down Uploaded with plasq's Skitch! ... to another recently reported and fixed bug where IndexWriter held references to Readers used in your Fields, (and if you have apache tika's reader, those can take up a lot of space) Uploaded with plasq's Skitch!

Mar 10, 2010 - 1 minute read - build fail java locale lucene mac maven oome tests tika

Building Apache Tika 0.6 fails if the locale is not en_US

I tried to build Apache Tika 0.6 yesterday and I couldn’t build it because the tests failed. The failing tests were testExcelParserFormatting( testExcelFormats( and the failure had to to with the fact that the locale was “es_ES” and the numbering format differs ("1.599,99" and not “1,599.99”) $ mvn -version Apache Maven 2.2.0 (r788681; 2009-06-26 15:04:01+0200) Java version: 1.6.0_17 Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home Default locale: es_ES, platform encoding: MacRoman OS name: "mac os x" version: "10.

Feb 12, 2010 - 1 minute read - inject junit lookup module netbeans populate replace test

JUnit and Netbeans. Injecting in objects in the default Lookup

If you need to unit test classes in a netbeans module and the classes use the Lookup.getDefault() to “lookup” things that you want to mock you probably wonder how you can place the mock objects in the default Lookup Adding objects to the Netbeans’s default Lookup is relatively simple. Here is the answer: Replace the `Lookup` instance returned by the `Lookup.getDefault()` by defining a new entry in `META-INF/services`. It’s just a matter of adding a file named org.

Jan 27, 2010 - 2 minute read - bluetooth mac macosx mobile pan personal area network snow leopard sonyericsson telephone tether tethering

Connect to the internet via Bluetooth PAN with Mac OS X Snow Leopard

If you want to access the internet via your phone 3G/GPRS connection you can use Bluetooth PAN. In my case I have a Sony Ericsson W715 so the first thing to do is to tell the phone which connection to use Menu > Settings > Connectivity > Bluetooth > Data accounts and select the account that you normally use to browse the net from the phone. Then turn on bluetooth

Jan 18, 2010 - 3 minute read - cancel cancellable indicator java netbeans progress progresshandle requestprocessor runnable schedule task tasklistener ui

Cancellable tasks and progress indicators [Netbeans Platform]

Progress indicator (indeterminate mode) which allows to cancel the task The easiest way of having a cancellable progress indicator (Progress API) for a task in Netbeans Platform Application is the one below but it’s only worth for tasks that don’t update the progress indicator (indeterminate mode) until the task is finished. If you want to update the progress indicator (ProgressHandle) inside the task itself look at the second example. package com.

Jan 14, 2010 - 3 minute read - connection connectionurl hsql hsqldb java jpa netbeans openjpa persistence shutdown url

OpenJPA, HSQLDB and proper shutdown

I’m starting to get tired of OpenJPA/HSQLDB setup that I’ve trying: it seems to give more problems than it solves. Now I discovered that the HSQL db wasn’t been properly shutdown and for reasons that I’m investigating, if the HSQL db is not propertly closed (SHUTDOWN command) it’s impossible to reopen it again. It fails with a IndexOutOfBoundsException. Caused by: org.hsqldb.HsqlException: error in script file line: 33 java.lang.IndexOutOfBoundsException in statement [SET TABLE PUBLIC.