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

NullPointerException in createCache(String name) #25

Open
bmarwell opened this issue Aug 31, 2018 · 1 comment
Open

NullPointerException in createCache(String name) #25

bmarwell opened this issue Aug 31, 2018 · 1 comment

Comments

@bmarwell
Copy link

Hi there,

if a cache is not configured in ehcache.xml, you'll get a NPE.

The problamatic part is configurationbuilder which can be null. You still call the build() method without checking.

Suggestion:

      if (null == configurationBuilder) {
        throw new IllegalStateException("No configuration for the cache with the name [" + name + "] was found. "
            + "Please add it to your ehcache.xml file.");
      }
@bmarwell
Copy link
Author

Actually the problem is the cache-template name="defaultCacheConfiguration". If it's missing or empty, you will also get this error. The message above should reflect this.

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

1 participant