NoSuchMethodError running hibernate-infinispan tests with Infinispan 7.2.1
by Gail Badner
Following Steve's suggestion using resolutionStrategy, I was able to build the hibernate-infinispan jar with Infinispan 6.0.0.Final and run the unit tests with 7.2.1.Final.
I'm sure there's a more elegant way to do this, so I've created a new jira (HHH-9802) and a pull request with the change I made: https://github.com/hibernate/hibernate-orm/pull/955 .
There were actually some unit test failures in InfinispanRegionFactoryTestCase using 7.2.1.Final due to java.lang.NoSuchMethodError.
It happens in assertions like:
assertEquals(5000, cacheCfg.eviction().maxEntries());
The problem is that org.infinispan.configuration.cache.EvictionConfiguration.maxEntries() returns int in 6.0.0.Final, but returns long in 7.2.1.Final. The only usage I see is in the unit tests. I can probably workaround this in the unit test, but I was wondering if this could cause a problem if an application used this method directly.
Galder, do you know if this is a concern?
I have instructions in the pull request for reproducing these failures.
I commented out the failing assertions locally to verify that nothing else causes the test to fail.
I also see org.hibernate.cache.infinispan.TypeOverrides.evictionMaxEntries is defined as an int. That gets initialized based on a value set for on hibernate.cache.infinispan.<classnam>.eviction.max_entries. The only place I see TypeOverrides.getEvictionMaxEntries() used is in InfinispanRegionFactoryTestCase. Does this actually get used anywhere? Does the value find its way into a EvictionConfiguration.maxEntries field? If so, should be a long (instead of an int) in master?
I had a quick chat with Scott Marlow when I realized this was a potential problem and we agreed that it shouldn't block releasing Hibernate ORM 4.3.10.Final. I have gone ahead and released 4.3.10.Final.
I will check in on things Friday morning, but I have to leave by 10:30am and will be off the rest of the day. I can pick this up on Monday if need be.
Regards,
Gail
9 years, 8 months
[OGM] AbstractKey
by Ewa Stawicka
There are three classes AssociationKey, EnityKey, IdSourceKey, which all
contains methods:
public String[] getColumnNames()
public Object[] getColumnValues()
public String getTable()
and we have three methods in couchdb module:
Identifier.createAssociationId, Identifier.createEntityId,
CouchDBDatastore.createId, each one does basicly the same, but takes
different parameter.
Can we extract abstract class AbstractKey, with columnValues field, some
getters, createId method? I will need createId method in couchbase module.
Ewa
9 years, 8 months
AvailableSettings#USE_NEW_ID_GENERATOR_MAPPINGS
by Sanne Grinovero
I just noticed that the ORM testsuite seems to consistently set this
option to "true".
The default being false, the "new" kind is available since ORM 3.2
according to javadoc.
Would this be a good time to switch the default?
9 years, 8 months
[OGM] DocumentStoreConfiguration
by Emmanuel Bernard
So far DocumentStoreConfiguration is very generic and only deals with
remote datastore with reasonable expectations (hosts, ports, usernames.
Cassandra makes use of that class.
Should we rename it and create a subclass for document stores that would
be empty today?
Emmanuel
9 years, 8 months
Search - Plain text and SimpleQueryParser
by Guillaume Smet
Hi,
Having some spare time, I revisited my patch that used the Lucene
SimpleQueryParser to provide more advanced search features to the end user.
At my company, our search requirements are usually the following:
- a full text search on the name and description;
- a set of dropdown choices.
Our full text search uses the AND operator as our customers usually
requires this. It's not something we can do with the current keyword()
search (I described the issue at length in
https://hibernate.atlassian.net/browse/HSEARCH-917).
We often give the ability to use boolean operators and phrase queries to
the end user.
How did we expose this feature? We build a Lucene query using the
MultiFieldsQueryParser and we set the default operator to AND. We can't use
the DSL.
Starting with Lucene 4, we have a nice parser which is called
SimpleQueryParser and which is... simple and resilient. And I think it
would be a good idea to expose it via the DSL.
It currently looks like this:
https://github.com/openwide-java/hibernate-search/commit/ee776744760d8115...
(there's not much code, Lucene is doing the magic).
There are a couple of XXX I would like to discuss and I'm not that thrilled
with the names I gave to the options.
I have some spare time this week and next week so I'll be able to polish
the patch based on your feedback!
Have a nice day.
--
Guillaume
9 years, 8 months
Unable to build local snapshots of ORM 5
by Sanne Grinovero
I need to build local snapshots of ORM to test things with Hibernate
Search, but invoking "publishToMavenLocal" produces an error on the
OSGi module:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task
':hibernate-osgi:publishMavenJavaPublicationToMavenLocal'.
Failed to publish publication 'mavenJava' to repository 'MavenLocal'
> Invalid publication 'mavenJava': artifact file does not exist:
'/home/sanne/workspaces/hibernate/hibernate-core-parent/hibernate-osgi/target/karafFeatures/hibernate-osgi-5.0.0-SNAPSHOT-karaf.xml'
All I know is that indeed that file isn't there.
I tried to workaround the problem by deploying a snapshot to Nexus,
but that failed with a similar error.
9 years, 8 months
SchemaExport usage ?
by Sanne Grinovero
We have some Hibernate Search tests which use multi-tenancy, and
require the schema to be exported explicitly. I'm trying to get these
to run now with Hibernate ORM 5.
I can't use the command line tool, as the test configuration options
should be passed by instance (there are several unit tests to be run,
each with its own configuration).
I already have a SessionFactory started, so I'd prefer to use its
metadata if possible, but while SchemaExport has plenty of
constructors, it doesn't seem to have one I could use.
This one looks like a good candidate:
SchemaExport(ConnectionHelper connectionHelper, MetadataImplementor metadata)
as I do have a ConnectionHelper instance. But while I have a reference
to my SessionFactory, and a reference to the Configuration which
started it, I couldn't find a way to get a MetadataImplementor from
these?
Wouldn't it be very useful to have something like
SchemaExport(ConnectionHelper connectionHelper, SessionFactorty sf) ?
I think all multi-tenancy users would need something similar.
Partially unrelated, the methods:
- org.hibernate.cfg.Configuration.generateDropSchemaScript(Dialect)
- org.hibernate.cfg.Configuration.generateSchemaCreationScript(Dialect)
are returning an hard coded String[0]. Should these be implemented
before 5.0.0.Final, or are these meant to be deprecated?
Thanks,
Sanne
9 years, 8 months
[OGM] Need to list entities when using Hibernate OGM on WildFly
by Gunnar Morling
Hi,
When using Hibernate OGM on WildFly, one needs to list the entity classes
in persistence.xml, otherwise and "Unknown entity" exception will be raised.
Does anyone have a rough idea what may be causing this or where to get
started to analyse this issue?
Thanks,
--Gunnar
9 years, 8 months
Trying Hibernate 5.0.0.Beta2
by Petar Tahchiev
Hi guys,
I just tried hibernate 5.0 beta2 and here's my observations. First of all
the foreign key problems I had before seems to be resolved, however I see
the following error when executing tests with HSQL:
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'defaultEntityManagerFactory' defined in class path
resource [com/nemesis/platform/core/config/PlatformCoreTestConfig.class]:
Invocation of init method failed; nested exception is
javax.persistence.PersistenceException: [PersistenceUnit: default] Unable
to build Hibernate SessionFactory
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1011)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:802)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:521)
at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at
org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:100)
at
org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at
org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
... 36 more
Caused by: javax.persistence.PersistenceException: [PersistenceUnit:
default] Unable to build Hibernate SessionFactory
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:874)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:802)
at
org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60)
at
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
at
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
... 50 more
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable
to execute schema management to JDBC target [alter table payment_info add
constraint FKs9wud9nve6s9cbot5p4548jyh foreign key (user_pk) references
principal]
at
org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:75)
at
org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:349)
at
org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:338)
at
org.hibernate.tool.schema.internal.SchemaMigratorImpl.applyForeignKeys(SchemaMigratorImpl.java:303)
at
org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:135)
at
org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:76)
at
org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:146)
at
org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:114)
at
org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:461)
at
org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:799)
... 55 more
Caused by: java.sql.SQLSyntaxErrorException: object name already exists:
FKS9WUD9NVE6S9CBOT5P4548JYH in statement [alter table payment_info add
constraint FKs9wud9nve6s9cbot5p4548jyh foreign key (user_pk) references
principal]
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.executeUpdate(Unknown Source)
at
com.zaxxer.hikari.proxy.StatementProxy.executeUpdate(StatementProxy.java:108)
at
com.zaxxer.hikari.proxy.StatementJavassistProxy.executeUpdate(StatementJavassistProxy.java)
at
org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:72)
... 65 more
Caused by: org.hsqldb.HsqlException: object name already exists:
FKS9WUD9NVE6S9CBOT5P4548JYH
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.SchemaObjectSet.checkAdd(Unknown Source)
at org.hsqldb.SchemaManager.checkSchemaObjectNotExists(Unknown Source)
at org.hsqldb.TableWorks.checkCreateForeignKey(Unknown Source)
at org.hsqldb.TableWorks.addForeignKey(Unknown Source)
at org.hsqldb.StatementSchema.getResult(Unknown Source)
at org.hsqldb.StatementSchema.execute(Unknown Source)
at org.hsqldb.Session.executeCompiledStatement(Unknown Source)
at org.hsqldb.Session.executeDirectStatement(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
... 70 more
When running it with mysql it doesn't show this error (very strange) so I
tried to export the schema to sql file and I can see only one foregin key
declaration:
alter table payment_info
add constraint FKs9wud9nve6s9cbot5p4548jyh
foreign key (user_pk)
references principal (pk);
Notice that this time it is lowercase. I'm trying to debug the hsql but it
is very hard as it doesn't stop on any of the breakpoints I add. If any of
you have an idea what might be causing it, please share your thoughts, if
not I'll let you know how I progress.
I wonder if it could be related to the duplicate joins warnings I see:
WARN : HHH000072: Duplicate joins for class:
com.nemesis.platform.core.model.media.MediaModel
WARN : HHH000072: Duplicate joins for class:
com.nemesis.platform.module.commerce.core.model.order.TerritoryDeliveryModeValueModel
WARN : HHH000072: Duplicate joins for class:
com.nemesis.platform.core.model.cms.AbstractPageModel
WARN : HHH000072: Duplicate joins for class:
com.nemesis.platform.core.model.cms.EmailPageModel
WARN : HHH000072: Duplicate joins for class:
com.nemesis.platform.core.model.cms.CategoryPageModel
.....
--
Regards, Petar!
Karlovo, Bulgaria.
---
Public PGP Key at:
https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611
9 years, 8 months