Disabling context-sensitive LOB creation as the createClob () method caused an error

I am using Hibernate 3.5.6 with Oracle 10g. During initialization, I see an exception below, but the application itself is working fine. What is the reason for this exception? and how can it be fixed?

Exception
Disabling LOB contextual creation as the createClob() method caused an error: java.lang.reflect.InvocationTargetException

Info
Oracle Version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 JDBC Driver: Oracle JDBC Driver, Version: 11.1.0.7.0

+78
java oracle10g hibernate clob
Jan 03 '11 at 22:00
source share
16 answers

Disable this warning by adding the property below.

For Spring application:

 spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false 

Normal JPA:

 hibernate.temp.use_jdbc_metadata_defaults=false 
+67
Feb 28 '17 at 12:33
source share

As you noticed, this exception is not a real problem. This happens at boot time when Hibernate is trying to get some meta information from the database. If this annoys you, you can disable it:

 hibernate.temp.use_jdbc_metadata_defaults false 
+65
Jan 04 '11 at 11:01
source share

Looking at comments in the source :

Basically here we just check if java.sql can be called. The connections for LOB creation are added in JDBC 4. We not only check if the java.sql.Connection connection declares these methods, but also does the java.sql.Connection instance implement them (i.e. maybe not just throwing an exception).

So, he is trying to determine if he can use some of the new JDBC 4 methods. I think your driver may not support the new LOB creation method.

+25
Jan 04 2018-11-11T00:
source share

To get rid of the exception

 INFO - HHH000424: Disabling contextual LOB creation as createClob() method threw error :java.lang.reflect.InvocationTargetException 

In the hibernate.cfg.xml file add below property

 <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> 
+22
Apr 09 '14 at 8:24
source share

To hide the exception:

For Hibernate 5.2 (and Spring Boot 2.0), you can use the use_jdbc_metadata_defaults property, which others have indicated:

 # Meant to hide HHH000424: Disabling contextual LOB creation as createClob() method threw error spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults: false 

Or, if you want you to not have any side effects from the above parameter (there is a comment warning us about some of the side effects of Oracle, I don’t know if this is true or not), you can simply turn off exception logging like this :

 logging: level: # Hides HHH000424: Disabling contextual LOB creation as createClob() method threw error org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl: WARN 
+22
Feb 05 '18 at 13:38
source share

Update this to use Hibernate 4.3.x / 5.0.x - you can simply set this property to true:

 <prop key="hibernate.jdbc.lob.non_contextual_creation">true</prop> 

to get rid of this error message. The same effect, but without detail, "threw an exception." See the LobCreatorBuilder source for more details.

+12
Dec 15 '15 at 12:15
source share

Just add the line below to application.properties.

 spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults: false 
+9
Jun 08 '18 at 7:50
source share

Updating the JDBC driver to the latest version removed the nasty error message.

You can download it here:

http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html

Free registration required.

+4
Apr 04 '14 at
source share

If you installed:

 hibernate.temp.use_jdbc_metadata_defaults: false 

this can cause problems with PostgreSQL when your table name contains a reserved word similar to the user. After insertion, he will try to find the sequence of identifiers with:

 select currval('"user"_id_seq'); 

which will obviously fail. This is at least with Hibernate 5.2.13 and Spring Boot 2.0.0.RC1. We did not find another way to prevent this message, so now just ignore it.

+4
Feb 14 '18 at 13:15
source share

The problem arises because you did not select the appropriate JDBC. Just download and use JDBC for oracle 10g, not 11g.

+1
Oct 09 '15 at 20:12
source share

As mentioned in other comments using

hibernate.temp.use_jdbc_metadata_defaults = false

... fix the annoying message, but can lead to many other amazing problems. The best solution is to simply disable the creation of the context LOB with this:

hibernate.jdbc.lob.non_contextual_creation = true

This will force Hibernate (in my case its 5.3.10.Final) to skip checking the JDBC driver and simply display the following message:

HHH000421: Disabling contextual LOB creation as hibernate.jdbc.lob.non_contextual_creation is true

So far, it seems that this parameter does not cause any problems.

+1
May 22 '19 at 12:00
source share

OH MY GOD! After a lot, I got a solution to this problem. I am using Hibernate-5 and postgress version 10 and PGSimpleDataSource for a data source. We need to add the properties below to the hibernate properties file.

Environment.NON_CONTEXTUAL_LOB_CREATION = "hibernate.jdbc.lob.non_contextual_creation" hibernateProp.put (Environment.NON_CONTEXTUAL_LOB_CREATION, true);

he will solve all the problems.

0
Nov 30 '18 at 12:02
source share

I encountered this error when my web application was launched on Linux by a user who was logged in with insufficient access rights. This error

org.hibernate.engine.jdbc.internal.LobCreatorBuilder - HHH000424: Disabling the creation of the context large object as the createClob () method caused an error: java.lang.reflect.InvocationTargetException

Other errors / exceptions usually precede, especially from your application server, for example, for Tomcat:

org.apache.catalina.LifecycleException: failed to initialize component ...

or

java.lang.UnsatisfiedLinkError: ... cannot open a shared object file: there is no such file or directory

Decision:

  1. Stop the current instance of your web application.

  2. Log in as superuser or users with sufficient access rights, such as root

  3. Restart the web application or call the previous function again.

0
Jan 04 '19 at 3:05
source share

Remove @Temporal annotations if you use it with java.sql classes. *.

-one
Feb 26 '16 at 4:30
source share

Check if you have a VPN. I had the same problem, but I realized that db I was connecting to the remote!

-2
Mar 24 '15 at 19:10
source share

Hey property name = "hibernate.temp.use_jdbc_metadata_defaults" changing to false just does not display an error. This does not resolve the error. He just hides the mistake.

To solve the problem, I tried to update the hibernation version with hibernation and mysql, but this is useless. Then I checked the com.mysql.jdbc.Driver class, in which it indicates backward compatibility to support applications calling Class.forName("com.mysql.jdbc.Driver"); , Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver 'Then I changed "hibernate.connection.driver_class" to the error "com.mysql.cj.jdbc.Driver".

summary => use 'com.mysql.cj.jdbc.Driver' instead of 'com.mysql.jdbc.Driver' in the 'hibernate.connection.driver_class' property .

-2
May 17 '18 at 3:13
source share



All Articles