Provider org.glassfish.json.JsonProviderImpl not found

Deadly 提交于 2020-05-12 11:18:25

问题


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>
...

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


回答1:


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>


来源:https://stackoverflow.com/questions/33083050/provider-org-glassfish-json-jsonproviderimpl-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!