arundhaj

all that is technology

J2EE server for Webfaction

 

Webfaction doesn't have j2ee web servers by default. Users have to install it manually, by creating a "custom application listening on port".

I first started with Apache Tomcat, later ended with high memory usage than permitted for my account. My account's limit is 256MB RAM, however Tomcat was consuming around …

UnsupportedClassVersionError unsupported major.minor version 51.0

 

For J2EE webapps, when development environment is different from production environment, deploying could be tedious.

One such issue I encountered is the difference in JDK version. My development machine have latest JDK1.7 whereas my production servers have JDK1.6. When deploying the war on this server, I was getting …

Hbase row filter with regex

 

Querying Hbase rows based on RegEx with spring-data-hadoop framework; following code snippet would help.

To keep it simple, I query the table to get only those row keys that match my INPUT. In this case the row key structure is 10 digit followed by a string.

String name = String.format …

Spring data hadoop webapp

 

When I got started to try spring-data-hadoop as a webapp, I found no samples online. All tutorials were either with configurations or as a standalone application. With a bit of experiments and exploration I managed to create a simple webapp and hosted it on my local tomcat server. I've uploaded …

HibernateException No Session found for current thread

 

While programming a web application with Spring and Hibernate, came across HibernateException: No session found for current thread. Apparently found out I was missing @Transaction which was causing trouble.

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.HibernateException: No Session found for current thread
    org …

Disable animation and improve Ubuntu performance

 

Today I've installed Ubuntu 12.10 (Quantal Quetzal). The system is solid; over few minutes of hands-on, one part that bothered me was the windows animation. As a software developer, I know, how difficult it is to implement animation. However, my machine is not fast enough to catch up with …

Moving folders between SVN repos

 

To move a folder or document between SVN repositories by retaining history, following steps would help.

Step I

Dump the entire svn repository to a dump file with svnadmin dump. If the repository is too big to dump, better pipe the next two commands. Command here is split in the …

getGeneratedKeys with PostgreSQL

 

In a complex SQL transaction where the tables are normalized and split, it becomes necessary to put primary key of first tables' insert as a foreign key of subsequent tables' inserts. Though java.sql.PreparedStatement have getGeneratedKeys, it works pretty different for PostgreSQL than MySQL.

The following code block shows …

GIT post receive hook

 

Whenever I make changes to my site, I end up doing lot of manual tasks deploying it to the production.

So I first moved the code to my self-hosted GIT server. This reduced most of the manual tasks, however deploying were still tedious.

This is where GIT's post-receive hook came …

HTTP 406 response from spring controller

 

On creating a @ResponseBody annotated spring controller that sends JSON, may lead to "406 Not Acceptable" response though the code/logic works fine.

The cause of this response is because, the controller cannot find the correct HTTPMessageConverter to satisfy the @ResponseBody annotated return value.

Check if, applicationContext.xml file has …