Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-9865

Query is failing if custom classes are used inside of the cache

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 9.4.5.Final
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Wildfly server with ISPN modules and ISPN subsystem to configure caches

    • Sprint:
      DataGrid Sprint #31, DataGrid Sprint #32, DataGrid Sprint #33, DataGrid Sprint #34
    • Steps to Reproduce:
      Hide

      Install Wildfly (i.e. 15.0)
      add Infinispan modules for 9.4.x

      run both attached CLI files

      Show
      Install Wildfly (i.e. 15.0) add Infinispan modules for 9.4.x run both attached CLI files

      Description

      A simple query for a cache which contains User classes will fail for queries with the error below.

      UserData class for the cache:
      public class Test implements Serializable {
      private int testId;
      public Test(){}
      public Test(int myId)

      {this.testId = myId;}

      public int getTestId()

      {return animalId;}

      public void setTestId(int testId)

      { this.testId = testId;}

      }

      Simple EJB for test
      @Singleton
      @Startup
      public class TestInfinispanQuery4EAPConfig {
      @Resource(lookup = "java:jboss/datagrid-infinispan/container/jdg-container/cache/EAPcache")
      private Cache<String, Object> cache;

      @PostConstruct
      public void LoadDBToMemory()

      { cache.put("1", new Test(2, 0)); cache.put("2", new Test(2, 0)); cache.put("3", new Test(1, 0)); QueryFactory queryFactory = Search.getQueryFactory(cache); Query q = queryFactory.from(Test.class).having("testId").eq(2).build(); int size = q.getResultSize(); System.out.println("result = " + size); }

      }

      Caused by: java.lang.IllegalStateException: ISPN028510: Unknown entity name org.infinispan.wfink.web.Test
      at org.infinispan.objectfilter.impl.syntax.parser.QueryResolverDelegateImpl.registerPersisterSpace(QueryResolverDelegateImpl.java:60)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.entityName(QueryResolver.java:6683)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.persisterSpaceRoot(QueryResolver.java:1302)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.persisterSpace(QueryResolver.java:1203)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.persisterSpaces(QueryResolver.java:1144)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.fromClause(QueryResolver.java:1060)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.selectFrom(QueryResolver.java:969)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.querySpec(QueryResolver.java:487)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.queryStatement(QueryResolver.java:388)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.queryStatementSet(QueryResolver.java:308)
      at org.infinispan.objectfilter.impl.ql.parse.QueryResolver.statement(QueryResolver.java:241)
      at org.infinispan.objectfilter.impl.ql.QueryParser.resolve(QueryParser.java:81)
      at org.infinispan.objectfilter.impl.ql.QueryParser.parseQuery(QueryParser.java:69)
      at org.infinispan.objectfilter.impl.syntax.parser.IckleParser.parse(IckleParser.java:19)
      at org.infinispan.query.dsl.embedded.impl.QueryEngine.lambda$parse$1(QueryEngine.java:695)
      at org.infinispan.query.dsl.embedded.impl.QueryCache.lambda$get$ab3121d1$1(QueryCache.java:73)
      at org.infinispan.compat.FunctionMapper.apply(FunctionMapper.java:40)
      at org.infinispan.commands.write.ComputeIfAbsentCommand.perform(ComputeIfAbsentCommand.java:104)
      at org.infinispan.interceptors.impl.CallInterceptor.visitCommand(CallInterceptor.java:29)
      at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNextThenAccept(BaseAsyncInterceptor.java:100)
      at org.infinispan.interceptors.impl.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:672)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  anistor Nistor Adrian
                  Reporter:
                  wdfink Wolf-Dieter Fink
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated: