[Hibernate-JIRA] Created: (HHH-6276) org.hibernate.test.cache.ehcache.EhCacheRegionFactoryImpl fails due to no slf4j in test configuration
by Strong Liu (JIRA)
org.hibernate.test.cache.ehcache.EhCacheRegionFactoryImpl fails due to no slf4j in test configuration
-----------------------------------------------------------------------------------------------------
Key: HHH-6276
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6276
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Affects Versions: 4.0.0.Alpha3
Reporter: Strong Liu
Assignee: Strong Liu
Fix For: 4.0.0.Beta1
org.hibernate.testing.junit4.CallbackException: org.hibernate.testing.junit4.BaseCoreFunctionalTestCase#buildSessionFactory
at org.hibernate.testing.junit4.TestClassMetadata.invokeCallback(TestClassMetadata.java:199)
at org.hibernate.testing.junit4.TestClassMetadata.performCallbacks(TestClassMetadata.java:190)
at org.hibernate.testing.junit4.TestClassMetadata.performBeforeClassCallbacks(TestClassMetadata.java:181)
at org.hibernate.testing.junit4.BeforeClassCallbackHandler.evaluate(BeforeClassCallbackHandler.java:42)
at org.hibernate.testing.junit4.AfterClassCallbackHandler.evaluate(AfterClassCallbackHandler.java:42)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:51)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:63)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:75)
at $Proxy3.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:86)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.MethodInvocationUnmarshallingDispatch.dispatch(MethodInvocationUnmarshallingDispatch.java:48)
at org.gradle.messaging.dispatch.DiscardOnFailureDispatch.dispatch(DiscardOnFailureDispatch.java:31)
at org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:129)
at org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33)
at org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:69)
at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:63)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
at org.slf4j.impl.Log4jLoggerAdapter.info(Log4jLoggerAdapter.java:318)
at org.hibernate.annotations.common.Version.<clinit>(Version.java:37)
at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.<clinit>(JavaReflectionManager.java:73)
at org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2356)
at org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2352)
at org.hibernate.cfg.Configuration.reset(Configuration.java:267)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:258)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:262)
at org.hibernate.testing.junit4.BaseCoreFunctionalTestCase.constructConfiguration(BaseCoreFunctionalTestCase.java:132)
at org.hibernate.testing.junit4.BaseCoreFunctionalTestCase.buildConfiguration(BaseCoreFunctionalTestCase.java:122)
at org.hibernate.testing.junit4.BaseCoreFunctionalTestCase.buildSessionFactory(BaseCoreFunctionalTestCase.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.testing.junit4.TestClassMetadata.invokeCallback(TestClassMetadata.java:196)
... 33 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[Hibernate-JIRA] Created: (HSEARCH-744) NullPointerException when using a range query on a numeric field and searching for values below a given boundary
by Nikita D (JIRA)
NullPointerException when using a range query on a numeric field and searching for values below a given boundary
-----------------------------------------------------------------------------------------------------------------
Key: HSEARCH-744
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-744
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.4.0.Final
Environment: Hibernate Core 3.6.3, MySQL 5.1.55
Reporter: Nikita D
When using the query API to search for values below a boundary, a NullPointerException is thrown if the field is a numeric field (annotated with @NumericField). Example query:
{code}
Query luceneQuery = qb
.range()
.onField("myNumericField")
.below(myMaxValue)
.createQuery();
{code}
The problem is in NumericFieldUtils.createNumericRangeQuery(), which always uses the "from" value to determine the class. For a "below" query, the "from" value is null.
Stacktrace:
{code}
java.lang.NullPointerException
at org.hibernate.search.bridge.util.NumericFieldUtils.createNumericRangeQuery(NumericFieldUtils.java:17)
at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsRangeQueryBuilder.createQuery(ConnectedMultiFieldsRangeQueryBuilder.java:104)
at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsRangeQueryBuilder.createQuery(ConnectedMultiFieldsRangeQueryBuilder.java:79)
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-5306) Dialect resolution: Cannot set a custom dialect resolver programatically or using hibernate.cfg.xml
by Nikita D (JIRA)
Dialect resolution: Cannot set a custom dialect resolver programatically or using hibernate.cfg.xml
---------------------------------------------------------------------------------------------------
Key: HHH-5306
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5306
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.2, 3.5.1, 3.5.0-Final, 3.5.0-CR-2, 3.5.0-CR-1, 3.5.0-Beta-4, 3.5.0-Beta-3, 3.5.0-Beta-2, 3.5.0.Beta-1, 3.3.2
Reporter: Nikita D
Priority: Minor
Starting with version 3.3, Hibernate introduced an extremely useful dialect resolution feature (http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#por...). The problem is with the configuration of a custom dialect resolver:
* Setting the property Environment.DIALECT_RESOLVERS in the Configuration of a SessionFactory doesn't work, because DialectFactory only reads from Environment.getProperties(), which is only the global properties (system properties plus the hibernate.properties file).
* Setting a system property programatically is not safe, because the Environment class caches the system properties in a static constant, so if it's loaded before the code that sets the system property, the property will not be picked up.
* The registerDialectResolver() method on DialectFactory is not public.
Ideally, it should be possible to configure a custom dialect resolver by setting the property Environment.DIALECT_RESOLVERS on a Configuration object, just as one would configure an explicit dialect. Alternatively, I think an acceptable "quick fix" would be to expose the registerDialectResolver() method on DialectFactory.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 6 months
[Hibernate-JIRA] Created: (HHH-4630) Criteria join on composite identifier generates wrong alias, SQL error
by Chris Wilson (JIRA)
Criteria join on composite identifier generates wrong alias, SQL error
----------------------------------------------------------------------
Key: HHH-4630
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4630
Project: Hibernate Core
Issue Type: Patch
Components: core
Affects Versions: 3.5
Environment: Hibernate trunk from 2009-11-30, Ubuntu 8.04, Sun Java 1.6.0-17, MySQL 5.0.51a-3ubuntu5.4
Reporter: Chris Wilson
Attachments: hibernate-invalid-alias-generation.patch
Hibernate generates the wrong alias on a Criteria query involving a join
on a composite identifier. For example, in the test below without the fix
to JoinWalker, it generates this SQL:
select
this_.role_code as role1_0_1_,
this_.is_deleted as is2_0_1_,
this_.record_version as record3_0_1_,
complexjoi3_.code as code1_0_,
complexjoi3_.is_deleted as is2_1_0_,
complexjoi3_.record_version as record3_1_0_
from
list_action_roles this_
left outer join
roles complexjoi3_
on this_.role_code=complexjoi3_.code
where
this_.is_deleted=?
and complexjoi1_.is_deleted=?
Which results in this error from the SQL server:
Unknown column 'complexjoi1_.is_deleted' in 'where clause'
Analysis of the problem:
The entity persister class with the composite identifier has a fake
property for it, called "_identifierMapper" (see HbmBinder.bindCompositeId()
and similarly in Annotations). This property name ends up in the path
used by JoinWalker.walkEntityTree() when it calls walkComponentTree().
However that path is used by CriteriaJoinWalker.generateTableAlias()
to look up the correct criteria (and hence the alias) from the
translator, a CriteriaQueryTranslator.
The alias was created in CriteriaQueryTranslator.createCriteriaSQLAliasMap
for a Criteria without this extra _identifierMapper path component.
So when CriteriaJoinWalker tries to use the path with _identifierMapper
to look up the criteria to find the correct alias to use, in
generateTableAlias(), it doesn't find one, so it generates a new alias.
That new alias no longer matches the one that will be rendered out in
the WHERE clause, so the WHERE clause will refer to table names using
aliases that are not used anywhere else in the query, and the SQL server
will fail to parse the statement.
The solution appears to be to exclude "_identifierMapper" components in
the alias path when building it. I don't know what other implications
that might have, but it seems like an implementation nastiness that
shouldn't be exposed.
Patch attached.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 6 months
[Hibernate-JIRA] Created: (HHH-6073) Dialects cannot use the Thread Context ClassLoader with AS7, please change to use the
by Scott Marlow (JIRA)
Dialects cannot use the Thread Context ClassLoader with AS7, please change to use the
--------------------------------------------------------------------------------------
Key: HHH-6073
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6073
Project: Hibernate Core
Issue Type: Task
Reporter: Scott Marlow
Priority: Blocker
Fix For: 4.0.0.Alpha2
We can no longer rely on TCCL because AS7 is following a modular class loading approach. The AS7 "org.hibernate" module isn't setup to access the JDBC classes. For creating dialects, could we instead use the classloader from the java.sql.Connection that is passed into the DialectFactory.
The following warning shows what we currently see with Hibernate 3.6.1 and the DerbyDialect (TCCL is null).
08:45:27,597 INFO [org.hibernate.dialect.Dialect] (MSC service thread 1-6) Using dialect: org.hibernate.dialect.DerbyDialect
08:45:27,603 INFO [org.hibernate.dialect.Dialect] (MSC service thread 1-2) Using dialect: org.hibernate.dialect.DerbyDialect
08:45:27,614 WARN [org.hibernate.dialect.DerbyDialect] (MSC service thread 1-6) Unable to load/access derby driver class sysinfo to check versions : java.lang.ClassNotFoundException: org.apache.derby.tools.sysinfo from [Module "org.hibernate:main" from local module loader @fee4648 (roots: /work/as7-dev/jboss-as/build/target/jboss-7.0.0.Beta2/modules)]
08:45:27,616 WARN [org.hibernate.dialect.DerbyDialect] (MSC service thread 1-2) Unable to load/access derby driver class sysinfo to check versions : java.lang.ClassNotFoundException: org.apache.derby.tools.sysinfo from [Module "org.hibernate:main" from local module loader @fee4648 (roots: /work/as7-dev/jboss-as/build/target/jboss-7.0.0.Beta2/modules)]
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 6 months