2

I have web services developed using Spring+ApacheCXF and I need tod eploy them on JBoss AS7. They are being deployed by CXFServlet properly.

But JBoss AS7 also deploying them by scanning @WebService annotations(as expected without Spring Injection).

How to disable scanning @WebService annotations in JBoss AS 7?

PS: I am deploying as a .war file.

PS PS: My current cxf webservices are being deployed properly. But JBoss AS7 also trying to scan @WebService classes and deploying them also(without dependencies injected).I am looking for a way to turn of JBossAS7's scanning for @WebService classes.

K. Siva Prasad Reddy
  • 11,786
  • 12
  • 68
  • 95

4 Answers4

4

This applies for Jboss 6 as well. I tried it on my Jboss 6.2.2. Comment the following in standalone.xml

<!-- <extension module="org.jboss.as.webservices"/> -->

Then comment the below snippet in the same standalone.xml. Note if you are using different profile name or in domain mode you will have to do it at similar places.

<!-- 
    <subsystem xmlns="urn:jboss:domain:webservices:1.2">
        <modify-wsdl-address>true</modify-wsdl-address>
        <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
        <endpoint-config name="Standard-Endpoint-Config"/>
        <endpoint-config name="Recording-Endpoint-Config">
            <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
            </pre-handler-chain>
        </endpoint-config>
        <client-config name="Standard-Client-Config"/>
    </subsystem>
     -->
rsh
  • 51
  • 1
  • 4
2

I believe you will want to remove this from your standalone.xml

<extension module="org.jboss.as.webservices"/>

and

<subsystem xmlns="urn:jboss:domain:webservices:1.1">
    <modify-wsdl-address>true</modify-wsdl-address>
    <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
    <endpoint-config name="Standard-Endpoint-Config"/>
    <endpoint-config name="Recording-Endpoint-Config">
        <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
        <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
        </pre-handler-chain>
    </endpoint-config>
</subsystem>

This is what I did to remove the jboss webservices so I could use something else. I'm still in the middle of testing this but it is no longer deploying the services. I assume I will just be able to use spring to deploy. Hope this helps.

alex
  • 61
  • 7
1

I am using exclude-filter in my application context XML file to exclude web service components from Spring component scan.

<context:component-scan base-package="your.application.base.package">
    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
    <context:exclude-filter type="annotation" expression="javax.jws.WebService" />
</context:component-scan>

At the same time I include them in component scan in CXF context XML.

hoaz
  • 9,883
  • 4
  • 42
  • 53
  • I want Spring/CXF to scan them...want JBossAS7 to ignore @WebService. – K. Siva Prasad Reddy Nov 06 '12 at 16:04
  • You should have at least 2 context XMLs in our application, or even 3 if you setup dispatcher servlet with its own context. What I am suggesting you is to write component scan for CXFServlet context that includes WebService components and write component scan in our application context that excludes them. – hoaz Nov 06 '12 at 16:11
0

I'm using JBoss EAP 6.1 and i solved the same problem excluding the subsystems jaxrs and webservices.

jboss-deployment-structure.xml

    <?xml version="1.0"?>

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
        <deployment>
            <exclude-subsystems>
                <subsystem name="jaxrs" />
                <subsystem name="webservices" />
            </exclude-subsystems>
            <exclusions>
                <module name="javaee.api" />
                <module name="org.apache.log4j" />
            </exclusions>
            <dependencies>
                <module meta-inf="export" name="com.liferay.portal">
                    <imports>
                            <include path="META-INF" />
                    </imports>
                </module>
                <module name="javax.mail.api" />
                <module name="org.jboss.modules" />
            </dependencies>
        </deployment>
</jboss-deployment-structure>