Bug 882144 - Bug in DocumentBuilderIndexedEntity.checkDocumentId, dependent on order of returned items by java reflection.
Summary: Bug in DocumentBuilderIndexedEntity.checkDocumentId, dependent on order of re...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise WFK Platform 2
Classification: Retired
Component: HibernateSearch
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 2.2.0
Assignee: Brett Meyer
QA Contact: thradec
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-30 09:08 UTC by thradec
Modified: 2016-08-01 01:05 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-31 17:04:55 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Hibernate HSEARCH-1048 0 None None None Never

Description thradec 2012-11-30 09:08:59 UTC
Bug appeared in hibernate search community tests (org.hibernate:hibernate-search-orm-4.1.1.Final) used in wfk tests, only on some jenkins nodes (RHEL6x86 with java17 or openjdk17).

Failed test is `org.hibernate.search.test.engine.UsingIdentifierRollbackTest.testEntityDeletionWithoutIdentifier`, stacktrace is below. 

Necessary condition is that order of returned items from JavaReflectionManager for entity PersonWithBrokenSocialSecurityNumber is: SSN, name, id.

For simulation this bug on any java environment is possible override ReflectionManager more precisely XClass with custom implementation, which change order of returned items in getDeclaredProperties method.



STACKTRACE

org.hibernate.search.SearchException: More than one @DocumentId specified on entity org.hibernate.search.test.embedded.depth.PersonWithBrokenSocialSecurityNumber
	at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.checkDocumentId(DocumentBuilderIndexedEntity.java:251)
	at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.documentBuilderSpecificChecks(DocumentBuilderIndexedEntity.java:238)
	at org.hibernate.search.engine.spi.AbstractDocumentBuilder.initializeMemberLevelAnnotations(AbstractDocumentBuilder.java:462)
	at org.hibernate.search.engine.spi.AbstractDocumentBuilder.initializeClass(AbstractDocumentBuilder.java:367)
	at org.hibernate.search.engine.spi.AbstractDocumentBuilder.<init>(AbstractDocumentBuilder.java:151)
	at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.<init>(DocumentBuilderIndexedEntity.java:179)
	at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:419)
	at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:221)
	at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:145)
	at org.hibernate.search.event.impl.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:129)
	at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:82)
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:306)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1744)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1782)
	at org.hibernate.search.test.SearchTestCase.openSessionFactory(SearchTestCase.java:97)
	at org.hibernate.search.test.SearchTestCase.setUp(SearchTestCase.java:89)
	at org.hibernate.search.test.engine.UsingIdentifierRollbackTest.setUp(UsingIdentifierRollbackTest.java:123)
	at org.hibernate.search.test.SearchTestCase.runBare(SearchTestCase.java:418)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:234)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:133)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:114)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:188)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:101)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

Comment 2 thradec 2012-11-30 14:06:52 UTC
Fixed in 4.2.0.CR1 https://hibernate.onjira.com/browse/HSEARCH-1048

Comment 3 Marek Novotny 2013-01-10 12:00:42 UTC
we need back porting that to our 4.1.1 product branch.

Brett, are you on that?

Comment 4 Brett Meyer 2013-01-16 20:41:51 UTC
Sanne will be backporting a set of Search changes -- including this one.  I'll keep checking on it.


Note You need to log in before you can comment on or make changes to this bug.