February 12, 2010 – 12:47 am
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 [...]
January 18, 2010 – 10:52 pm
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 [...]
By ruben.laguna
|
Also posted in java
|
Tagged cancel, cancellable, indicator, netbeans, progress, progresshandle, requestprocessor, runnable, schedule, task, tasklistener, ui
|
January 14, 2010 – 8:28 pm
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 [...]
November 16, 2009 – 9:04 pm
It seems that source attachement for Library Wrapper Modules in Netbeans 6.8 Beta doesn’t work properly. I opened a bug report here https://netbeans.org/bugzilla/show_bug.cgi?id=176800#c9 and it seems that in the process I also spotted that “Swing Layout Extensions” library definition that comes with NB 6.8 it’s also wrong (see https://netbeans.org/bugzilla/show_bug.cgi?id=176800#c7)
Bookmark It
Hide Sites
$$(‘div.d1006′).each( function(e) { e.visualEffect(’slide_up’,{duration:0.5}) [...]
October 1, 2009 – 8:14 am
To add a XJC task to a Netbeans build.xml you need to add a -pre-compile target to your build.xml. If it’s a netbeans module build.xml then you need to make compile depend on -pre-compile and projectized-common.compile (see example below). For regular Java Applications just define the -pre-compile target as the standard build.xml will call [...]
By ruben.laguna
|
Tagged build, build.xml, classes, classpath, compile, jaxb, netbeans, project, schema, target, taskdef, xjc, xml
|
September 28, 2009 – 8:02 pm
Are you getting a ClassCastException in a Netbeans Platform Application, when you are you sure that the class can be casted? Then check http://wiki.netbeans.org/PlainView.jsp?page=DevFaqModuleCCE. This is most likely the result of the the classes being loaded by different classloaders. So JAXBContextImpl cannot be cast to JAXBContext because that JAXBContext is from Classloader “A” and JAXBContextImpl [...]
September 27, 2009 – 1:30 am
If you are getting
java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to javax.xml.bind.JAXBContext
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:145)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:277)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
[...]
September 18, 2009 – 5:01 pm
If you create the persistence.xml manually in Windows the file will be created with CRLF line endings (windows style line endings) ,that will prevent Netbeans for recognizing Netbeans will not recognize it as the special file it is and won’t be able to to open it with the special/custom visual editor.
I opened an bug [...]
By ruben.laguna
|
Also posted in java
|
Tagged break, crlf, editor, ending, eol, feed, file, filetype, jpa, lf, line, line feed, linebreak, linefeed, netbeans, persistence, recognition, type, visual
|
September 16, 2009 – 7:50 am
In the build.xml of the project (likely this will be a Java Class Library project), override -post-compile or -pre-jar and invoke <openjpac/>. You will need to add the build/classes and the openjpa jars to <taskdef/> and <openjpac/>. The <openjpac/> will enhance all classes mentioned in persistence.xml (which has to be in the classpath)
<?xml version="1.0" [...]
By ruben.laguna
|
Tagged ant, build, build.xml, classnotfoundexception, classpath, enhancer, jpa, netbeans, openjpa, openjpac, task
|
August 25, 2009 – 7:30 pm
Java 6 includes STaX , when I tried to parse a Evernote backup file with it, I got a “OOME” error.
java.lang.OutOfMemoryError: Java heap space
at com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append(XMLStringBuffer.java:205)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.refresh(XMLDocumentScannerImpl.java:1520)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.invokeListeners(XMLEntityScanner.java:2070)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.peekChar(XMLEntityScanner.java:486)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2679)
[...]
By ruben.laguna
|
Also posted in mac, windows
|
Tagged api, bug, exception, implementation, jar, java, library, netbeans, oome, outofmemoryexception, parser, parsing, provider, service, spi, stax, woodstox, wrapper, xml
|