Giter Site home page Giter Site logo

spring-boot-ehcache-monitor's Introduction

spring-boot-ehcache-monitor

Download

SPEC

  • Spring Framework 4
  • Ehache 3
  • Vaadin 8
  • Vaadin Chartjs

ENVIRONMENT

  • JDK 1.8
  • Spring Boot

Setup

build.gradle

repositories {
    jcenter()
}

dependencies {
    compile 'com.github.kingbbode:spring-boot-ehcache-monitor:{version}'
}


dependencyManagement {
    imports {
        mavenBom "com.vaadin:vaadin-bom:8.1.0"
    }
}

Usage

Example

preview


Path

your.application.com/admin/ehcache


DashBoard

EhCache LIST

list

  • 전체 Cache 리스트와 기본 정보를 노출

Hit Line Chart

chart

  • 분 단위 Cache Hit Line Chart

Cache Detail

Table

table

  • Cache 기본 정보와 상세 Cache 데이터 리스트
  • 삭제 : 특정 Cache 의 특정 데이터를 삭제 가능

Refresh & Flush

function

  • Refresh : 새로고침 없이 데이터를 갱신
  • Flush : 캐시 전체 데이터를 삭제

Search

search

  • Cache 데이터의 Key 값 검색 지원

Description

  • Ehcache 의 쉬운 모니터링 툴이 없어서 만듦.
  • 전체적인 기능은 RMI 환경을 지원
    • 상세 조회, 삭제에 대한 기본적인 기능은 RMI 환경을 지원.
    • 통계 데이터는 단일 서버에 대한 데이터만 노출.
    • 분산 환경이라면, 대부분 통계 데이터가 거의 동일한 추이를 보이므로, 단일 서버에 대한 통계 모니터링만으로 충분할 수도 있다고 판단.
    • RMI 가 통계 데이터를 지원하지 않으며, 몇 가지 통계를 가져올 순 있지만 서비스에 영향을 줄 수 있으므로 스펙 제외.
  • Spring Security 를 사용하여 'admin/cache' 에 대한 접근을 제한할 것을 추천.

spring-boot-ehcache-monitor's People

Contributors

5minho avatar abbysandy avatar kingbbode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-boot-ehcache-monitor's Issues

Unable to manage EHCache under the JSR107 specification

The following is my related introduction in POM.xml.

<!-- https://mvnrepository.com/artifact/org.ehcache/ehcache -->
        <dependency>
            <groupId>org.ehcache</groupId>
            <artifactId>ehcache</artifactId>
            <version>3.9.7</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/javax.cache/cache-api -->
        <dependency>
            <groupId>javax.cache</groupId>
            <artifactId>cache-api</artifactId>
            <version>1.1.1</version>
        </dependency>
<!-- https://mvnrepository.com/artifact/com.github.kingbbode/spring-boot-ehcache-monitor -->
        <dependency>
            <groupId>com.github.kingbbode</groupId>
            <artifactId>spring-boot-ehcache-monitor</artifactId>
            <version>1.1</version>
            <exclusions>
                <exclusion>
                    <groupId>com.vaadin</groupId>
                    <artifactId>vaadin-client-compiled</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.vaadin</groupId>
                    <artifactId>vaadin-themes</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.vaadin/vaadin-bom -->
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-bom</artifactId>
            <version>22.0.0</version>
            <type>pom</type>
        </dependency>

When I tried to introduce spring-boot-ehcache-monitor, I found that EHCache under the JSR107 specification could not be managed, and it would throw an exception.

