gpt4 book ai didi

java - JAX-WS 和 Spring 运行时建模器错误

转载 作者:行者123 更新时间:2023-11-30 04:10:58 27 4
gpt4 key购买 nike

我正在尝试构建网络服务。

WS接口(interface)

@WebService
public interface StreamWS {
public void addLog(String description, String param1, String param2, String param3, String param4,
String comment);
}

WS 实现

@WebService(endpointInterface = "package.StreamWS")
public class StreamWSImpl implements StreamWS {

@Autowired
private LogDAO logDAO;

@Override
public void addLog(String description, String param1, String param2, String param3, String param4,
String comment) {
Log log = new Log();
log.setDescription(description);
log.setParam1(param1);
log.setParam2(param2);
log.setParam3(param3);
log.setParam4(param4);
log.setComment(comment);
log.setTime();
logDAO.insertOrUpdate(log);
}

}

ws.xml

<?xml version="1.0"?>
<beans
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://jax-ws.dev.java.net/spring/core http://jax-ws.dev.java.net/spring/core.xsd http://jax-ws.dev.java.net/spring/servlet http://jax-ws.dev.java.net/spring/servlet.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet" xmlns:ws="http://jax-ws.dev.java.net/spring/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans">


<wss:binding url="/webservices/streamWS">
<wss:service>
<ws:service bean="#streamWS" />
</wss:service>
</wss:binding>

<bean class="package.StreamWSImpl" id="streamWS" />

</beans>

我收到以下错误:

Caused by: com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class package.jaxws.AddLog is not found. Have you run APT to generate them?

最佳答案

您可能只需要生成 WS 工件即可使其工作。

尝试在 target/classes/目录中运行该命令:

wsgen -keep -cp your.package.StreamWSImpl

检查documentation .

关于java - JAX-WS 和 Spring 运行时建模器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19607081/

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