我使用以下代码创建hibernate搜索索引:
OgmConfiguration cfgogm=new OgmConfiguration();
cfgogm.configure("hibernate.cfg.xml");
serviceregistry=new ServiceRegistryBuilder().applySettings(cfgogm.getProperties()).buildServiceRegistry();
sessionfactory=cfgogm.buildSessionFactory(serviceregistry);
Session session=sessionfactory.getCurrentSession();
FullTextSession fullTextSession = Search.getFullTextSession(session);
fullTextSession.createIndexer(User.class).startAndWait();
但是我得到了性别歧视:
ERROR: HSEARCH000058: HSEARCH000116: Unexpected error during MassIndexer operation
java.lang.NullPointerException
at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.<init>(AbstractStatementProxyHandler.java:57)
at org.hibernate.engine.jdbc.internal.proxy.PreparedStatementProxyHandler.<init>(PreparedStatementProxyHandler.java:50)
at org.hibernate.engine.jdbc.internal.proxy.ProxyBuilder.buildPreparedStatement(ProxyBuilder.java:187)
at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.postProcess(ConnectionProxyHandler.java:167)
at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:139)
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
at com.sun.proxy.$Proxy17.prepareStatement(Unknown Source)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:147)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:145)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1720)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1697)
at org.hibernate.loader.Loader.doQuery(Loader.java:832)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:293)
at org.hibernate.loader.Loader.doList(Loader.java:2382)
at org.hibernate.loader.Loader.doList(Loader.java:2368)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2198)
at org.hibernate.loader.Loader.list(Loader.java:2193)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:122)
at org.hibernate.internal.StatelessSessionImpl.list(StatelessSessionImpl.java:657)
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:374)
at org.hibernate.internal.CriteriaImpl.uniqueResult(CriteriaImpl.java:396)
at org.hibernate.search.batchindexing.impl.IdentifierProducer.loadAllIdentifiers(IdentifierProducer.java:130)
at org.hibernate.search.batchindexing.impl.IdentifierProducer.inTransactionWrapper(IdentifierProducer.java:115)
at org.hibernate.search.batchindexing.impl.IdentifierProducer.run(IdentifierProducer.java:96)
at org.hibernate.search.batchindexing.impl.OptionallyWrapInJTATransaction.run(OptionallyWrapInJTATransaction.java:135)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Aug 28, 2013 12:31:10 PM org.hibernate.search.impl.SimpleIndexingProgressMonitor indexingCompleted
INFO: HSEARCH000028: Reindexed 0 entities
我不知道为什么我会得到这个例子?你能不能帮我解决这个问题