2021-12-10 12:42:38.851  WARN 15764 --- [  restartedMain] o.e.i.i.executor.PooledExecutionService  : No default pool configured, services requiring thread pools must be configured explicitly using named thread pools
2021-12-10 12:42:39.016  INFO 15764 --- [  restartedMain] org.ehcache.core.EhcacheManager          : Cache 'displaysASpecificStatisticalTable' created in EhcacheManager.
2021-12-10 12:42:39.090  INFO 15764 --- [  restartedMain] org.ehcache.core.EhcacheManager          : Cache 'TbCompanyToTablePOCache' created in EhcacheManager.
2021-12-10 12:42:39.112  INFO 15764 --- [  restartedMain] org.ehcache.jsr107.Eh107CacheManager     : Registering Ehcache MBean javax.cache:type=CacheConfiguration,CacheManager=file./D./TwinklingLiftWorks/TestAndExperiment/JavaInIntelliJIDEA/lingh/lingh-springboot/lingh-web/target/classes/ehcache.xml,Cache=displaysASpecificStatisticalTable
2021-12-10 12:42:39.112  INFO 15764 --- [  restartedMain] org.ehcache.jsr107.Eh107CacheManager     : Registering Ehcache MBean javax.cache:type=CacheStatistics,CacheManager=file./D./TwinklingLiftWorks/TestAndExperiment/JavaInIntelliJIDEA/lingh/lingh-springboot/lingh-web/target/classes/ehcache.xml,Cache=displaysASpecificStatisticalTable
2021-12-10 12:42:39.113  INFO 15764 --- [  restartedMain] org.ehcache.jsr107.Eh107CacheManager     : Registering Ehcache MBean javax.cache:type=CacheConfiguration,CacheManager=file./D./TwinklingLiftWorks/TestAndExperiment/JavaInIntelliJIDEA/lingh/lingh-springboot/lingh-web/target/classes/ehcache.xml,Cache=TbCompanyToTablePOCache
2021-12-10 12:42:39.113  INFO 15764 --- [  restartedMain] org.ehcache.jsr107.Eh107CacheManager     : Registering Ehcache MBean javax.cache:type=CacheStatistics,CacheManager=file./D./TwinklingLiftWorks/TestAndExperiment/JavaInIntelliJIDEA/lingh/lingh-springboot/lingh-web/target/classes/ehcache.xml,Cache=TbCompanyToTablePOCache
2021-12-10 12:42:39.117  INFO 15764 --- [  restartedMain] org.ehcache.jsr107.Eh107CacheManager     : Registering Ehcache MBean javax.cache:type=CacheConfiguration,CacheManager=file./D./TwinklingLiftWorks/TestAndExperiment/JavaInIntelliJIDEA/lingh/lingh-springboot/lingh-web/target/classes/ehcache.xml,Cache=displaysASpecificStatisticalTable
2021-12-10 12:42:39.118  INFO 15764 --- [  restartedMain] org.ehcache.jsr107.Eh107CacheManager     : Registering Ehcache MBean javax.cache:type=CacheStatistics,CacheManager=file./D./TwinklingLiftWorks/TestAndExperiment/JavaInIntelliJIDEA/lingh/lingh-springboot/lingh-web/target/classes/ehcache.xml,Cache=displaysASpecificStatisticalTable
2021-12-10 12:42:39.118  INFO 15764 --- [  restartedMain] org.ehcache.jsr107.Eh107CacheManager     : Registering Ehcache MBean javax.cache:type=CacheConfiguration,CacheManager=file./D./TwinklingLiftWorks/TestAndExperiment/JavaInIntelliJIDEA/lingh/lingh-springboot/lingh-web/target/classes/ehcache.xml,Cache=TbCompanyToTablePOCache
2021-12-10 12:42:39.118  INFO 15764 --- [  restartedMain] org.ehcache.jsr107.Eh107CacheManager     : Registering Ehcache MBean javax.cache:type=CacheStatistics,CacheManager=file./D./TwinklingLiftWorks/TestAndExperiment/JavaInIntelliJIDEA/lingh/lingh-springboot/lingh-web/target/classes/ehcache.xml,Cache=TbCompanyToTablePOCache
2021-12-10 12:42:40.175  INFO 15764 --- [  restartedMain] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 13 endpoint(s) beneath base path ''
2021-12-10 12:42:40.814  WARN 15764 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheHistoryStore' defined in class path resource [com/github/kingbbode/ehcache/monitor/EhcacheMonitorAutoConfiguration$EnableHistoryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.kingbbode.ehcache.monitor.component.CacheHistoryStore]: Factory method 'cacheHistoryStore' threw exception; nested exception is java.lang.ClassCastException: org.springframework.cache.jcache.JCacheCacheManager cannot be cast to org.springframework.cache.ehcache.EhCacheCacheManager
2021-12-10 12:42:40.830  INFO 15764 --- [  restartedMain] org.ehcache.core.EhcacheManager          : Cache 'displaysASpecificStatisticalTable' removed from EhcacheManager.
2021-12-10 12:42:40.849  INFO 15764 --- [  restartedMain] org.ehcache.core.EhcacheManager          : Cache 'TbCompanyToTablePOCache' removed from EhcacheManager.
2021-12-10 12:42:40.881  INFO 15764 --- [  restartedMain] c.b.d.d.DynamicRoutingDataSource         : dynamic-datasource start closing ....
2021-12-10 12:42:40.883  INFO 15764 --- [  restartedMain] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closing ...
2021-12-10 12:42:40.886  INFO 15764 --- [  restartedMain] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed
2021-12-10 12:42:40.886  INFO 15764 --- [  restartedMain] c.b.d.d.DynamicRoutingDataSource         : dynamic-datasource all closed success,bye
2021-12-10 12:42:40.889  INFO 15764 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-12-10 12:42:40.904  INFO 15764 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-10 12:42:40.924 ERROR 15764 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheHistoryStore' defined in class path resource [com/github/kingbbode/ehcache/monitor/EhcacheMonitorAutoConfiguration$EnableHistoryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.kingbbode.ehcache.monitor.component.CacheHistoryStore]: Factory method 'cacheHistoryStore' threw exception; nested exception is java.lang.ClassCastException: org.springframework.cache.jcache.JCacheCacheManager cannot be cast to org.springframework.cache.ehcache.EhCacheCacheManager
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.13.jar:5.3.13]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.13.jar:5.3.13]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.1.jar:2.6.1]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) [spring-boot-2.6.1.jar:2.6.1]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.6.1.jar:2.6.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) [spring-boot-2.6.1.jar:2.6.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) [spring-boot-2.6.1.jar:2.6.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) [spring-boot-2.6.1.jar:2.6.1]
	at com.lingh.LinghWebApplication.main(LinghWebApplication.java:13) [classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_302]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_302]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_302]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_302]
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.6.1.jar:2.6.1]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.kingbbode.ehcache.monitor.component.CacheHistoryStore]: Factory method 'cacheHistoryStore' threw exception; nested exception is java.lang.ClassCastException: org.springframework.cache.jcache.JCacheCacheManager cannot be cast to org.springframework.cache.ehcache.EhCacheCacheManager
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.13.jar:5.3.13]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.13.jar:5.3.13]
	... 24 common frames omitted
Caused by: java.lang.ClassCastException: org.springframework.cache.jcache.JCacheCacheManager cannot be cast to org.springframework.cache.ehcache.EhCacheCacheManager
	at com.github.kingbbode.ehcache.monitor.component.CacheHistoryStore.<init>(CacheHistoryStore.java:24) ~[spring-boot-ehcache-monitor-1.1.jar:na]
	at com.github.kingbbode.ehcache.monitor.EhcacheMonitorAutoConfiguration$EnableHistoryConfiguration.cacheHistoryStore(EhcacheMonitorAutoConfiguration.java:27) ~[spring-boot-ehcache-monitor-1.1.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_302]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_302]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_302]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_302]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.13.jar:5.3.13]
	... 25 common frames omitted


进程已结束,退出代码为 0

Can anyone provide solutions?

support maven

If it can support maven, it will be perfect, because our project is using Maven.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.