未找到提供者org.glassfish.json.JsonProviderImpl [英] Provider org.glassfish.json.JsonProviderImpl not found
问题描述
根据我的项目提供商org.glassfish.json.JsonProviderImpl没有找到
我不明白为什么它正在抱怨玻璃鱼,因为我正在使用另一个json库:
<?xml version =1.0encoding =UTF-8?>
< project xmlns:xsi =http://www.w3.org/2001/XMLSchema-instance
xmlns =http://maven.apache.org/POM/4.0.0
xsi:schemaLocation =http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">
< modelVersion> 4.0.0< / modelVersion>
< groupId> magistics< / groupId>
< artifactId> magistics< / artifactId>
< version> 1.0-SNAPSHOT< / version>
<包装>战争< / packaging>
< build>
< plugins>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 3.1< / version>
<配置>
< source> 1.8< / source>
< target> 1.8< / target>
< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.tomcat.maven< / groupId>
< artifactId> tomcat7-maven-plugin< / artifactId>
< version> 2.2< / version>
< / plugin>
< / plugins>
< / build>
<依赖关系>
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> javax.servlet-api< / artifactId>
< version> 3.0.1< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> javax.websocket< / groupId>
< artifactId> javax.websocket-api< / artifactId>
< version> 1.1< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> javax.json< / groupId>
< artifactId> javax.json-api< / artifactId>
< version> 1.0< / version>
< /依赖关系>
< dependency>
< groupId> mysql< / groupId>
< artifactId> mysql-connector-java< / artifactId>
< version> 5.1.36< / version>
< /依赖关系>
< /依赖关系>
< / project>
有关如何使用Json库并避免使用glassfish的任何想法? 解决方案
问题是, javax.json-api
只包含API(接口)并且没有实现。
如果您的服务器附带预捆绑的实现这应该工作,但如果没有,您可以添加以下依赖项来获得实现:
< dependency>
< groupId> org.glassfish< / groupId>
< artifactId> javax.json< / artifactId>
< version> 1.0.4< / version>
< /依赖关系>
According to my project Provider org.glassfish.json.JsonProviderImpl not found I dont understand why it is complaining about glassfish as I am using another library for json:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>magistics</groupId>
<artifactId>magistics</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</build>
<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>
</project>
Any idea about how can I use my Json library and avoid to use glassfish?
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>
这篇关于未找到提供者org.glassfish.json.JsonProviderImpl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!