Unable to query Infinispan. Getting the Module propertes error. Please advise
savin7 Jul 20, 2010 2:22 AMDear All,
I am querying Infinispan using the below class, That queries the customer class with field name customerId and have to fetches the value for that Customer.
-------------------------------------------------------------------------
import model.Customer;
public class OurQueryingTest {
 /**
  * @param args
  */
 public static void main(String[] args) {
  Configuration cfg = new Configuration(); 
  cfg.setIndexingEnabled(true);
  cfg.setIndexLocalOnly(true);
  
  Cache<String,Customer> c  = new DefaultCacheManager(cfg).getCache();
  
  QueryHelper qh = new QueryHelper(c, new Properties(), Customer.class);
  //Adding values to cache
  for(int i=0; i<3; i++){
   Customer customer1 = new Customer("ID"+i,"Name"+i,"Add"+i);
   c.put("cust"+i, customer1);
  }
  
  QueryFactory qf = new QueryFactory(c, qh);
  
  try {
   CacheQuery cq = qf.getBasicQuery("customerID", "ID0");
   System.out.println("CQ Size :"+cq.getResultSize());
   List<Object> found = cq.list();   
   Iterator<Object> itr = found.iterator();
   while(itr.hasNext()) {
    Customer cust = (Customer)itr.next();
    System.out.println("ID is: "+cust.getCustomerID());
    System.out.println("Name is: "+cust.getCustomerID());
    System.out.println("Address is: "+cust.getCustomerID());    
   }     
  } catch(Exception e) {
   e.getStackTrace();
  }
 }
}
----------------------------------------------------------------------------------------
Class to query is Customer class with simple setter & getter methods
-----------------------------------------------------------------------------------------
public class Customer {
 
 private String customerID;
 private String customerName;
 private String customerAddr;
  
 public Customer(String customerID, String customerName, String customerAddr) {
  super();
  this.customerID = customerID;
  this.customerName = customerName;
  this.customerAddr = customerAddr;
 }
 
 public String getCustomerID() {
  return customerID;
 }
 public void setCustomerID(String customerID) {
  this.customerID = customerID;
 }
 public String getCustomerName() {
  return customerName;
 }
 public void setCustomerName(String customerName) {
  this.customerName = customerName;
 }
 public String getCustomerAddr() {
  return customerAddr;
 }
 public void setCustomerAddr(String customerAddr) {
  this.customerAddr = customerAddr;
 }
}
----------------------------------------------------------------------------------------------------------
But I was getting the below exception at the execution of this line Cache<String,Customer> c = new DefaultCacheManager(cfg).getCache();
----------------------------------------------------------------------------------------------------------
20-Jul-2010 09:01:01 org.infinispan.util.ModuleProperties loadModuleProperties WARNING: Could not load module at URL jar:file:/D:/ourWorkSpace/Infinispan_local/lib/infinispan-query.jar!/infinispan-module.properties org.infinispan.config.ConfigurationException    : Module propertes does not specify module configuration class name. Module configuration class name should be specified using key infinispan.module.configurationClassName  at org.infinispan.util.ModuleProperties.verify( ModuleProperties.java:144)  at org.infinispan.util.ModuleProperties.loadModuleProperties( ModuleProperties.java:100)  at org.infinispan.util.ModuleProperties.resolveModuleLifecycles( ModuleProperties.java:112)  at org.infinispan.factories.AbstractComponentRegistry.<clinit>( AbstractComponentRegistry.java:104)  at org.infinispan.manager.DefaultCacheManager.<init>( DefaultCacheManager.java:235)  at org.infinispan.manager.DefaultCacheManager.<init>( DefaultCacheManager.java:157)  at Test.OurQueryingTest.main( OurQueryingTest.java:38)  20-Jul-2010 09:01:01 org.infinispan.factories.AbstractComponentRegistry internalStart INFO: Infinispan version: Infinispan 'Starobrno' 4.0.0.FINAL 20-Jul-2010 09:01:01 org.infinispan.factories.AbstractComponentRegistry internalStart INFO: Infinispan version: Infinispan 'Starobrno' 4.0.0.FINAL Exception in thread "main" java.lang.IllegalArgumentException: There is no provided id on model.Customer class  at org.infinispan.query.backend.QueryHelper.validateClasses( QueryHelper.java:202)  at org.infinispan.query.backend.QueryHelper.<init>( QueryHelper.java:93)  at Test.OurQueryingTest.main( OurQueryingTest.java:41) -------------------------------   -----------------------------------------------------------------------------------------------------------------------------   Please advice how to get rid of this error and sucessfully query my class Customer.    Thanks & Regards, Savin
 
     
     
     
    
 
    