gpt4 book ai didi

java - 从 Jboss7 迁移到 WildFly10 后,WebContext 不再受支持

转载 作者:行者123 更新时间:2023-11-30 02:54:55 26 4
gpt4 key购买 nike

我正在将作为 Web 服务公开的无状态 EJB 从 JBoss7 AS 迁移到 WildFly 10(当然我有点晚了)。

网络服务过去可通过 http://localhost:8080/vmwWS/vmw 访问,迁移到 WildFly 让我http://localhost:8080//vmwWS/WSVMWBean,我还没有找到更改此设置的方法。

这是 Web 服务类

[...]
@Interceptors(TracingInterceptor.class)
@Stateless
@WebService(endpointInterface = "com.mydomain.WSVMW")
@WebContext(contextRoot="/vmwWS", urlPattern ="/vmw", authMethod="BASIC", secureWSDLAccess = false)
@SecurityDomain("JBossWS")
@RolesAllowed({ "Read", "Write" })
public class WSVMWBean implements WSVMW {
[...]

界面:

[...]
@WebService(name = "vmw")
@SOAPBinding(style = Style.DOCUMENT)
@Local
public interface WSVMW {
[...]

还有 jboss-webservice.xml:

<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.com/xml/ns/javaee/jbossws-web-services_1_0.xsd"
version="1.1">
<context-root>vmwWS</context-root>
<port-component>
<ejb-name>WSVMWBean</ejb-name>
<port-component-name>WSVMWBean</port-component-name>
<port-component-uri>/vmw</port-component-uri>
<auth-method>BASIC</auth-method>
</port-component>
</webservices>

日志显示:

22:16:59,520 INFO  [org.jboss.ws.cxf.metadata] (MSC service thread 1-8) JBWS024061: Adding service endpoint metadata: id=WSVMWBean
address=http://localhost:8080/<ejb-jar-name>/vmwWS/WSVMWBean
implementor=com.mydomain.WSVMWBean
serviceName={http://vmw.mydomain.com/}/vmwWS
portName={http://vmw.mydomain.com/}WSVMWBeanPort
annotationWsdlLocation=null
wsdlLocationOverride=null
mtomEnabled=false

如何恢复之前的行为?

最佳答案

简而言之,这是修复它的差异:

-import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.ws.api.annotation.WebContext;

从这里开始: https://developer.jboss.org/wiki/JBossWS4MigrationGuide

关于java - 从 Jboss7 迁移到 WildFly10 后,WebContext 不再受支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37533561/

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