Issue Type: Bug Bug
Affects Versions: 4.1.9
Assignee: Unassigned
Components: core
Created: 17/Jan/13 2:49 AM
Description:

hibernate crashes when there is a logback.xml which is defined to set all logger levels to debug and when there are own enum types defined.
enumValueMapper will be null but the LOG.debug will be used which calls enumValueMapper.toXmlString() which fails with a NPE. It should instead call one of the safeNotNull methods which check that the mapper is not null.

stack:
org.hibernate.type.EnumType.toXMLString(EnumType.java:308)
org.hibernate.type.CustomType.toString(CustomType.java:256)
org.hibernate.type.CustomType.toXMLString(CustomType.java:169)
org.hibernate.type.CustomType.toLoggableString(CustomType.java:228)
org.hibernate.internal.util.EntityPrinter.toString(EntityPrinter.java:79)
org.hibernate.internal.util.EntityPrinter.toString(EntityPrinter.java:121)
org.hibernate.event.internal.AbstractFlushingEventListener.logFlushResults(A
bstractFlushingEventListener.java:131)
org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingTo
Executions(AbstractFlushingEventListener.java:107)
org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushE
ventListener.java:51)
org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1213)
org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:402)
org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransac
tionCommit(JdbcTransaction.java:101)
org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(Abstract
TransactionImpl.java:175)
org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:75)

i removed the logback.xml and it worked. also i used info instead of debug which worked too. imo this is a blocker as its impossible to use hibernate with debugging enabled and own enum types.

Environment: win7, x64, jdk7
Project: Hibernate ORM
Priority: Blocker Blocker
Reporter: oliver z.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira