Showing posts from March, 2013

Jackson - BeanSerializer.serialize and ContainerSerializers$CollectionSerializer.serialize error

In a Spring + Hibernate + Jackson project while calling:



@RequestMapping(value="/getAllBookmark", method = RequestMethod.GET) public@ResponseBody List getAllBookmarkJSON() { List list = this.bookmarkDAO.getAllBookmark(); return list; }

, was getting the following error:

at at$CollectionSerializer.serialize( at$CollectionSerializer.serialize( at
The problem was related to a cyclic reference (click here for more information) in a relation type "many-to-one" between Bookmark and Image:


publicclass Bookmark implements Serializable { privatestaticfinallongserialVersionUID = 1L; private Lo…

Oracle - Conceder permisos de acceso a una table

Script para conceder permisos de acceso a una tabla/view a un User/Schema:

grant select on to ;

Con opcion "grantable"

grant select on to ; with grant option;

Hibernate - HibernateException: createQuery is not valid without active transaction

Problem:SEVERE: Servlet.service() for servlet mvc-dispatcher threw exception
org.hibernate.HibernateException: createQuery is not valid without active transaction
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(
at com.sun.proxy.$Proxy20.createQuery(Unknown Source)
at com.mkyong.common.dao.MessageDAO.getAllMessages(
at com.mkyong.common.controller.MessageController.printMessageList(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(