Hibernate console login with WARN HHH000174

I have a system with Hibernate 4.1.7 and Spring 1.3.4 jpa. When I ran myEntity.findOne(id) , Hibernate WARN logging in the console:

[Main]; WARN; org.hibernate.dialect.function.TemplateRenderer; - HHH000174: four arguments are expected in the function template, but the arguments first met.

Find out about some possible solutions, but could not solve my problem at http://jira.xwiki.org/browse/XWIKI-9215 , https://hibernate.atlassian.net/browse/HHH-6280 .

I am checking code org.hibernate.dialect.function.TemplateRenderer in org.hibernate.dialect.function.TemplateRenderer

 @SuppressWarnings({ "UnusedDeclaration" }) public String render(List args, SessionFactoryImplementor factory) { int numberOfArguments = args.size(); if ( getAnticipatedNumberOfArguments() > 0 && numberOfArguments != getAnticipatedNumberOfArguments() ) { LOG.missingArguments( getAnticipatedNumberOfArguments(), numberOfArguments ); } StringBuilder buf = new StringBuilder(); for ( int i = 0; i < chunks.length; ++i ) { if ( i < paramIndexes.length ) { final int index = paramIndexes[i] - 1; final Object arg = index < numberOfArguments ? args.get( index ) : null; if ( arg != null ) { buf.append( chunks[i] ).append( arg ); } } else { buf.append( chunks[i] ); } } return buf.toString(); } 
+5
source share
2 answers

First of all, good research

Yes, this was raised as a bug previously with Hibernate , and has also been fixed. But due to the lack of test cases, it was rejected and was never released as part of subsequent releases.

The error was introduced as part of Hibernate 3.6 .

Therefore, you still need to wait until someone raises a ticket, and provide suitable test cases and fix it.

refer here for more details.

+6
source

The hibernate bug with the link (root cause) of HHH-5676 has been fixed , so I do not expect any improvement in the near future with this WARNING.

There is a way to disable it, at least if it annoys you. You can limit the logging level of the hibernate TemplateRenderer class to ERROR. The TemplateRenderer class runs this log and (at this time) is the only entry to this class. It depends on your registrar how to do this. In my case:

 logger.org.hibernate.dialect.function.TemplateRenderer.level=ERROR 

Hiding this is risky for obvious reasons. Do it carefully!

+1
source

Source: https://habr.com/ru/post/1201914/


All Articles