Provider org.glassfish.json.JsonProviderImpl not found

Manuel Sopena Ballesteros picture Manuel Sopena Ballesteros · Oct 12, 2015 · Viewed 12.1k times · Source

According to my project Provider org.glassfish.json.JsonProviderImpl not found I dont understand why it is complaining about glassfish as I am using a different library for json:

...
        <dependencies>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.0.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.websocket</groupId>
                <artifactId>javax.websocket-api</artifactId>
                <version>1.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.json</groupId>
                <artifactId>javax.json-api</artifactId>
                <version>1.0</version>
            </dependency>
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.36</version>
            </dependency>
        </dependencies>
...

enter image description here

Any idea about how can I use my Json library and avoid to use glassfish?

Answer

unwichtich picture unwichtich · Oct 13, 2015

The problem is that javax.json-api only contains the API (interfaces) and no implementation.

If your server comes with a pre-bundled implementation this should work, but if not you can add the following dependency to get an implementation:

<dependency>
  <groupId>org.glassfish</groupId>
  <artifactId>javax.json</artifactId>
  <version>1.0.4</version>
</dependency>