Portlet using blob data type causes java.lang.IllegalArgumentException: interface org.hibernate.engine.jdbc.WrappedBlob is not visible from class loader

Description

Due to Hibernate issue HHH-8310 the following error message may appear when defining Blob columns.

Setting lazy="false" for Blob in service.xml was the key to reproduction, however build-service task failed with this attribute even though it can be set to false according to liferay-service-builder_7_0_0.dtd and liferay-service-builder_6_2_0.dtd for 'Blob' type fields. To overcome this I set it instead manually in the generated portlet-hbm.xml like this:

Steps to reproduce

  1. Deploy the attached portlet named LPS-42478-Blob-test-portlet-7.0.0.1.war

  2. Add LPS-42478-Blob-test-portlet to a page

  3. Browse a small file and Upload it

Expected
Uploaded file is listed by the portlet and no error is logged
Result
Porlet doesn't render and below error is logged

Attachments

4

Activity

Show:

Raven Song March 14, 2017 at 6:42 PM

PASSED Manual Testing following the steps in the description.

Fixed on:
Tomcat 7.0.62 + MySQL 5.6. Portal ee-6.2.x GIT ID: 15af44dbe32bbab820d17f908f732729c0169774.

Uploaded file is listed by the portlet and no error is logged.

Michael Prigge March 10, 2017 at 9:17 AM

Just started reviewing dustinryerson/liferay-portal-ee#2651.

 

Sent from GH

Raven Song March 9, 2017 at 4:39 PM

PASSED Manual Testing following the steps in the description.

Fixed on:
Tomcat 8.0.32 + MySQL 5.6. Portal master GIT ID: a61624d5129b8d26f7ba6a9c07f76130fd565b28.
Tomcat 8.0.32 + MySQL 5.6. Portal ee-7.0.x GIT ID: 606d9d902aef50ca425f401e51ef30ff8d02e70e.

Uploaded file is listed by the portlet and no error is logged.

Tibor Lipusz December 1, 2016 at 4:36 AM
Edited

Fixed in Hibernate 4.3.6 & 4.2.15
master@5be4ea8c6e7fe0210f95b51d6572cd51e19764d1 uses 3.6.10

Hibernate Fix: https://github.com/hibernate/hibernate-orm/commit/c871002da797716b309a581501d3f2ecc3a3d52e

Proposed Fix Process:

  • Add Ant task "build-hibernate" into portal-impl

  • Download hibernate source for the given version

  • Get the patch file based on the original change

  • Extract the source

  • Patch the files

  • Compile patches files

  • Re-package hibernate jar

  • Commit

  • Update versions.xml wiht info about the changes

John Voltaire Maximo September 8, 2015 at 8:15 PM

I'm currently facing this problem, I'm using 6.2.... how do we do this for blob images from the database?

Fixed

Assignee

Reporter

Branch Version/s

7.0.x
6.2.x

Backported to Branch

Committed

Fix Priority

Git Pull Request

7.0 Fix Pack Version

Story Points

Components

Priority

Created November 20, 2013 at 1:44 AM
Updated June 25, 2023 at 10:26 PM
Resolved March 13, 2017 at 10:46 AM