[Hibernate-JIRA] Created: (HSEARCH-420) Hibernate Search does not work with Lucene 3.0.0
by Mark Derricutt (JIRA)
Hibernate Search does not work with Lucene 3.0.0
------------------------------------------------
Key: HSEARCH-420
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-420
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.1.GA
Reporter: Mark Derricutt
After updating my lucence dependency to the recently released 3.0.0 I see the following stack trace:
org.fest.reflect.exception.ReflectionError: Unable to invoke method 'bindEntityProvider' with arguments [smx3.schema.provider.SchemaEntityProvider@3747c1db]
at org.fest.reflect.method.Invoker.invoke(Invoker.java:101)
at smx3.testing.SessionFactoryBuilder.buildSessionFactory(SessionFactoryBuilder.java:61)
at smx3.partyresource.service.AgreementServiceImplTest.setup(AgreementServiceImplTest.java:38)
Caused by: java.lang.reflect.InvocationTargetException
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.fest.reflect.method.Invoker.invoke(Invoker.java:99)
... 28 more
Caused by: java.lang.NoSuchMethodError: org.apache.lucene.store.FSDirectory.getDirectory(Ljava/io/File;)Lorg/apache/lucene/store/FSDirectory;
at org.hibernate.search.store.DirectoryProviderHelper.createFSIndex(DirectoryProviderHelper.java:77)
at org.hibernate.search.store.FSDirectoryProvider.initialize(FSDirectoryProvider.java:44)
at org.hibernate.search.store.DirectoryProviderFactory.createDirectoryProvider(DirectoryProviderFactory.java:129)
at org.hibernate.search.store.DirectoryProviderFactory.createDirectoryProviders(DirectoryProviderFactory.java:63)
at org.hibernate.search.impl.SearchFactoryImpl.initDocumentBuilders(SearchFactoryImpl.java:404)
at org.hibernate.search.impl.SearchFactoryImpl.<init>(SearchFactoryImpl.java:119)
at org.hibernate.search.event.ContextHolder.getOrBuildSearchFactory(ContextHolder.java:30)
at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:79)
at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1352)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:812)
at smx3.entity.EntityActivatorImpl.bindSessionFactory(EntityActivatorImpl.java:197)
at smx3.entity.EntityActivatorImpl.rebuildSessionFactory(EntityActivatorImpl.java:106)
at smx3.entity.EntityActivatorImpl.rebuildFromEntityProviders(EntityActivatorImpl.java:85)
at smx3.entity.EntityActivatorImpl.bindEntityProvider(EntityActivatorImpl.java:68)
It would seem that Lucene 3.0.0 has broken APIs with 2.9.0 which worked fine with Hibernate Search.
--
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
16 years, 4 months
[Hibernate-JIRA] Created: (HHH-4586) Jpa2.0 Criteria API lower function missing parameter
by zhouyanming (JIRA)
Jpa2.0 Criteria API lower function missing parameter
----------------------------------------------------
Key: HHH-4586
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4586
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager, metamodel, query-criteria
Affects Versions: 3.5.0-Beta-2
Reporter: zhouyanming
CriteriaBuilder cb = ...
CriteriaQuery<User> cq = ...
Metamodel metamodel = ...
Root<User> root = cq.from(User.class);
EntityType<User> entityType = metamodel.entity(User.class);
Expression expression = root.get(entityType.getSingularAttribute("username"));
Predicate condition = cb.equal(cb.lower(expression), "test");
cq.where(condition);
Hibernate: select user0_.id as id0_, user0_.username as username0_ from users user0_ where lower()=? limit ?
09/11/18 15:09:59 WARN util.JDBCExceptionReporter: SQL Error: 1582, SQLState: 42000
09/11/18 15:09:59 ERROR util.JDBCExceptionReporter: Incorrect parameter count in the call to native function 'lower'
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2235)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:411)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1084)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:238)
at org.hibernate.ejb.criteria.CriteriaQueryCompiler$2.getSingleResult(CriteriaQueryCompiler.java:125)
at org.ironrhino.core.service.BaseManagerImpl$3.doInJpa(BaseManagerImpl.java:156)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
... 39 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Incorrect parameter count in the call to native function 'lower'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2077)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2228)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1810)
at org.hibernate.loader.Loader.doQuery(Loader.java:695)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:257)
at org.hibernate.loader.Loader.doList(Loader.java:2232)
--
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
16 years, 4 months
[Hibernate-JIRA] Created: (HHH-3224) Invalid generated SQL for nested queries
by Adam Dyga (JIRA)
Invalid generated SQL for nested queries
----------------------------------------
Key: HHH-3224
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3224
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.6
Environment: MySQL
Reporter: Adam Dyga
I'm facing a problem with invalid generated SQL for nested queries.
I've the following class hierarchy (left only the most important fields for clarity):
//base class
class Asset {
String description; // <- field in base class
}
class ImageSet {
List<Wallpaper> wallpapers;
}
class Wallpaper extends Asset { // <- inherits from Asset
}
The HBM mappings:
<class name="com.company.Asset" table="Asset" abstract="true">
<property name="description" column="description" type="string" />
<id>...</id>
</class>
<class name="ImageSet" table="ImageSets">
<bag name="wallpapers" cascade="delete-orphan" inverse="true"
table="Wallpapers">
<key column="imageSetId" />
<one-to-many class="com.company.Wallpaper" />
</bag>
</class>
<joined-subclass name="com.company.Wallpaper"
extends="com.company.Asset" table="Wallpapers">
<key column="id" />
<many-to-one name="imageSet" column="imageSetId"
class="com.company.ImageSet" />
</joined-subclass>
When I try to execute the following HQL query:
select distinct imageSet from ImageSet imageSet where (select count(*) from imageSet.wallpapers w where w.description is not null) = size(imageSet.wallpapers)
I get the following SQL query:
select distinct imageset0_.id as id14_ from ImageSets imageset0_ where (select count(*) from Wallpapers wallpapers1_ where imageset0_.id=wallpapers1_.imageSetId and (wallpapers1_1_.description is not null)])=(select count(wallpapers2_.imageSetId) from Wallpapers wallpapers2_ inner join Asset wallpapers2_1_ on wallpapers2_.id=wallpapers2_1_.id where imageset0_.id=wallpapers2_.imageSetId)
The error message is
Unknown column 'wallpapers1_1_.description' in 'where clause'
which is right - note the missing wallpapers1_1_ alias which should be defined during inner join of the Wallpapers table with the base Asset table in the first nested query - just as it is done in the second nested query.
Full stack trace of any exception that occurs:
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2216)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'wallpapers1_1_.description' in 'where clause'
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
--
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
16 years, 4 months
[Hibernate-JIRA] Commented: (HHH-1777) org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
by Naresh Kumar Mallineni (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1777?page=c... ]
Naresh Kumar Mallineni commented on HHH-1777:
---------------------------------------------
Put antlr.jar in PRE_CLASSPATH="" in setDomainEnv.sh/bat file and restart the servers.
> org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
> -------------------------------------------------------------------------------------
>
> Key: HHH-1777
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1777
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1.3
> Environment: Hibernate 3.1.3,mysql-5.0.21-win32,mysql-connector-java-3.0.17-ga,jdk1.4.1_05,Struts 1.1,weblogic 8.1,MyEclipse 4.1.1GA
> Reporter: Ranjit Patil
> Attachments: AbstractBook.java, Book.hbm.xml, Book.java, BookListAction.java, BookListForm.class, hibernate.cfg.xml, HibernateSessionFactory.java, LibraryManager.java
>
>
> I have two tables book and customer. My index page has two links show book list and Show customer List.Currently I am working on only Book List. It calls BookListAction.java which in turn calls LibraryManager.java in which getAllBooks() has code something like this:
> public Book[] getAllBooks() {
> /* will hold the books we are going to return later */
> List books = new ArrayList();
> /* a Hibernate session */
> Session session = null;
> /* we always need a transaction */
> Transaction tx = null;
> /* get session of the current thread */
> session = HibernateSessionFactory.currentSession();
> tx = session.beginTransaction();
> ----------Exception is thrown when the below line of code is executed---------------------
> List tmpBooks = session.createQuery(
> "select b from Book as b order by b.author, b.title").list();
> -----------------------------------------------------------------------------------------------------------------
> for (Iterator iter = tmpBooks.iterator(); iter.hasNext();) {
> books.add((Book) iter.next());
> }
> tx.commit();
> return (Book[]) books.toArray(new Book[0]);
> }
> In eclipse it runs fine but when i deployed on weblogic i got following error when i clicked the show book list link:
> org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select b from de.laliluna.library.Book as b order by b.author, b.title]
> at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57)
> at antlr.CharScanner.setTokenObjectClass(CharScanner.java:287)
> at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31)
> at antlr.CharScanner.(CharScanner.java:42)
> at antlr.CharScanner.(CharScanner.java:51)
> at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:56)
> at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:53)
> at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:50)
> at org.hibernate.hql.ast.HqlLexer.(HqlLexer.java:26)
> at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:44)
> at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:232)
> at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155)
> at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
> at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:75)
> at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:54)
> at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
> at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
> at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
> at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583)
> at de.laliluna.library.bl.LibraryManager.getAllBooks(LibraryManager.java:35)
--
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
16 years, 4 months