Spring + Hibernate Search 3.1.0 = ArrayStoreException

Posted by Double Compile. Tuesday, January 19. 2010, 11:30 AM in Java

I'm using Spring Framework version 3.0.0 (although, I'll bet the same problem would happen with 2.x). I'm using Hibernate Search 3.1.0 (That's what's in Maven. I wonder why there's no 3.1.1).

Trying to use the configuration as follows inside of a Spring configuration document.

<property name="eventListeners">
<map>
<entry key="post-update" value-ref="fullTextEventListener" />
<entry key="post-delete" value-ref="fullTextEventListener" />
<entry key="post-insert" value-ref="fullTextEventListener" />
<entry key="flush">
<list>
<bean class="org.hibernate.event.def.DefaultFlushEventListener" />
<ref local="fullTextEventListener" />
</list>
</entry>
</map>
</property>

Upon running some unit tests, I get a nasty Exception stack, with the following at the root.

Caused by: java.lang.ArrayStoreException
	at java.lang.System.arraycopy(Native Method)
	at java.util.ArrayList.toArray(ArrayList.java:306)
	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:759)
	at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
	... 57 more

The root cause of the problem (and I needed to debug the Spring/Hibernate internals to figure this out) is that FullTextIndexEventListener does not implement the FlushEventListener interface in version 3.1.0, but it does in 3.1.1.

