Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating caches from template cannot find specified template #78

Open
Spielzeug opened this issue May 31, 2023 · 2 comments
Open

Creating caches from template cannot find specified template #78

Spielzeug opened this issue May 31, 2023 · 2 comments

Comments

@Spielzeug
Copy link

Spielzeug commented May 31, 2023

When trying to create a cache from cache template as described in https://infinispan.org/docs/stable/titles/configuring/configuring.html#cache-configuration and https://infinispan.org/docs/helm-chart/main/helm-chart.html#server-configuration-values_configuring-servers

java.lang.reflect.InvocationTargetException                                                                                                           │
│     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                 │
│     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)                                               │
│     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                       │
│     at java.base/java.lang.reflect.Method.invoke(Method.java:568)                                                                                     │
│     at org.infinispan.server.loader.Loader.run(Loader.java:106)                                                                                       │
│     at org.infinispan.server.loader.Loader.main(Loader.java:51)                                                                                       │
│ Caused by: org.infinispan.commons.CacheConfigurationException: ISPN000374: No such template 'distributed-cache-template' when declaring 'sessions'    │
│     at org.infinispan.configuration.parsing.CacheParser.getConfigurationBuilder(CacheParser.java:1186)                                                │
│     at org.infinispan.configuration.parsing.CacheParser.parseDistributedCache(CacheParser.java:1038)                                                  │
│     at org.infinispan.configuration.parsing.Parser.parseCaches(Parser.java:872)                                                                       │
│     at org.infinispan.configuration.parsing.Parser.parseContainer(Parser.java:752)                                                                    │
│     at org.infinispan.configuration.parsing.Parser.readElement(Parser.java:87)                                                                        │
│     at org.infinispan.configuration.parsing.ParserRegistry.parseElement(ParserRegistry.java:209)                                                      │
│     at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:187)                                                             │
│     at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:175)                                                             │
│     at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:169)                                                             │
│     at org.infinispan.server.Server.parseConfiguration(Server.java:319)                                                                               │
│     at org.infinispan.server.Server.<init>(Server.java:234)                                                                                           │
│     at org.infinispan.server.Bootstrap.runInternal(Bootstrap.java:171)                                                                                │
│     at org.infinispan.server.tool.Main.run(Main.java:98)                                                                                              │
│     at org.infinispan.server.Bootstrap.main(Bootstrap.java:56)

The only changed configuration is as follows:

    cacheContainer:
      name: default
      statistics: true
      distributedCacheConfiguration:
        name: "distributed-cache-template"
        mode: "SYNC"
        statistics: "true"
        encoding:
          mediaType: "application/x-protostream"
        expiration:
          lifespan: "5000"
          maxIdle: "1000"
        memory:
          maxCount: "1000000"
          whenFull: "REMOVE"
      distributedCache:
        name: "sessions"
        configuration: "my-dist-template"

Defining caches without template works. What is the correct syntax to use cache templates?

@ryanemerson
Copy link
Contributor

ryanemerson commented May 31, 2023

Thanks for raising the issue @Spielzeug.

Unfortunately it seems you're hitting ISPN-14942, which requires changes to our server. Hopefully we'll have a fix in the near future, but until then I suggest that you explicitly define the cache configuration for each of your caches instead of utilising templates.

@Spielzeug
Copy link
Author

Ok good to know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants