I am in the process of migrating my Jboss Java 8 application to Tomcat Java 17.
I have already converted all my sources to Jakarta.
I have an issue migrating the service part of my application; I get the following error when I call the URL http://localhost:8080/ClasseurClientWS/services/WSNotificationSOAP:
10-Apr-2025 11:36:53.522 WARNING [http-nio-8080-exec-2] org.apache.cxf.transport.servlet.ServletController.invoke Can't find the request for http://localhost:8080/ClasseurClientWS/services/WSNotificationSOAP's Observer.
Whereas in the server startup logs, I see:
10-Apr-2025 11:36:28.154 INFO [RMI TCP Connection(2)-127.0.0.1] org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass Creating Service {http://c-e.fr/clacli}WSNotification from class fr.itgce.clacli.notification.autogenerated.WSNotification 10-Apr-2025 11:36:38.095 INFO [RMI TCP Connection(2)-127.0.0.1] org.apache.cxf.endpoint.ServerImpl.initDestination Setting the server's publish address to be /services/WSNotificationSOAP.
I do not see where the issue comes from.
I have declared the following in my web.xml:
<web-app xmlns="https://jakarta.ee/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/javaee
https://jakarta.ee/xml/ns/javaee/web-app_5_0.xsd"
version="5.0">
<display-name>ClacliWS</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/context-spring-cc-injection-wsdossier.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- CXF Servlet for web services -->
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
</web-app>
In my bean file (context-spring-cc-injection-wsdossier.xml), the following values:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<!-- Import CXF configuration -->
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
<!-- Define the WSNotificationImpl as a Spring bean -->
<bean id="wsNotificationImpl" class="fr.itgce.clacli.notification.wsimpl.WSNotificationImpl"/>
<!-- Define the JAX-WS endpoint -->
<jaxws:endpoint id="wsNotificationEndpoint"
implementor="#wsNotificationImpl"
address="/services/WSNotificationSOAP"/>
<!-- Define the InvokedService beans with qualifiers -->
<bean id="wsCreerNotifProducteur" class="fr.itgce.clacli.notification.wsimpl.WSCreerNotifProducteur">
<!-- Configure properties if needed -->
</bean>
<bean id="wsRechercherParamNotif" class="fr.itgce.clacli.notification.wsimpl.WSRechercherParamNotif">
<!-- Configure properties if needed -->
</bean>
</beans>
And here is my Apache CXF implementation interface:
@WebService(targetNamespace = "http://c-e/clacli", name = "WSNotification")
@XmlSeeAlso({ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface WSNotification {
@WebMethod(operationName = "RechercherParamNotif", action = "http://c-e/clacli/RechercherParamNotif")
@WebResult(name = "RsttRechParamNotif", targetNamespace = "http://c-e/clacli", partName = "parameters")
public RsttRechParamNotif rechercherParamNotif(
@WebParam(partName = "parameters", name = "QstnRechParamNotif", targetNamespace = "http://c-e/clacli")
QstnRechParamNotif parameters
) throws fr.itgce.clacli.tCore.ws.exception.WSClaCliRuntimeFault_Exception, fr.itgce.clacli.tCore.ws.exception.WSClaCliMetierFault_Exception;
@WebMethod(operationName = "CreerNotifProducteur", action = "http://c-e/clacli/CreerNotifProducteur")
@WebResult(name = "RsttAddNotifDoc", targetNamespace = "http://c-e/clacli", partName = "parameters")
public RsttAddNotifDoc creerNotifProducteur(
@WebParam(partName = "parameters", name = "QstnAddNotifDoc", targetNamespace = "http://c-e/clacli")
QstnAddNotifDoc parameters
) throws fr.itgce.clacli.tCore.ws.exception.WSClaCliRuntimeFault_Exception, fr.itgce.clacli.tCore.ws.exception.WSClaCliMetierFault_Exception;
}
And my class for managing my web service:
@WebService(serviceName = "WSNotification",
portName = "WSNotificationPort",
endpointInterface = "fr.itgce.clacli.notification.autogenerated.WSNotification",
targetNamespace = "http://c-e/clacli")
public class WSNotificationImpl extends SpringBeanAutowiringSupport implements WSNotification {
@Autowired
@Qualifier("wsCreerNotifProducteur")
private InvokedService<QstnAddNotifDoc, RsttAddNotifDoc> wsCreerNotifProducteur;
@Autowired
@Qualifier("wsRechercherParamNotif")
private InvokedService<QstnRechParamNotif, RsttRechParamNotif> wsRechercherParamNotif;
@Override
public RsttRechParamNotif rechercherParamNotif(QstnRechParamNotif parameters)
throws fr.itgce.clacli.tCore.ws.exception.WSClaCliRuntimeFault_Exception, fr.itgce.clacli.tCore.ws.exception.WSClaCliMetierFault_Exception {
try {
return wsRechercherParamNotif.execute(parameters);
} catch (ClaCliRuntimeException exc) {
throw new fr.itgce.clacli.tCore.ws.exception.WSClaCliRuntimeFault_Exception(exc);
} catch (ClaCliMetierException exc) {
throw new fr.itgce.clacli.tCore.ws.exception.WSClaCliMetierFault_Exception(exc);
}
}
@Override
public RsttAddNotifDoc creerNotifProducteur(QstnAddNotifDoc parameters)
throws fr.itgce.clacli.tCore.ws.exception.WSClaCliRuntimeFault_Exception, fr.itgce.clacli.tCore.ws.exception.WSClaCliMetierFault_Exception {
try {
return wsCreerNotifProducteur.execute(parameters);
} catch (ClaCliRuntimeException exc) {
throw new fr.itgce.clacli.tCore.ws.exception.WSClaCliRuntimeFault_Exception(exc);
} catch (ClaCliMetierException exc) {
throw new fr.itgce.clacli.tCore.ws.exception.WSClaCliMetierFault_Exception(exc);
}
}
}
I don't see what I might have forgotten; do you have any ideas?
Here are the different imports that I am using:
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>4.0.4</version> <!-- Make sure to use the latest stable version -->
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>4.0.4</version> <!-- Make sure to use the latest stable version -->
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>4.0.4</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>4.0.3</version>
</dependency>
I tried lot of thing but i can't find :(