Solution: upgrade (if you're using Maven, try the JBoss repository which has the latest stuff) or omit the "flush" event from the configuration.

ColdFusion is Painful. Stop Using It.

Posted by Double Compile. Tuesday, November 17. 2009, 11:28 AM

I'm a software engineer with 10 years under my belt, and my specialty is web-based applications. I have used a number of platforms to author applications of all sizes. PHP is very near-and-dear to my heart (Stop laughing. I'll save my defense of PHP for a separate post). I have used Java EE. I have used ASP.Net. I have also used ColdFusion. (To a lesser extent, I have used Perl and Python, but only once each and it's been years). I am comfortable saying I have enough experience with those platforms to give ups and downs.

The purpose of this article is to lay out the downs of ColdFusion, for in my opinion, it has few ups. To quote a comment in this blog post, "Coldfusion indeed sucks major spidermonkey testicles." This post is not a reasonless rant; I have many reasons listed below that ColdFusion should be avoided and they're pretty good. This is not another "ColdFusion is a dead language" post. Far from it, I know ColdFusion is still alive and kicking, and that is a sad truth.

Continue reading "ColdFusion is Painful. Stop Using It."

Defined tags for this entry: , , , ,

GRUB error 24 in Ubuntu Karmic and the fix

Posted by Double Compile. Thursday, November 12. 2009, 11:59 AM in GNU/Linux

I applied a bunch of updates to my installation of Ubuntu 9.10 Karmic Koala this morning. Let it be known that I upgraded to Karmic from a clean install of Jaunty, and my root partition was once an ext3 file system turned into ext4. I returned from taking a shower to find the system had completely locked up, so I rebooted. Anyway, I got just past GRUB and received the following error:

24 : Attempt to access block outside partition
ohhaybadnewz

As it turns out, the GRUB Manual gives the following as a possible reason.

"This error is returned if a linear block address is outside of the disk partition. This generally happens because of a corrupt filesystem on the disk

So I inserted the Live CD and ran fsck.ext4 -f on the device in question, and no errors were found. Peculiar.

Some Google searching turned up this Launchpad issue, which in turn pointed me to a blog post called "Grub voodoo error no 13/24 and how do i fixed it" for a possible fix.

Allow me to quote from that post (thanks so much, Marius) the correct procedure to fix this beast in case anyone else runs into this little problem. Fill in /dev/sda with the correct device name for your disk containing the root partition.

$ sudo su
$ mount /dev/sda1 /mnt
$ mount --bind /dev /mnt/dev
$ mount --bind /dev/pts /mnt/dev/pts
$ mount --bind /dev/shm /mnt/dev/shm
$ mount -t proc none /mnt/proc
$ mount -t sysfs none /mnt/sys
$ grub-install /dev/sda --root-directory=/ --recheck

I rebooted and everything was fine; crisis averted.

Defined tags for this entry: , , , , ,

So long, Geocities!

Posted by Double Compile. Monday, October 26. 2009, 04:59 PM

Well, GeoCities, you had a very long run. A small part of me is sad to see you go. Another part of me is getting intoxicated in celebration.

GeoCities can be explained as a writhing and shrieking cesspool of tag soup within which, once one managed to dredge through the utterly purposeless, gaudy, and pulsing adornments, one could find minuscule amounts of useful information.

I remember your competitors way back when: Tripod, Angelfire, and even Crosswinds. You made it easy for the first generation of Web neophytes to express themselves in a hideous and grotesque manner as illustrated by Bruce Lawson (coincidentally, in reference to the intoxication comment above, I met Bruce at OSCON and exchanged pleasantries over alcohol).

So here's to you o harbinger of pedestrian drivel! Don't let the door hit you on the animated .gif ass on your way out.
Defined tags for this entry: , ,

The VARCHAR controversy

Posted by Double Compile. Tuesday, September 1. 2009, 05:32 PM in Databases

Today's exchange originated from a short-lived discussion on Twitter.  Everyone familiar with the acronym VARCHAR? It's short for variable character, which is a SQL data type.

Since it's short for variable character, one would think the correct pronunciation is /ˈvær.ˈkʰæɹ/.  (For those of you who don't read IPA, that's var—rhymes with bare—and char—also rhymes with bare).

It drives me up a wall when I hear someone pronounce it like it rhymes with "Far Car", or worse still, soften the "Ch" like in Charbroiled.

Anyway, these are my favorite tweets in regards to the matter:

  • @RealBigDannyT: VARCHAR STARE!!!
  • @rizza: I, too, char varry much about how people pronounce this.

Now, don't even get me started on how you should pronounce "SQL".

Defined tags for this entry: , , ,

On the road to Xen

Posted by Double Compile. Sunday, July 12. 2009, 09:41 AM

So I put an extra gigabyte of RAM in my modest development server and installed Xen to do some playing around.  Amongst the many new experiences, I saw this message which made me chuckle.

clocksource/0: Time went backwards: ret=343f6d032989 delta=-17674760 shadow=343f4cbff272 offset=21530354

It looks as though I inadvertently created a DeLorean DMC-12.

Defined tags for this entry: ,

Furthering Ubuntu

Posted by Double Compile. Wednesday, April 29. 2009, 11:13 AM in GNU/Linux

In recent months, I've taken to spreading the love that is Ubuntu. 

For Christmas, I gifted it to my parents and installed it on their PCs.  My dad uses the Internet and checks his e-mail, my mom does some more power user things, like scanning documents, syncing music to her iPod Nano, and managing her photos (I even got her dated Windows Pocket PC syncing correctly).  They both enjoyed not having to pay to renew their security packages.

When Jaunty Jackalope came out, I made sure my friend Dustin got it installed—who had more malware infections on his Windows XP laptop than I've ever seen.  He was blown away by how simple the software installation process is, and he's now considering marriage with Compiz Fusion.  Alas, I couldn't get Planescape Torment working for him under Wine.

Deidre, one of the players in my tabletop roleplaying group, has requested a Live CD to try it out—soon she too will be one of us.

Not too long ago, I set up my friend Serge with a dual boot of Ubuntu on top of pre-existing Vista.  The only reason he even agreed to keep Vista there was because his Intel graphics chipset did not play well with WoW on Wine.

Serge's wife Cristi has been declaring that she's fed up with her Windows XP laptop and just today mentioned it's now unusable thanks to malware infections.  We have plans to get together soon to get her hooked up as well.  The best part—her direct words were: "I would like to destroy Windows forever with the IRON FIST OF UBUNTU JUSTICE!!"

Defined tags for this entry: , ,

Jack Thompson Disbarred! RIAA lost its $222K verdict!

Posted by Double Compile. Thursday, September 25. 2008, 04:25 PM in Law

The Florida Supreme Court has approved Judge Dava Tunis' recommendations for the permanent disbarment of John B. "Jack" Thompson, forever and ever, amen.  They're also slapping him with $43,675.35 in disciplinary costs (facial!).

Basically, he's got 30 days to appeal or it's GAME OVER.  Of course, appealing will be very difficult because he needs another attorney in good standing with the bar to file the motion (so he can't do it himself).

This comes on the heels of the news that the RIAA lost its $222K verdict against Jammy Thomas! ZDNet writes:

U.S. District Court Judge Michael Davis dismissed the verdict, saying it was based on the faulty "making available" theory of distribution. Thomas will face a new trial, in which the RIAA will have to prove actual distribution.

The decision means the RIAA now has zero wins at trial, Wired notes.

Apparently, Thursday is a good day for law. 

Defined tags for this entry: , , ,

Eclipse Ganymede

Posted by Double Compile. Wednesday, June 25. 2008, 08:43 PM in Open Source

Eclipse Ganymede came out today.  (Those who donated could have gotten it earlier).

Here's a screenshot of my download speed for Ganymede.

25.8 of 151MB (2.1MB/sec)

Thanks for ~2.0MiB/sec download speeds, Verizon FiOS!

Now I'm about to install the latest Integration version of PDT, so we'll see how that goes.

Defined tags for this entry: , ,

/dev/audio

Posted by Double Compile. Thursday, May 29. 2008, 12:49 PM

I like programming and listening to music.  It helps set a pace for me to work.  This little gem just popped in my head while I was listening to AC/DC:

<?php
for(; $those->aboutToRock; ) {
    $we->saluteYou();
}

Yes, I know. I'm awesome.

Defined tags for this entry: ,

Xyster Build 6

Posted by Double Compile. Monday, May 19. 2008, 06:54 PM in Xyster

Build 6 of the Xyster Framework has been released. Tons of new features both in core and in incubator.

Please head over to the Xyster site and grab yourself a copy.

Defined tags for this entry: , ,

Oracle 10g XE and OpenVZ

Posted by Double Compile. Tuesday, May 6. 2008, 06:14 PM in Databases

Last night I tried to install Oracle 10g XE on my Debian-based database server for testing purposes. Tried is the key word here.

Interestingly enough, Oracle offers a deb repository for this purpose. Add the following line to your /etc/apt/sources.list:

deb http://oss.oracle.com/debian unstable main non-free

Then execute the following commands as root (or with sudo) to add Oracle's public signing key and then install Oracle XE:

# wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle  -O- | sudo apt-key add - 
# apt-get update
# apt-get install oracle-xe

Here's the catch: my database server is an OpenVZ VPS. The Oracle installer checks for a sufficiently large swap partition and will bomb out if one of a sufficient size is not found. OpenVZ VPSs do not have a swap partition.

OpenVZ does support swap space, and that swap space can be set with barriers and limits, but the swap space is as a whole meaning that there is one swap space for the entire system, not a user-configurable swap space per-VPS.

So now comes the task of tricking the installer to think I the VPS has a swap partition, or trying to get it on there some other way.  Stay tuned for the nuttiness.

Oracle is stupid.

Defined tags for this entry: , , ,

Shutdown Day

Posted by Double Compile. Thursday, May 1. 2008, 11:46 AM

Hey, this is a quick reminder.  Don't forget about Shutdown Day on May 3rd.

Be part of one of the biggest global experiments ever to take place on the Internet. The idea behind Shutdown Day is to find out how many people can go without a computer for one whole day, and what will happen if we all participate!

Defined tags for this entry:

Open Screen say what?

Posted by Double Compile. Thursday, May 1. 2008, 10:18 AM

You might know by now that Adobe makes my blood boil sometimes.  Their needlessly expensive graphics and publishing package represents all that open source is not.  When I read news blips this morning about Open Screen, I was pleasantly surprised.

This blurb taken from a CNet article:

Wadhwani said the Open Screen project has five basic elements. Adobe will remove license restriction on the .swf file format. "It is published already, but in order to view it you have to say you will not create a competing player," said Wadhwani. "We're lifting that restriction. People have been worried about vendor lock-in. This will remove that obstacle, and concern."

Adobe will also remove licensing fees for embedding Flash Player on devices. The software has always been a free download for PC users. But Adobe has charged for embedding on devices. Those charges will disappear with the next release of the software.

Even though Adobe still rubs me the wrong way, this move is entirely in the right direction. Maybe this means I can finally get a working Flash player on my x84_64 notebook.

Defined tags for this entry: , , ,

Ubuntu Hardy Heron Install Live Blog

Posted by Double Compile. Friday, April 25. 2008, 05:42 PM in GNU/Linux

Ubuntu 8.04 Hardy Heron came out yesterday. I meant to upgrade yesterday but, on a whim, I thought I'd install from scratch and live blog it. What follows is the result of that effort.

Did I mention I ordered the limited edition Hardy Heron t-shirt from the Canonical store? Because I did.

Continue reading "Ubuntu Hardy Heron Install Live Blog"

Defined tags for this entry: , , , , , ,