Desktop Apps Be Damned

Posted by Double Compile on Monday, June 6. 2011 in Java

As a side project, a couple of friends and I for a long time have been working on the Elysium role-playing game. I had an idea yesterday for a character generator and campaign builder. I remember from years past when I used to play Dungeons and Dragons that there was a free software character generator called PCGen. I took a look at it to see how easily I could develop plug-ins or data sets that applied to our game system. I didn't get a warm fuzzy about this looking at the PCGen docs.

Jonathan Hawk's Rule of Programming #0 states that you will try to extend or reuse something, but find out it sucks and end up doing it yourself anyway. I'm not saying that PCGen sucks by any stretch, but I don't think our non-d20 game system will be easily implementable there. Time to roll our own.

I toyed with the idea of implementing it using Eclipse RCP, even going so far as to downloading the RCP environment and doing a tutorial. I was pretty impressed how easy it was to get a simple app going with Eclipse RCP. It was at this point that a few sudden realizations hit me.

  1. I hate Java. I do it all day at work and with each keystroke, a little bit of my soul is stolen.
  2. I run Linux. If we wanted to distribute this cross-platform, I would have to do some leg work to get it built on Windows and Mac OS X machines.
  3. I gave thought to recent trends in computing of late: mobile and distributed applications. Nothing new and exciting is happening with native desktop programs anymore.

I decided to abandon the idea that this application needs to be locally-installed on a person's computer, instead realizing that with HTML 5, I can create an app that runs across different devices (including phones and tablets) and would allow people to store their created characters and game information both locally on their device and remotely.

To the ☁! Desktop Apps Be Damned!

2 Comments More...
Defined tags for this entry: , ,

Spring + Hibernate Search 3.1.0 = ArrayStoreException

Posted by Double Compile on Tuesday, January 19. 2010 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.

1 Comment More...

Page 1 of 1, totaling 2 entries

Quicksearch

Search for an entry in /dev/weblog:

Did not find what you were looking for? Post a comment for an entry or contact us via email!

cronjob