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

ClassNotFoundException: org.apache.logging.log4j.Level when running both examples #90

Closed
jeronimo13 opened this issue Oct 9, 2018 · 5 comments

Comments

@jeronimo13
Copy link

jeronimo13 commented Oct 9, 2018

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/Level at org.elasticsearch.common.logging.ESLoggerFactory.<clinit>(ESLoggerFactory.java:38) at org.elasticsearch.common.logging.Loggers.getLogger(Loggers.java:101) at org.elasticsearch.common.ParseField.<clinit>(ParseField.java:35) at org.elasticsearch.index.query.AbstractQueryBuilder.<clinit>(AbstractQueryBuilder.java:53) at org.elasticsearch.index.query.QueryBuilders.matchAllQuery(QueryBuilders.java:46) at org.springframework.data.elasticsearch.repository.support.AbstractElasticsearchRepository.deleteAll(AbstractElasticsearchRepository.java:256) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:377) at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:200) at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:641) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:605) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:590) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy50.deleteAll(Unknown Source) at sample.data.jest.aws.SampleJestApplication.run(SampleJestApplication.java:34) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:818) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:802) at org.springframework.boot.SpringApplication.run(SpringApplication.java:341) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) at sample.data.jest.aws.SampleJestApplication.main(SampleJestApplication.java:67) Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Level at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) ... 32 more

I setup AWS ES stack as well as localhost elastic(in docker) with no luck.
I've tried spring-boot-sample-data-jest-aws and spring-boot-sample-data-jest examples, but the issue above is the same for both examples

please, help

@VanRoy
Copy link
Owner

VanRoy commented Oct 12, 2018

Hi @jeronimo13 , do you have tried to add this dependency :

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
        </dependency>

@Tcharl
Copy link

Tcharl commented Nov 5, 2018

Why slf4j over anything is not sufficient?
Adding log4j-core as a dependency would break the logging system of many client app!

@VanRoy
Copy link
Owner

VanRoy commented Nov 26, 2018

@VanRoy
Copy link
Owner

VanRoy commented Nov 26, 2018

Hi @jeronimo13 , I updated the getting starting with some informations related to log4j en ES embedded.
No really other workaround for the moment.
Thanks.

@VanRoy VanRoy closed this as completed Nov 26, 2018
@Tcharl
Copy link

Tcharl commented Nov 27, 2018

Sad to hear :-(.
Let's try to find a way to deal with the logging hell.

Thank you for the investigation!

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

No branches or pull requests

3 participants