gpt4 book ai didi

java - 端点无法解析为类型(ws 中的@Endpoint)- Eclipse 编译错误

转载 作者:行者123 更新时间:2023-11-30 05:27:55 25 4
gpt4 key购买 nike

这有点奇怪,或者可能是我遗漏了一些东西。

我正在使用 Spring Boot 应用程序发布 SOAP 端点。下面是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>
.............
</parent>
<groupId>com.gd</groupId>
<artifactId>sl</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>sl</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
</dependency>
</dependencies> ..........plugin and other stuff.

根据教程,我们只需要 wsdl4j 依赖项即可发布 SOAP 端点。

下面是我的端点类 -

@Endpoint
public class UserDetailsEndpoint {

}

这很简单,但是 Eclipse 显示编译错误并且未将 @Endpoint 注释解析为

import org.springframework.ws.server.endpoint.annotation.Endpoint;

Compilation error

可能是什么问题,我缺少什么?

最佳答案

尝试添加此依赖项:

<!-- https://mvnrepository.com/artifact/org.springframework.ws/spring-ws-core -->
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
</dependency>

查找所需依赖项的一种通常成功的方法是简单地搜索“maven <missing-package>”。

在本例中,我搜索“maven org.springframework.ws”并找到了此依赖项。

关于java - 端点无法解析为类型(ws 中的@Endpoint)- Eclipse 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58185825/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com