Wednesday, October 19, 2011

Both java 6 and 7 got updated

Java 6 is on update 29 and java 7 is on update 1. enjoy!

Update:
since it was said that the crash bug fixed from dzone http://java.dzone.com/news/java-7-and-lucene-bug-saga so I moved my major dev point to the java7u1

But imediately i got this from my js script engine related code, sure there was no issues on java6 before:
sun.org.mozilla.javascript.internal.InterpretedFunction cannot be cast to java.lang.Double

So I have to comment out all my script engine related test out to be quick and dirty.

UPDATE 2: I got stuck again, this time on
aspectj-maven-plugin
looks like it cannot handle 1.7 compiliance level.

So I have to set this to 1.6 for aspectJ

Update 3 (10/25/11) I have to move back to 1.6 due to some
java.lang.VerifyError: Expecting a stackmap frame at branch target 25.

Spring 3.x and Cassandra using Hector

To config Spring with Cassandra, you can use the HectorTemplate class in the Hector core. the configuration is something like this:

[sourcecode language="xml"]
<bean id="hectorTemplate"
class="me.prettyprint.cassandra.service.spring.HectorTemplateImpl"
init-method="init">
<property name="cluster">
<bean class="me.prettyprint.cassandra.service.ThriftCluster">
<constructor-arg value="${cassandra.clustername}" />
<constructor-arg>
<bean
class="me.prettyprint.cassandra.service.CassandraHostConfigurator">
<constructor-arg value="${cassandra.dburl}" />
</bean>
</constructor-arg>
</bean>
</property>
<property name="keyspaceName" value="${cassandra.keyspace}" />
<property name="replicationStrategyClass"
value="org.apache.cassandra.locator.SimpleStrategy" />
<property name="replicationFactor" value="${cassandra.replicationfactor}" />
</bean>
[/sourcecode]


please note that I am using Cassandra 1.0 and hect 1.0 now. if you are using some other versions, you might need to make sure all the referred classes are in the package.

After you have the template then you can use it as other spring template.