-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] SpringBoot 2 + Client 1.0.0 throws NoClassDefFoundError: jakarta/ws/rs/ProcessingException #495
Comments
if your java application use springboot3 (jdk17) or jdk8/jdk11 springboot2.X , you can refer to the following steps: 1.first check your pom file, ensure there are no dependencies on fastjson, refer : 445 2.override jersey version & jakarta version in your pom.xml :
3.check your springboot version, it is recommended to not be lower than 2.7.3 4.if the project has configured Swagger, add a configuration in application.properties(or yml):
|
@z7658329 |
@mangoknight |
spring boot版本:2.3.11.RELEASE 按照这个改了之后报错:java.lang.ClassNotFoundException: javax.annotation.security.DeclareRoles 详细报错如下:
|
can you paste your 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>com.yingzi.tec.lineage.analysis</groupId>
<artifactId>yingzi-tec-lineage-analysis</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.11.RELEASE</version>
<relativePath/>
</parent>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<antlr.version>4.7.1</antlr.version>
<jersey.version>3.0.3</jersey.version>
<jakarta-ws-rs.version>3.0.0</jakarta-ws-rs.version>
<jakarta-annotation.version>2.0.0</jakarta-annotation.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.5.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.25</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.31</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>${antlr.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-client</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>${antlr.version}</version>
<configuration>
<sourceDirectory>src/main/antlr4</sourceDirectory>
<!-- <outputDirectory>src/main/java/com/antlr4/output</outputDirectory>-->
<arguments>
<argument>-visitor</argument>
<argument>-listener</argument>
</arguments>
</configuration>
<executions>
<execution>
<goals>
<goal>antlr4</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project> |
@zhenyuT try to upgrade your springboot version to 2.7.3 ,then try again?
i hava started success in local (springboot version: 2.7.3) |
感谢,升级spring boot到2.7.3解决了问题 不过同时swagger版本也需要更新
并且需要添加配置: |
环境:springboot 2.3.3.RELEASE,hugegraph-client 1.0.0,图库版本为1.0.0 Note:上文中提到的 hugegraph-common:1.0.1在maven仓库中没有此版本,实际上也不用排出。(补充: 1.0.1 因为没正式发布, 所以在配置 stage 仓库才能查看到, 直接下载地址见此) 完整的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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.apache.huge</groupId>
<artifactId>hugegraph-usage</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>hugegraph-usage</name>
<description>hugegraph-usage</description>
<properties>
<java.version>8</java.version>
<hugegraph-client.version>1.0.0</hugegraph-client.version>
<jersey.version>3.0.3</jersey.version>
<jakarta-ws-rs.version>3.0.0</jakarta-ws-rs.version>
<jakarta-annotation.version>2.0.0</jakarta-annotation.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-client</artifactId>
<version>${hugegraph-client.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project> |
@dongma 你的 Update in 2023.12.3: this bug could be totally fixed after the #538 merged, and will be released in |
@imbajin pom.xml是完整的内容,不包含hugegraph-common这部分。此外,在maven中央仓库中,也没有hugegraph-common 1.0.1的版本。(后来注意到,配置stage库才可以看到,详细地址请点击上文地址) |
Bug Type (问题类型)
exception / error (异常报错)
Before submit
Environment (环境信息)
Expected & Actual behavior (期望与实际表现)
I referred to this issue #445 (comment)
compile hugegraph-commons master branch and mvn install common-1.0.1
still throw exception
@imbajin
my code
pom.xml
exception
Vertex/Edge example (问题点 / 边数据举例)
No response
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
No response
The text was updated successfully, but these errors were encountered: