java 未找到提供程序 org.glassfish.json.JsonProviderImpl
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33083050/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Provider org.glassfish.json.JsonProviderImpl not found
提问by Manuel Sopena Ballesteros
According to my project Provider org.glassfish.json.JsonProviderImpl not foundI dont understand why it is complaining about glassfish as I am using a different library for json:
根据我的项目,Provider org.glassfish.json.JsonProviderImpl not found我不明白为什么它会抱怨 glassfish,因为我对 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?
关于如何使用我的 Json 库并避免使用 glassfish 的任何想法?
回答by unwichtich
The problem is that javax.json-apionly contains the API (interfaces) and no implementation.
问题是javax.json-api只包含 API(接口)而没有实现。
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>


