Loading

Tag Archives: java

Disable DOM DTD validation

setValidating(false) will not prevent DTD validation, but you can set http://apache.org/xml/features/nonvalidating/load-external-dtd feature to false. I think is a Xerces-only feature, though, it may not be recognized by other parsers.

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
[...]

STaX: OutOfMemoryError when parsing big files

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)
[...]

JTable, Beans Binding and JPA pagination

In my previous post I talk about JTable and JPA pagination through a custom TableModel.
Now working directly with TableModel is not want you want to do, you want to use Beans Bindings because it means less manual coding and a lot of help from the IDE (like Netbeans).
With netbeans you can easily bind [...]

JTable and JPA Pagination through custom TableModel

I really want to talk about JTable, Beans Binding and JPA pagination but I think I need to write about JTable and JPA pagination first. So I will take the Beans binding stuff in another post.
By the way, choose wisely your JPA Provider/DB Provider combination, as some combinations will not give you any real paginations [...]

Adding support for opening dot files to GraphBrowser

I spent some time on GraphBrowser, starting off the project, the first step has been to add basic support for opeining Graphviz DOT files.
There are already some pages on the net talking about how to add open file support for new file types in NetBeans.

File Type Integration Tutorial

So there is no need to [...]

GraphBrowser

I decided to start a small project trying to port the GUESS framework into Netbeans RCP.

The plan is to replace the GUESS own graphical library with Netbeans Visual Library stuff and replace the GUESS Python like interpreter with something more along the lines of JSR 223 Scripting for the Java Platform.
For the moment I [...]

Painting LabelWidgets on top of the ConnectionWidget – Netbeans Visual Library

I was fiddling with the Netbeans Visual Library again, trying to show a complex graph on screen and I run into a problem: There were so many connection in the graph that some widgets were hard to read because the ConnectionWidget arrows were printed over them.
So I tried to I try to rearrange the [...]

Netbeans: “Problem when deserializing TopComponent for tcID”

Today I experienced a strange problem. Or I thought it was strange . I just checkout a my project from Subversion into Netbeans and it didn’t work!. How come? I have another working copy that works just ok. So I check the logs in $app/build/testuserdir/var/log/messages.log and I found

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
INFO [org.netbeans.core.windows.persistence]: [PersistenceManager.getTopComponentForID] Problem when deserializing TopComponent [...]

Firefox detecting wrong Java Plugin version on Windows.

First read this Mozillazine page
In my case the problem was that some program overwrote the registry entry HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Runtime Environment/BrowserJavaVersion with the old value 1.6.0_01. When I set it back to 1.6.0_06 everything worked fine again.

Now the addons window looks like

before it showed Java Platform SE 6 U1 instead

Bookmark It

Hide Sites

$$(‘div.d323′).each( function(e) { [...]

Java WebStart UnavailableServiceException

If you are getting javax.jnlp.UnavailableServiceException from javax.jnlp.ServiceManager.lookup() or if javax.jnlp.ServiceManager.getServicesNames returns null you must be aware that those call only return useful thing when you run your code fromt the Java Web Start environment.
It´s not enough to include the jnlp.jar or javaws.jar in the classpath.
For example to make it work from Netbeans you must [...]