Hide Forgot
Description of problem: When trying to query cache create using the EAP modules, JDG throws: Can't build query for type com.redhat.mx.coppel.afore.model.Resumen which is neither indexed nor has any indexed sub-types Version-Release number of selected component (if applicable): 6.3.0.GA How reproducible: Steps to Reproduce: 1. download https://drive.google.com/a/redhat.com/file/d/0By6_zxxSRb11d3BKSXZPeFZ0bzg/edit?usp=sharing 2. unzip and run DV 3. initiate another eap to load data to cache 4. throw sql query to initiate cache and wait to cluster and load data 5. error show when trying to query non indexed class. Actual results: Exception as in log[1] Expected results: Query executed succesfully Additional info: [1] log: http://pastebin.com/HE1qMR54
Updated test case for JDG only. 1. fresh EAP 6.2 install 2. install JDG modules (implement services="import" hack for infinispan query) 3. install attached modules run: java -Djava.net.preferIPv4Stack=true -jar jboss-modules.jar -mp modules mx.redhat.samples.jdg log: ******************************** Hello. This is a sample application making use of Infinispan. 1. Demonstrating basic usage of Red Hat JBoss Data Grid. This cache stores arbitrary objects. Jul 23, 2014 6:13:00 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport start INFO: ISPN000078: Starting JGroups Channel Jul 23, 2014 6:13:01 PM org.jgroups.logging.JDKLogImpl info INFO: UFC is not needed (and can be removed) as we're running on a TCP transport Jul 23, 2014 6:13:04 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport viewAccepted INFO: ISPN000094: Received new cluster view: [dhcp-32-234-53408|0] (1) [dhcp-32-234-53408] Jul 23, 2014 6:13:05 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport startJGroupsChannelIfNeeded INFO: ISPN000079: Cache local address is dhcp-32-234-53408, physical addresses are [127.0.0.1:7800] Jul 23, 2014 6:13:05 PM org.infinispan.factories.GlobalComponentRegistry start INFO: ISPN000128: Infinispan version: Infinispan 'Infinium' 6.1.0.Final-redhat-4 Loading cache with sample data. Loaded cache with 100 entries in 91ms Exception in thread "main" java.lang.IllegalArgumentException: Indexing was not enabled on this cache. interface org.hibernate.search.spi.SearchFactoryIntegrator not found in registry at org.infinispan.query.impl.ComponentRegistryUtils.getComponent(ComponentRegistryUtils.java:27) at org.infinispan.query.impl.ComponentRegistryUtils.getComponent(ComponentRegistryUtils.java:20) at org.infinispan.query.impl.SearchManagerImpl.<init>(SearchManagerImpl.java:43) at org.infinispan.query.Search.getSearchManager(Search.java:37) at mx.redhat.samples.jdg.module.Application.load(Application.java:60) at mx.redhat.samples.jdg.module.Application.main(Application.java:108) 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:622) at org.jboss.modules.Module.run(Module.java:292) at org.jboss.modules.Main.main(Main.java:455)
Created attachment 920378 [details] custom modules for EAP
Next time, can you also add your .java files. Having to decompile your code is not fun. It looks like your Application class retrieves the *default* cache and stores a Resumen object in there. According to infinispan-coppel-afore.xml, the default cache does not have indexing enabled. Hence the error message. I can't vouch for the soundness of the config but the cache "resumen-cache" should have indexing enabled. Try and store data in this one.
Created attachment 920418 [details] custom modules for EAP with source and using resumen-cache
Hi Hugo, Do you still see the exception you mentioned in comment 2? Can you post the logs and exceptions? PS: I don't have the whole product enchilada installed on my machine and am travelling these days.
Log is the same as it before
Just to be sure: - how many nodes do you run? - have you deployed the service fix and the configuration change on all nodes? The same exception is a bit surprising. I'm trying to download the relevant bits but I am having trouble.
I finally found the issue. That was quite subtle. Your domain model module makes use of Hibernate Search annotations. But the module.xml does not declare that dependency. Normally it should fail with an explicit exception except that Java silently ignores annotation it cannot find at runtime. So the domain model classes the Application class was using literally had no Hibernate Search annotation so the error report was right. To fix it, change jboss-eap-6.2/modules/mx/redhat/samples/coppel/afore/model/main/module.xml and add the following dependency <dependencies> <module name="org.infinispan.query" slot="jdg-6.3"/> </dependencies> Here is my output with the fix: emmanuel@emmanuel-mbp-15r jboss-eap-6.2 $ java -Djava.net.preferIPv4Stack=true -jar jboss-modules.jar -mp modules mx.redhat.samples.jdg ******************************** Hello. This is a sample application making use of Infinispan. 1. Demonstrating basic usage of Red Hat JBoss Data Grid. This cache stores arbitrary objects. Jul 24, 2014 11:10:37 AM org.infinispan.remoting.transport.jgroups.JGroupsTransport start INFO: ISPN000078: Starting JGroups Channel Jul 24, 2014 11:10:38 AM org.jgroups.logging.JDKLogImpl info INFO: UFC is not needed (and can be removed) as we're running on a TCP transport Jul 24, 2014 11:10:41 AM org.infinispan.remoting.transport.jgroups.JGroupsTransport viewAccepted INFO: ISPN000094: Received new cluster view: [emmanuel-mbp-15r-44687|0] (1) [emmanuel-mbp-15r-44687] Jul 24, 2014 11:10:41 AM org.infinispan.remoting.transport.jgroups.JGroupsTransport startJGroupsChannelIfNeeded INFO: ISPN000079: Cache local address is emmanuel-mbp-15r-44687, physical addresses are [127.0.0.1:7800] Jul 24, 2014 11:10:41 AM org.infinispan.factories.GlobalComponentRegistry start INFO: ISPN000128: Infinispan version: Infinispan 'Infinium' 6.1.0.Final-redhat-4 Jul 24, 2014 11:10:41 AM org.infinispan.query.impl.LifecycleManager cacheStarting INFO: ISPN000128: Infinispan version: Infinispan 'Infinium' 6.1.0.Final-redhat-4 Jul 24, 2014 11:10:41 AM org.infinispan.query.impl.LifecycleManager cacheStarting INFO: ISPN014003: Registering Query interceptor Jul 24, 2014 11:10:41 AM org.hibernate.search.Version <clinit> INFO: HSEARCH000034: Hibernate Search 4.5.0.Final-redhat-1 Jul 24, 2014 11:10:41 AM org.hibernate.annotations.common.Version <clinit> INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final-redhat-2} Jul 24, 2014 11:10:41 AM org.infinispan.transaction.lookup.GenericTransactionManagerLookup useDummyTM WARN: ISPN000104: Falling back to DummyTransactionManager from Infinispan Loading cache with sample data. Loaded cache with 100 entries in 1312ms Jul 24, 2014 11:10:43 AM org.infinispan.query.impl.massindex.DefaultMassIndexerProgressMonitor printStatusMessage INFO: HSEARCH000030: 50 documents indexed in 10 ms Jul 24, 2014 11:10:43 AM org.infinispan.query.impl.massindex.DefaultMassIndexerProgressMonitor printStatusMessage INFO: HSEARCH000030: 100 documents indexed in 21 ms Seconds to index 100 entries in 124ms 1. Demonstrating search feature. nss: 00000054 [956.382550213413] nss: 00000057 [984.5707750924821] nss: 00000064 [963.570346657392] nss: 00000076 [913.7638716608267] nss: 00000078 [957.6148286710489] nss: 00000100 [963.0499880499511] nss: 00000097 [999.6521179544218] nss: 00000090 [929.9872380547699] nss: 00000013 [955.1091980225281] nss: 00000036 [980.3409936998474] nss: 00000035 [903.8716400389444] result size: 11Seconds to search qry: 30msSample complete. ********************************
Correct, that fixes the problem with the indexing.