当我在Tomcat上部署应用程序的战争并启动应用程序时,我收到以下错误。
严重:Servlet[泽西Web应用程序]在Web应用程序[/Reaser-api]抛出的负载()异常java.lang.AbstractMathodError:接收器类org.glassfish.jersey.internal.config.外部属性AutoDiscoverable没有定义或继承的接口org.glassfish.jersey.internal.spi.AutoDiscoverable的解析方法抽象无效配置(javax.ws.rs.core.FeatureContext)的实现。
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>gr.iti.sodalite</groupId>
<artifactId>semantic-reasoner</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>reasoning-engine</module>
<module>reasoner-api</module>
</modules>
<properties>
<jersey2.version>3.0.0-M6</jersey2.version>
<jaxrs.version>2.1.1</jaxrs.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey2.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-bundle -->
<!-->dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-bundle</artifactId>
<version>1.19</version>
</dependency-->
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-servlet -->
<!-- dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>1.19</version>
</dependency-->
<!-- https://mvnrepository.com/artifact/io.swagger/swagger-jersey2-jaxrs -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-runtime</artifactId>
<version>3.4.3</version>
<type>pom</type>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.eclipse.rdf4j</groupId> -->
<!-- <artifactId>rdf4j-sparqlbuilder</artifactId> -->
<!-- <version>3.0.0</version> -->
<!-- </dependency> -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.8</version>
</dependency>
<dependency>
<groupId>com.ontotext.graphdb</groupId>
<artifactId>graphdb-free-runtime</artifactId>
<version>9.4.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>reasoner-api</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<!-- configuration>
<source>8</source>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
</configuration-->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- attached to Maven test phase -->
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
web.xml
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<!-- For Jersey 1.x -->
<!-- servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class-->
<!-- For Jersey 2.x -->
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>
io.swagger.jaxrs.listing,
restapi
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/v0.6/*</url-pattern>
</servlet-mapping>
</web-app>
它能处理那些文件。
网站.xml
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<!-- For Jersey 2.x -->
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>
io.swagger.jaxrs.json,
io.swagger.jaxrs.listing,
restapi
</param-value>
</init-param>
<!-- <init-param> -->
<!-- <param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name> -->
<!-- <param-value>filter.CORSFilter</param-value> -->
<!-- </init-param> -->
<load-on-startup>1</load-on-startup>
</servlet>
<!-- servlet>
<servlet-name>Jersey2Config</servlet-name>
<servlet-class>io.swagger.jaxrs.config.DefaultJaxrsConfig</servlet-class>
<init-param>
<param-name>api.version</param-name>
<param-value>0.6</param-value>
</init-param>
<init-param>
<param-name>swagger.api.basepath</param-name>
<param-value>http://160.40.52.200:8084/reasoner-api/v0.6</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet-->
<servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/v0.6/*</url-pattern>
</servlet-mapping>
pom.xml摘录
<properties>
<jersey2.version>2.32</jersey2.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<default.min.distinct.threshold>104857600</default.min.distinct.threshold>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey2.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/io.swagger/swagger-jersey2-jaxrs -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<!-- use the following artifactId if you don't need servlet 2.x compatibility -->
<!-- artifactId>jersey-container-servlet</artifactId -->
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
</dependency>
...
</dependency>
</dependencies>
我有一个web应用程序,它将从jar文件动态加载其资源。 我必须如何重新编写加载和注册资源并启动服务器的主类,以便它在web应用程序内部工作? 我目前定义了一个,它在标记为的方法中加载资源。虽然这是有效的,但它会随着每个请求初始化。 我尝试将添加到应用程序中,但这导致了错误: 我的做法是完全错误的吗?或者如何创建这样一个系统,作为可部署的war运行? *编辑* 通过使用ServletContext
我在Ubuntu服务器VCS中安装了jetty 9服务器。java rest项目的结构: /opt/jetty/webapps/backend/ 构建 conf lib 库 日志 s rc/com/example/pack/backend 资源 CategoryResource.java 网络 网.xml BackendServer.java 类别资源.java 网.xml /opt/jetty/
本章将教您如何使用Maven管理基于Web的项目。 在这里,您将学习如何创建/构建/部署和运行Web应用程序。 创建Web应用程序 要创建一个简单的Java Web应用程序,我们将使用maven-archetype-webapp插件。 所以,让我们打开命令控制台,转到C:\MVN目录并执行以下mvn命令。 C:\MVN>mvn archetype:generate -DgroupId = com
在99%的情况下,当SQL server返回意外错误或文件系统中缺少文件时,我不能做任何合理的事情,我只想记录这种情况并将错误返回给用户。所以我看不出有什么理由应该返回“err”手动展开堆栈,实际上我会丢失stacktrace和上下文,并且更难找到错误的原因。 有没有什么我错过了,所以这种方法不会很好地工作?似乎大多数Go文章都建议不要使用panic/recover,但我不明白为什么。它看起来非常
问题内容: 我目前正在使用Java EE技术和Eclipse作为IDE开发MVC应用程序。要运行服务器并部署应用程序,我正在使用ANT。我想知道如何通过ant工具或Eclipse调试Java代码。 问题答案: 将以下选项添加到您的tomcat start命令中: 您将能够使用调试类别在端口5000上附加Eclipse调试器。
问题内容: 有没有人使用Selenium和大量的Dojo Web应用程序进行了广泛的自动化?我正在寻找您可能遇到的任何问题或与Selenium和Dojo的组合直接相关的问题。 问题答案: 我已经在许多不同的Web应用程序中广泛使用了Selenium,包括Dojo上的一些Web应用程序。你应该没事的。我建议的一种做法是确保要测试的所有组件(将要驱动的UI控件以及要阅读以进行测试的文本组件)均已设置I