0

Im trying mess around with graph ql and integrating it with our existing project. Im following this tutorial since our project is java with spring framework

but after adding the dependencies

<dependency>
    <groupId>com.graphql-java</groupId>
    <artifactId>graphql-spring-boot-starter</artifactId>
    <version>5.0.2</version>
</dependency>
<dependency>
    <groupId>com.graphql-java</groupId>
    <artifactId>graphql-java-tools</artifactId>
    <version>5.2.4</version>
</dependency>

and trying to start my project i get an error

Caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j

I have found similar post here, and here Which lead me to attempt to add exclusions but that did NOT help

        <dependency>
            <groupId>com.graphql-java</groupId>
            <artifactId>graphql-spring-boot-starter</artifactId>
            <version>5.0.2</version>
        <exclusions>
            <exclusion>
                <groupId>log4j-slf4j-impl</groupId>
                <artifactId>*</artifactId>
            </exclusion>
            <exclusion>
                <groupId>log4j-to-slf4j</groupId>
                <artifactId>*</artifactId>
            </exclusion>
        </exclusions>
        </dependency>
owen gerig
  • 6,165
  • 6
  • 52
  • 91

2 Answers2

1

Excluded dependencies groupId seems wrong. Changing excluded groupId's to org.apache.logging.log4j may solve your problem.

aburakc
  • 109
  • 1
  • 4
0

i ended up using

<dependency>
    <groupId>com.graphql-java</groupId>
    <artifactId>graphql-java</artifactId>
    <version>5.0.2</version>
</dependency>
owen gerig
  • 6,165
  • 6
  • 52
  • 91