Unable to access root context with web service list

332 views
Skip to first unread message

Lipika Rout

unread,
Oct 17, 2023, 6:18:52 PM10/17/23
to WildFly
Hi ,
We are using WildFly 29.0.1 Final with following technology stacks
1. CXF - 4.0.3
2. Spring Framework - 6.0.12

I have deployed webservices by using JbossWS. We also want to view the list of web services generated in the root context Home page. Something similar to this example -

sample_WS_list_page.png

I can access - http://localhost:8080/<root-context>/<webservice>?wsdl
However getting "Forbidden" while trying to access http://localhost:8080/<root-context>

Here is my jboss-web.xml looks like.
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/abc</context-root>
</jboss-web>

Thanks in advance

Lipika




Samson P

unread,
Oct 17, 2023, 6:30:33 PM10/17/23
to WildFly
Hello All,
To add context to the above message from my colleague @Lipika, the above list of available services is generated by the ServiceListGeneratorServlet class out of the box in JBoss-4.2.3.ga, however including any servlet declaration in the web.xml of the war file causes Wildfly to throw the following error in Wildfly 29:
Caused by: org.jboss.wsf.spi.WSFException: WFLYWS0066: Servlet class org.apache.cxf.transport.servlet.CXFServlet declared in web.xml; either provide a proper deployment relying on JBossWS or disable the webservices subsystem for the current deployment adding a proper jboss-deployment-structure.xml descriptor to it. The former approach is recommended, as the latter approach causes most of the webservices Jakarta EE and any JBossWS specific functionality to be disabled.
To mitigate the above error we omitted the declaration in the web.xml for the CXFServlet which brings up the services, but the list is not generated and the context path where we are expecting the list to appear throws a 403 error.

Samson P

unread,
Oct 18, 2023, 1:31:15 PM10/18/23
to WildFly
Hello all,
I was able to find a solution to this issue, and posting it here if it helps anyone.
The fix was to declare my own custom class that extended the CXF servlet as such 
import org.apache.cxf.transport.servlet.CXFServlet;

public class CXFController extends CXFServlet {
public CXFController(){}

}
Then I had to include it in the web.xml, which is a standard process and expected.

<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>
com.ZZZZ.ZZZZ.CXFController
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
And also provide an index.jsp page under WEB-INF

This resolved my issue.
Reply all
Reply to author
Forward
0 new messages