Category Archives: Java

Cannot change version of project facet Dynamic Web Module to x.x

1. Problem

When you create maven web project it default using version servlet 2.3. Now you want change servlet 2.5 or 3.0. You come and manual change on web.xml as below

<web-app xmlns="" xmlns:xsi=""

And now your project on eclipse alway has red mark and with problem show error:

Cannot change version of project facet Dynamic Web Module to 3.0.

2. Solution

Right click on project in eclipse project explorer, choose properties-> Project facets-> uncheck on Dynamic Web Module and click  Apply. Right click on project and choose maven-> update project the project will automatic update and resolve above issue.

jsp EL not working

1. Problem

EL expression on JSP page not working

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%>
<% pageContext.setAttribute("name", "thinh"); %>
<h2>Hello ${name}!</h2>

Output become

Hello ${name}!

the content of web.xml

 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "" >


2. Cause

This is cause EL feature not enable on this application. Web servlet 2.3 not enable EL by default.

3. Solution

We have two solutions to solve this issue:

  • Using web servlet 2.5
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns=""
  • Enable EL by directive on JSP
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8" <code>isELIgnored="false"</code>%>

HibernateException: null index column for collection

1. Symtom
When access one-to-many relation with collection mapping by list. You may be get this error

Caused by: org.hibernate.HibernateException: null index column for collection: org.ow2.bonita.runtime.model.Execution.executions

at org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(

at org.hibernate.collection.PersistentList.readFrom(

at org.hibernate.loader.Loader.readCollectionElement(

at org.hibernate.loader.Loader.readCollectionElements(

at org.hibernate.loader.Loader.getRowFromResultSet(

at org.hibernate.loader.Loader.doQuery(

at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(

at org.hibernate.loader.Loader.loadCollection(

at org.hibernate.loader.collection.CollectionLoader.initialize(

Continue reading HibernateException: null index column for collection